Edit: Somehow I posted this in the Programming topic on accident. I'm hopeful a moderator can move it to the "Microcontrollers" topic where I had intended to post it. oops. :~
Hello. I am in the final stages of making a custom application board that is based on the Leonardo. As such it has the ATMega32u4 processor. I'll be placing a fresh copy of this processor as it arrives from Atmel and I want to make sure I fully understand the process of adding the Leonardo bootloader to the processor, and making sure I have all the pins accessible as needed for this process.
- It is my understanding that I cannot add the Leonardo bootloader directly from the USB. Instead I must use an external programmer and attach to the ICSP pins of the processor. It looks like the pins needed are Reset, and the SPI Clock, MISO and MOSI lines.
I'm not sure exactly what external programmer to use, but it looks like there are several options, and I'll cross that bridge when I get to it, but I want to make sure I do have the pins accessible to the programming header correctly so there won't be any hardware problems.
- I don't understand how the #HWB pin works (the pin 33/PE2 on the processor). Leonardo has this pulled low through a resistor, as do some other derivative boards. I'd like to use this pin as a general I/O after programming, which I can still do even if it has a pull down on it (I think?). Reading the actual data sheet of the processor, it's kind of cryptic. Do I need to do anything special with this HWB pin other than pull it low? I'd assume not as a regular Leonardo works okay without messing with this, but I don't know if maybe they did something with it during initial programming of the Leo board?
From the DS:
HWB – Port E, Bit 2
HWB allows to execute the bootloader section after reset when tied to ground during external
reset pulse. The HWB mode of this pin is active only when the HWBE fuse is enable. During normal
operation (excluded Reset), this pin acts as a general purpose I/O.
I looked up the HWBE fuse and that was even more unclear. Does this HWBE bit need to be handled in any special way, or is it set properly back in step 1 where I use the ICSP and the external programmer to burn in the Leonardo bootloader hex?
Thanks in advance. If there are any other details I may have missed I'd appreciate the heads up.
Thanks,
-Kevin