Go Down

Topic: Bootloader 3.3v 8MHz (Read 12243 times) previous topic - next topic

guest1102

Hy everyone,

I want to bootload a new atmega 328 (smd) with the arduino bootloader, using my UNO as ISP.
Does it work if I bootload it using 5V logic and supply power, and then using it in a 3.3V environment?
Which board model should I choose in >Tools >board, the "pro mini (3.3V 8MHz) /w AtMega 328?

Thanks,
Andy

johnwasser

You can burn the bootloader at 5V and use it at 3.3V.

The "LilyPad Arduino w/ ATmega328" and "Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328" should both work equally well for your board.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp
See who has no social life: https://forum.arduino.cc/index.php?action=stats :)

guest1102

Thanks for your quick reply, johnwasser.
That helps me a lot.

markab

If I load the pro mini 3.3 8Mhz boot loader onto a 328 TQFP do I need an external 8Mhz crystal with that boot loader?  If I want to run on the internal clock what which boot loader would I use?

dc42


If I load the pro mini 3.3 8Mhz boot loader onto a 328 TQFP do I need an external 8Mhz crystal with that boot loader?

Yes.


If I want to run on the internal clock what which boot loader would I use?


If you run using the internal clock, the clock speed won't be accurate enough for ordinary serial comms, so you can't use a bootloader [unless you calbrate the clock, which isn't easy]. You can program your sketch directly unto the chip using ArduinoISP instead.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

johnwasser


If I load the pro mini 3.3 8Mhz boot loader onto a 328 TQFP do I need an external 8Mhz crystal with that boot loader?  If I want to run on the internal clock what which boot loader would I use?


The clock source is set by the bottom four bits of Fuse Low Byte.  The the top bit of FuseLowByte is the CKDIV8 but which, when programmed (0) sets the initial clock divider to 8.  The factory default for Fuse Low Byte is 0b01100010 (0x62): Calibrated (8MHz) Internal RC Oscillator and set the pre-scaler to 8 for a resulting default of 1 MHz.

The "LilyPad Arduino w/ ATmega328" and "Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328" both have bootloader.low_fuses set to 0xFF which selects a prescale of 1 and a "Low Power Crystal Oscillator, 8-16 MHz"

To try the Calibrated (8MHz) Internal RC Oscillator, change the bootloader.low_fuses to 0xE2 and re-burn the bootloader.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp
See who has no social life: https://forum.arduino.cc/index.php?action=stats :)

markab

I managed to burn the pro mini 3.3 8Mhz boot loader onto the TQFP chip no problem with an external resonator however I can't load sketches.

I can see the micro get's the auto reset but then all I get is programmer not responding with no other messages.  I have double checked my hookup and can't see any issue.

Any ideas?

KirAsh4

I just went through this.  By default, it will not upload through ISP.  You can burn the bootloader that way, but not upload sketches.  You have to change/add the 'upload.using' line in boards.txt so you can upload through ISP.  Or you can do what I did which was to break out the FTDI required pins and upload sketches through that.  That way I didn't need to keep my Uno in perma-ISP mode, I only used it to burn bootloaders and after that I used a standard FTDI cable to upload sketches, leaving my Uno to do other stuff.

markab

Hi, thanks for the reply, It is while I am trying to upload a sketch with an ftdi that I am having a problem.

dc42

1. What is the error message you are getting when you try to upload a sketch? You might need to enable diagnostic output.

2. Which 328 variant exactly are you using?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

johnwasser

I have read warnings that the internal RC oscillator may not be accurate enough for serial communications (such as uploading).  Serial communications detects the start of the start bit by the rising edge, counts out 1.5 bit times, then samples the data 9 time in what should be the middle of 8 data bits and 1 stop bit. If the timing is more then 5% off it will take the last samples too early or too late.

The internal oscillator comes factory calibrated, but only at one temperature (25°C) and voltage (3.0V) and only to 10% accuracy.  You can manually calibrate the oscillator to 1% accuracy by setting the OSCCAL register.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp
See who has no social life: https://forum.arduino.cc/index.php?action=stats :)

markab

Hi all thanks for the reply's, The chip is an ATMEGA328P TQFP

I am using an external 8Mhz oscillator in this case, the boot loader (3.3 Pro mini 8) burned with no problem using the arduino as ISP.

When I now try to upload sketches through FTDI, I see the chip getting the auto restet then the only reply I get is programmer not responding.

markab

I tried this again last night with no luck, I decided to try and upload the sketch directly with the avrisp I changed the preferences file to upload using avrispmkii but when I tried to burn the sketh the IDE was still expecting a serial port.

Do I need to modify anything else to make that work?  still stumped as to why I can't upload sketches with ftdi, the only thing I wonder is if the 8Mhz resonator that I am using is not up to the job.

KirAsh4

Going out on a limb here, but do you have the required 0.1uF cap on the reset line for the FTDI?  Without it, you will get all kinds of issues.  It's the same thing when you don't put a 10K resistor on the SPI reset line ... learned that the hard way.

dc42


I tried this again last night with no luck, I decided to try and upload the sketch directly with the avrisp I changed the preferences file to upload using avrispmkii but when I tried to burn the sketh the IDE was still expecting a serial port.

Do I need to modify anything else to make that work?  still stumped as to why I can't upload sketches with ftdi, the only thing I wonder is if the 8Mhz resonator that I am using is not up to the job.


The resonator should be fine, I use 8MHz ceramic resonators too and they typically have a frequency tolerance of 0.5%. See http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/ to see what worked for me (I didn't use a bootloader, I just uploaded the sketch via the ICSP pins).
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up