Does ATMEGA32U4RC-Au ic come with bootloader?

I'm making ATMEGA32U based pcb and I'm wondering do I need to include ISP pin headers to burn bootloader to the microcontroller or is it possible to do that through usb?

Also how I should wire reset pin because I don't include a reset button on the board.

Any other tips for beginners like can I use 5v voltage for the ATMEGA32U? I hope this thread is going to help many other beginners as well.

Yes, you do.

In complete honesty, this kind of design work is not appropriate for beginners. Follow some reference design instead. We can answer questions about any variations you need.

Generally, also, for a question like this it would be extremely helpful if you could post any work that you have already completed. In detail.

Have you read this?

As part of the ISP programmer header, carefully following the manufacturer's recommended reset configuration.

Beginners can greatly benefit from the many detailed tutorials on line describing minimal configurations, such as this excellent tutorial.

1 Like

thank you for answering to me. I know this isn't beginner friendly, but I have motivation for learning about arduinos but for me it's hard to find simple examples that I can understand easily.

This is my current design

Is that mosfet wired correcly to power the led if it uses 50mA. My main language isn't english so reading datasheets is painful, so can anyone correct me if this led can't handle 50mA

led datasheet

I'm planing to use 10 leds so the mosfet or somekinda switch that arduino can control is critical, because arduino can't handle 50mA from it's I/O.

this is the datasheet for my mosfet: mosfet datasheet

Does ATMEGA32U4 specify anywhere what kinda crystal oscilator should I use? any good THT oscilator examples so I can compare to my current one?

Do I need that diode for the reset pin?. I Have read that without it arduino can be damaged because of high voltage spike. Is this correct?

Anything I should be aware when I'm making the pcb and wiring everything?

I'm thankful for every answer!

Good begin. The Mosfet need a resistor too.

For my own projects with ATmega I don't use USB and bootloader. I use ISP. For debugging FTDI usb=>uart cable. Or first use Migthy core board.

Will you use exact baudrates (for the BT)? Then use 14.7456MHz otherwise 16MHz. Isn't an ATmega with at least 2 UART a better choice?

Pay attention with the used symbols.


Left is the common used ground symbol. You use that for the 5V. Second is (safe) earth. At right there where the 2 most used symbols for the +5V.

A rotary encoder needs only one interrupt pin.

Port F isn't correct. Must be Port A. Try to set the ports together in your symbol. Not at pin number.

Never used.

Edit: I use this oscillator. Not TH but the 44 pin ATmega32U is SMD too. For TH that is a 40 pin.

edit 2: where do you connect the USB D+ en D-? Why you don't use TXD and RXD for the BT?

Thank you for your tips.

I don't use USB and bootloader

For me I have found programming with ISP is difficult and messy. So that is why I do like to have bootloader. Usb is for power and sending HID-commands like volume up or down so that is why I have to use ATMEGA32U4.

I don't have FTDI usb => uart cable or Mighty core board and I would like to keep this simple as possible as I would not make more than 5 boards. I do have other arduinos that I can use to burn the boot loader.

where do you connect the USB D+ en D

Usb D+ and D- are connected to pin 3 and 4 that are labeled as D- and D+

I was planning to use software serial for BT. if I connect BT to TXD and RXD, will arduino mess with those pins when I upload code throught usb connection and if I wire it like you suggest can I communicate between BT and computer throught usb without any code? So I need 14.7456MHz oscillator to communicate correcly to BT. BT device have by default 115200 baud rate. JDY-08

Pay attention with the used symbols.

Sorry about those symbols. I'm self taught and there isn't lot of tutorials around this subject that I could find and I don't see those those +5V symbols that you recomended in easyeda I use to make these pcbs.

A rotary encoder needs only one interrupt pin.

I do know that rotary encoder need only one interrupt pin, that was just for safety if I make mistake in wiring.

Port F isn't correct. Must be Port A.

I think I wired the rotary encoder entirely wrong. Now I wired it like this rotary encoder

Good begin. The Mosfet need a resistor too.

I change the mosfet wiring to this


But do I need that R1 or is the R2 enough because if it is needed aspull down resistor? and for clearance Every led have it's own mosfet because I need to control them separately.

what do you mean by this " . Not TH but the 44 pin..." As I said before my main language isn't english so can you open it more for me?

The 44 pins ATmega32 is a small SMD with less then 0,5mm between the pins. Outer dimensions 10mm by 10mm. The T(hrough)H(ole) variant is 40pins in DIL 40.

For only one led, you can use BC547 (TH) transistor or BC817 smd. Or ULN2803 for 8 leds.

115 200Bd isn't a problem for hardware serial (max 230 400Bd). That software serial works fine is another thing. The one say no problem. Another says works not. Maybe it shall works with 18.4320MHz crystal on a 20MHz processor.

