Go Down

Topic: Standalone arduino project  (Read 367 times) previous topic - next topic

Mjoy99

I am trying to build a humidity controller with an atmega 328 PU using the internal 8Mhz clock.  I have extra chips that I purchased off Amazon that come with the arduino bootloader already installed but set for the external oscillator.

When I try to burn the bootloader on the chip for the atmega 328p with 8MHz internal clock I get an error and bootloader doesn't load. Error is a type mismatch and says I can override with -F.  I see no options for command line flags. Also all the examples have bread board 1.6.x where I have 1.9 ide.  Do I need to load an older version of an IDE to make this work? Do I need to get chips without the bootloader factory installed?

Any recommendations or help is welcome.

pert

-F won't solve your problem so there is no need to waste time on that. You can't do anything with chips that are configured for an external oscillator unless you have some sort of external clock source connected, thus the error. You only need a clock source connected to the chips long enough to change the fuses to use the internal oscillator.

Mjoy99

Is there a way to pop the chip on the ardunio uno board and change the bootloader there? or should I just spring for an oscillator and some capacitors to do it on a breadboard?

Hiddenvision

#3
Jul 22, 2019, 07:19 pm Last Edit: Jul 22, 2019, 07:22 pm by Hiddenvision
I thought you could use an Arduino as an Atmel programmer.

Some of the Nano boards I have use the old boot loader.
To update them I Just export the compiled binary. (sketch menu)
Normally you will find two hex files one with and one without the bootloader
Then use anything that can program the Atmel chip.
I happen to use an AVRISP in Atmel studio to do that mostly but like I said there is some Arduino code to use any working Arduino as a programmer and I have used that in the past to do the same.

https://www.youtube.com/watch?v=GWKFfCpGae4

If you do not have a working Arduino or another method to program the atmel devices you need to buy or make one.

pert

Is there a way to pop the chip on the ardunio uno board and change the bootloader there?
Yes. The Uno has a ceramic resonator that will provide the necessary clock source.


or should I just spring for an oscillator and some capacitors to do it on a breadboard?
I certainly wouldn't be satisfied if I didn't have a handful of 16 MHz crystals and the required load capacitors sitting in my parts stash. Even if you don't need them for your current project, these are the sort of "jelly bean parts" that are bound to come in handy eventually if you continue with your exploration of electronics.

pert

Is there a way to pop the chip on the ardunio uno board and change the bootloader there?
Just to be clear, as Hiddenvision said, you will need an ISP programmer to connect to the Uno that contains your target chip. You can't change the fuses on the target chip with the carrier Uno alone.

jremington

#6
Jul 23, 2019, 04:08 am Last Edit: Jul 23, 2019, 04:10 am by jremington
Quote
should I just spring for an oscillator and some capacitors to do it on a breadboard?
Put the chip on a breadboard, with decoupling capacitors, and use another Arduino to provide the oscillator and program it, following this excellent tutorial.

Hint: rather than buy ATmega chips, buy the $2 Pro Mini clones from ebay. You can easily remove the regulator and power LED with a solder pencil, to make the equivalent of a "bare bones" Arduino suitable for battery power.
No PM's please.

Go Up