1
votes

I have just finished a project using an Arduino Micro dev board and want to move to a standalone ATmega32.

I need to run this at 3.3V and I dont want to go down the overclocking road so I have an 8MHz crystal to put on it.

I still want to be able to upload sketches via USB and the Arduino compiler so I gather I need to burn a different bootloader.

For this purpose I have purchased a USBASP programmer.

I am slightly unsure of what to do next - everything I can find on the topic either relates to the ATmega328 or to burning bootloaders using another Arduino.

I have worked out that I need to modify boards.txt to point to the correct bootloader....but which is the correct bootloader for ATmega32 at 8Mhz?

Also do I need to change any fuses?

Thanks

2
AVR studio is what you need. - LPs
I'm not sure at all, but i'd try with the original Optiboot project. I say that there is a Mega32 bootloader; you can try to download the archive, then modify the boards-1.6,txt file to add another variant. You can use the same binary as the original one (which runs at 16MHz) but change the clock speed and, maybe, the baud rate (just halve it if the bootloader does not reply). Change the bootloader tool (not sure how to do it, but I think you need to set the USBASP). Then try it... Check the fuses on the datasheet to be sure. And... Why the 8MHz crystal? Usually I avoid it since the 328 has... - frarugi87
... an internal oscillator at 8MHz, so I can use it simply changing the fuses (and saving one crystal and two capacitors). I only use crystals where I need higher precision, but then usually run at 16MHz... - frarugi87
Hi, Thanks for your help. My project is a race timing system requiring a very precise clock that can keep its time well. So I am not sure the internal clock will cut the mustard. - Nick Thornton
That's not about the C programming language and not about Arduino. And you should first read the ATmega datasheets. Raw programming does not require a bootloader. - too honest for this site

2 Answers

0
votes

I think you're a bit out of luck.

The ATmega doesn't have hardware USB, so I assume the bootloader is using V-USB to implement USB. That stack, being a software implementation of USB's high-speed signalling, requires at least a 12 MHz clock (higher is better).

I don't think you can run V-USB using only the internal 8 MHz oscillator.

0
votes

According to the OP comments the micro is indeed an Atmega32u4, not an Atmega32 (@OP: please fix the question to match this).

Since it has onboard USB, you can use a pre-existing bootloader like the sparkfun one:

https://www.sparkfun.com/products/12587

Here you have the link to one of their products, the Arduino pro micro 3.3V (which runs at 8MHz). You can add the sparkfun arduino boards repository to your IDE and then just use the board specification for their pro micro 3.3V do upload the correct bootloader and to program it through the USB just like the usual Arduino Micro.