Bootloader Atmega32u4

Good morning, I'm Alberto and I'm new to this Arduino world.

I'm making a homemade PCB with an ATMega32u4 from Atmel. I have loaded the Bootloader by SPI using an Arduino Micro and according to the IDE of Arduino the Bootloader was loaded correctly. Then I loaded the blink example of the Arduino IDE using the option to upload as a programmer and the 32u4 turned it on / off for the assigned output pin, but when I unplug the Arduino programmer (in this case the Arduino micro) it no longer turns on / turns off the Led . Does this mean that the bootloader has not been loaded correctly? Should the program be saved in my ATMega32u4? And because when I connect it to the PCB the IDE does not recognize it? I hope you help me, Thanks.

If you uploaded the blink example using the programmer, it erased the bootloader, so you will need to load the bootloader again.

Sounds like you might have another problem though, because the 32u4 will contain the blink program until you reprogram it with something else. There may be some error in the PCB you built, if you could post more information, such as the schematic and a picture, someone may be able to help with that.

I attach an image of my manufactured PCB that only contains the 32u4, the USB with its two resistors and an input voltage regulator. The other image is the assembly on the PCB of all the components.

I return to attach the images because previously there had been some error.

There are a couple of problems with that board, assuming it is a single-sided board.

  1. You're missing the decoupling capacitors for the ATMega.
  2. It looks like you might be running a voltage regulator from the USB voltage. If it a 5V regulator then that won't work well at all.
  3. Where is the clock source for the ATMega?
  4. It appears that you've broken PE2 out to a header pin- this should be tied to GND to allow the bootloader to work.

Really, we need to see a schematic to be able to offer concrete help.

Here you have an outline of my PCB assembly. When I only feed my PCB via USB (UVCC = VCC), my PCB turns the LED on and off, but it is not recognized by the PC. What problem can occur that my PCB is not recognized?

BOOTLOADER_32U4_Y_LED_esquemático.pdf (1.31 MB)

Protoboard

BOOTLOADER_32U4_Y_LED_protoboard.pdf (1.28 MB)

Using Fritzing to draw diagrams like that isn't much help. See how there are multiple spots where one wire covers another? It also doesn't give us details about individual parts.
Having said that, you were obviously able to upload the blink example sketch. If you did that using another Arduino as an ISP then you have overwritten the bootloader. You'll need to burn the bootloader again and then try to upload over USB.

I will upload a detailed schematic of my complete montage so that you understand it better, but before I wanted to ask you something,

If I load the bootloader in the Atmega32u4, should the Arduino IDE recognize my PCB when it connects to the PC, or should I change the bootloader's fuses?

Thank you,

regards

When you use the 'Burn Bootloater' option in the IDE it also sets the fuses correctly.

Thanks for the previous answer. So, what is the problem with your PC and your PCB is hardware

Salikas_91:
Thanks for the previous answer. So, what is the problem with your PC and your PCB is hardware

That last sentence doesn't make any sense. Are you using something like Google Translate? Maybe you could change your original question and ask again.

Sorry for not expressing myself correctly, I wanted to ask you, discarding the need to change the fuses as you said in the previous answer, if the problem that the PC does not recognize my PCB could only be hardware.

It might be hardware, but it might also be caused by the bootloader having been overwritten when you uploaded the blink sketch using an external programmer. Please try these steps in this exact order:

  1. Connect your external programmer (I think you were using an Arduino Micro as an ISP?) and use it to upload a blank sketch. Check that the LED is no longer blinking.
  2. Use the external programmer to Burn Bootloader.
  3. Disconnect the external programmer and connect a USB cable, see what happens.

If you get any error messages along the way then post them here.

Hello BjHenry, I followed your instructions, first I loaded the sketch in white and the led stopped blinking, then I loaded the bootloader and finally I connected my pcb to a PC, but my PCB is still not recognized. If the bootloader loads correctly, my pcb should be recognized, right?

Yes, I would expect so- provided the wiring for the USB connector is correct. Given that you are running wires from a breadboard to the USB breakout board my next thought would be that is the problem.
Are you using Windows? If so, do any 'Unknown Devices' show up when you plug in your board?

I've tried it in window and Mac, and neither of them has anything of 'unknown device'.

I reckon there's an issue with the way you've wired the USB port to the breakout board then.

I have checked the continuity of the USB connector tracks that go to the atmega and I have measured the input voltages Vusb = 5V and the data D + = 0V and D- = 3.25V (or vice versa) and according to the data sheet , those values ​​are within the range.

My idea is to make in the future a PCB with all the necessary components to develop my goal and with the smallest possible size.

But first I made a test PCB that only contains the Atmega32u4, the mini_B_USB connector and a regulator that for the time being we ignore because VCC is 5V.

I enclose 3 files so you can see if I have an error in my design or mount in the Protoboard:

File .Sch of the design of my PCB.

File .Brd of my manufactured PCB

File .Fzz of the protoboard assembly of all the components.

Salikas_91:
I have checked the continuity of the USB connector tracks that go to the atmega and I have measured the input voltages Vusb = 5V and the data D + = 0V and D- = 3.25V (or vice versa) and according to the data sheet , those values ​​are within the range.

That's a good start, but good USB communication requires more than just race continuity. The USB data lines should be dealt with as a differential pair. This application note from Silabs has a good overview on designing for USB communication.
Your USB wiring, where you're using leads connecting to breadboard connecting to resistors etc could well be causing the problems you're seeing.

Salikas_91:
My idea is to make in the future a PCB with all the necessary components to develop my goal and with the smallest possible size.

That is a good idea. Look at the track layout of other boards that have onboard USB for a guide.

But first I made a test PCB that only contains the Atmega32u4, the mini_B_USB connector and a regulator that for the time being we ignore because VCC is 5V.

Salikas_91:
I enclose 3 files so you can see if I have an error in my design or mount in the Protoboard:

File .Sch of the design of my PCB.

File .Brd of my manufactured PCB

File .Fzz of the protoboard assembly of all the components.

You've attached three photos which show three different things. In the future can you please name your picture something more helpful so that people can tell what they are supposed to be?

Captura de pantalla 2019-03-21 a las 13.11.22.png appears to show the board layout of the PCB you have already had made. I'm not surprised it didn't work. It is missing too many components. There are also two airwires- I can't tell what they are but they can't be helping the situation.

Captura de pantalla 2019-03-21 a las 14.05.15.png is a completely different circuit schematic, as is Captura de pantalla 2019-03-21 a las 13.11.11.png. They don't appear to have any relation to the board you've already made, can you explain what they're for?