You connect D+ and D- to other pins then RXD/TXD. I miss the FTDI or similar USB=>UART IC. For bootlader it is not enough to connect the data wires. The USB section from ATmega 2560

Atmega644 has 2 hardware UART. PD0-PD1 for UART0 and PD2-PD3 for UART1 and is pin compatible with the ATmega32.

I might change my mosfets to that ic.

I don't understand what do you mean by ATmega 2560. ATMEGA32U4 have that USB chip inside of it so It can be programmed to be as keyboard so uploading code should be possible without external USB => UART IC

Does it come with that USB IC so I can use it as HID or keyboard device and program it through usb without external USB => uart ic?

ATMEGA32U4 (arduino leonardo) comes with one hardware serial (serial1) as I found from here Does ATMEGA32U4RC-Au ic come with bootloader? So I could use hardware serial

Why sould I use 14.7456MHz oscillator rather than 16MHz? Is it going to effect the hardware serial (serial1) somehow?

Look at the datasheet. 14.7456MHz is a communication crystal. Hasn't error at normal baudrates. Page 190 at 16MHz and 115 200Bd there is -3,5% fault. Page 189 at the same baudrate with 14.7456 MHz there is 0,0% fault until 230 400Bd.

If you make your own PCB you can place a ATmega that you like. ATmega32 <=>Atmega644. More RAM for ATmega644. 2 UART for 644.

Both don't have bootloader. You must program the bootloader and you must make the bootloader hardware.

Where did you found that?

ATMEGA32U4, like this one

Here is little bit more detail bootloader of ATMEGA32u4

The Atmel ATmega32u4 gained popularity with its use in the Arduino Leonardo, due to the built-in USB support, which made an additional chip unnessary for that purpose

So I'm thinking I could burn the bootloader using ISP (arduino as ISP) and after that I could use usb to program the sketch to the microcontroller witch is ATMEGA32U4RC-AU
and RC means it have internal clock so It can be programmed using ISP without external clock. I use that board If I messed up something and external crystal isn't working correcly

Do you have the chip? When I see at mouser 0 stock, On Order 14.081 Expected 01-May-23 Farnell has stock but don't deliver private.

Sorry, I don't have the microcontroller and that is why I'm asking for help here. I could have done testing If I hade the microcontroller.

Where do you go to buy him?

from microship

use search tool in chrome and search for ATMEGA32U4RC-AU or from ebay where they are around 5-10$

I just remembered I do have A-Star 32U4, but it's limited and I do not have the BT module

On a 32U4 based board, there is no relationship between RX/TX on the one hand and USB on the other. So your bluetooth on RX/TX will not interfere with upload over USB when using (on of) the standard 32U4 bootloader.

Thank you for your answer!

I had that kinda problem with arduino mega when I accidentaly connected lcd display to tx and rx pins on the arduino mega board. But that was because it have another arduino that have the usb chip inside and it's used to program the ATMEGA2560 is connected to those serial wires?

But I think I'm safe with 32u4 board.

I do not quite understand the remark about the 2560. Does it have a relationship with your questions about the 32U4.

Standard bootloaders for the 32U4 use the built-in USB of the chip for the upload via USB. You're using a 16MHz crystal and 5V so you should be able to burn the Leonardo bootloader via ICSP. To repeat myself, they do not use TX and RX; and you can happily use TX/RX for the BlueTooth module.

The sketch that you upload to a 32U4 based board (or other boards with native USB) contains a small piece of code that has two functions

  1. Allow the PC to identify the board while the sketch is running.
  2. Support software reset (open and close the com port with a baudrate of 1200 baud) to invoke the bootloader.

Be aware that a poorly written sketch can cause either of those functions to fail and you can no longer upload using USB in an easy way. To be able to invoke the bootloader in those situations, you need to provide a means to reset the 32U4 and invoke the bootloader; therefore I suggest that you add a reset button to your board or at least two pins (reset and GND) that you can easily connect a reset button to.

A comment on the 2560
TX/RX are shared with the TTL-to-USB converter on the Mega board. Connecting anything to the TX/RX pins can interfere with the upload. A 2560 however has 4 UARTs so in general you can use TX1/RX1/ TX2/RX2 or RX3/RX3 (Serial1.. Serial3) for communication with e.g. a BlueTooth module and not have problems.

Yes, I was thinking It will be same for 32U4 chip, but it's not if I have understood correctly.

can I use 14.7456MHz one like he/she recommends for me?

this is good to know!

I have those pins already on my ISP/ICSP (I think those means same thing?) pins.

You can, I would not. You will have to adjust the core files so millis() is indeed one millisecond again. Or live with the fact that millis() is about 6% slower.

I didn't even think it would be a problem. Since I don't know much C, I don't like editing core files. It would be too painful for me. If I use 16MHz do I need to edit those files?

does the 3% error affect the uart a lot when sending a very small amount of data to the BT chip.