SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
#189506
hcb wrote:Hi, all, I have been looking at the Arduino boards for awhile and I have an Uno but I'm trying to plan stand-alone uses of the Arduino and I'd like to get some clarification, please.

My goal is to develop code on the Uno board then buy the naked chip cheap and have the code run on that new chip so it's inexpensive to build a project and leave it in place with the chip (instead of having an Arduino board for every project or having to buy a bootloaded chip). Reading online gives me a variety of ways to "DIY" an Arduino but I've not read anything which seemed very clear to me. Maybe it's just me.

What I understand (which may or may not be right) is that the Arduino is an implementation of the ATMega chips like the ATMega328P-PU (IIRC, for the Uno). I can buy the ATMega328P chips for about 3-4 dollars easily. What I further understand is that the actual Arduino chips have a bootloader installed which I guess enables it to communicate with the other functions on the board like the USB adapter so it can be programmed from the computer. But some reading about programming the ATMega328P chip indicates that, if you have one which does not have the bootloader installed, you can wire it up to your Arduino board to program it (with the Arduino chip removed from the Arduino board, Uno in my case). This gets me confused because I would think then that one could simply put a blank chip in the Uno board and just program it but apparently it doesn't work that way.

Further reading, as always, "if I understood correctly what I read", indicates there are different bootloaders available for the ATMega328P (and similar chips). If that's correct, why choose one bootloader over another? Another observation I'd like to have cleared up is this: it seems "Arduino" as a brand is a commercial product with its own programming IDE and that IDE is what is enticing about using an Arduino instead of another IDE or chip (like the PIC microcontrollers with Microchip's IDE).

Is there a good discussion of this somewhere you could link me to?

Your time and information is appreciated.

Thank you.

--HC
I've spent hours and hours today messing with this. Here's what I have so far, somebody explain where I'm wrong, please.

First, one problem may be me; coming from a Microchip/PIC/MPLAB IDE background (but not much of it) I expect to have selections in the IDE for different target chips. With the Arduino, it seems the "different chips" are selected based on the Arduino boards. The Arduino stuff is not a way to program Atmel chips, it's a way to program certain Arduino boards which implement certain microcontrollers. So, if I choose a certain Atmel chip (say, ATtiny4/5/9/10, for instance), there's no guarantee I can use the Arduino IDE/software to do this.

Second, the Arduino IDE doesn' t have (at least in my looking for it) a way to tweak "fuses" for different settings. Specifically, putting a bootloader on a new 328 with the 8 Mhz internal clock, I cannot change it to use an external clock meaning, once I put the bootloader on the chip, I cannot replace it on the Uno board because the chip is set to use the internal clock and selecting the Uno board as the "the board" it fails to upload a sketch. Selecting the (I'm not going to spell this right) Diecimilla/duoina whatever with 8 Mhz onboard clock is what I have to do to then use the Uno with a "new" bootloaded chip. So, once I bootload a new chip set to use its onboard clock, I'm stuck using that onboard clock.

Third, there are a number of bootloaders available but no information I've found as to why to use one versus another. The one built into the Arduino IDE works (IDE version 1.7.9) so why would I need another?

All I'm left with is that there is some VERY basic information about how to go from "monolithic"/very simple IC's to microcontrollers using Arduino and Atmel solutions which I have not found or overlooked.

Where did I go wrong?

Thank you.

--HC
#189509
hcb wrote: While this may read "abrupt", I don't mean any offense; where can I find a complete Arduino for less than $3 or $4?
Go on Alibaba/Aliexpress and search for Arduino. I have some ProMicros I got for $2 each @qty 10 ($4 each with USB/serial converter board) and I think the Unos I have were about $5 each at a quantity of 5 or so. Shipping from China runs less than $5, but the shipping time is inconsistent. I received my last order today: it took about 7 days. The previous order took about 3 weeks to get here. I generally buy a lot of stuff that I think I may need so I don't have to wait so long when I do need it.

You can use the Arduino IDE to program non-Arduino boards, but it can get cumbersome. AVR Studio 6 with the Arduino plugins makes it much easier. I have a Tiny85-based board that I use some Arduino libraries on. Since this is not an Arduino board, I build the code with the Arduino IDE (you can do it in AVR Studio as a non-Arduino project, but it takes a while to fixup all the dependencies manually, so using the IDE is easier), then I find the directory where the .HEX file was saved by the IDE and I use avrdude or Studio 6 to program my board using a 6-pin ISP connector.

That method works once you have it all figured out, but I wouldn't recommend it for everyday use.
By stevech
#189584
lyndon wrote:I'm well aware of the problem of counterfeit parts, but at these prices, I'll take the risk.
So it's OK to steal intellectual property, use another company's logo and fake part numbers, and so on?

That's just nice.
By lyndon
#189595
stevech wrote:
lyndon wrote:I'm well aware of the problem of counterfeit parts, but at these prices, I'll take the risk.
So it's OK to steal intellectual property, use another company's logo and fake part numbers, and so on?

That's just nice.
So you assume that because parts are low cost they must be counterfeit? I can point you to people who exercise tight control over their supply chain, and still end up with counterfeit components. Paying more doesn't guarantee squat.