Go Down

Topic: Bootloader Atmega32u4 (Read 1 time) previous topic - next topic

BJHenry

#15
Mar 20, 2019, 10:58 am Last Edit: Mar 20, 2019, 10:58 am by BJHenry
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?

Salikas_91

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

BJHenry

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

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.

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.



BJHenry

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.

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.

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?



Salikas_91

I enclose a document for you to better understand my design that includes all the agle files and the fritzing schematic. I also ask you a series of questions.

Thank you for your attention, I thank you very much for what you are helping me.

BJHenry

#21
Mar 27, 2019, 02:33 am Last Edit: Mar 27, 2019, 02:36 am by BJHenry
Ok, I think I understand a bit more now.
Just to be clear I'll go through what I think you've done, and you can tell me if I'm right.


This is a photo of the PCB that you've made.


This is the schematic of that PCB.


This is the layout of that PCB.


This shows all the external components that are connected to the PCB via breadboard.


This photo shows all the external components mounted on the breadboard.

Assuming that all of the above is correct, there are a few issues that I can see.
1) The IC itself is missing the decoupling capacitors. Each VCC and AVCC pin needs to have a 100nF capacitor to ground. These need to be right next to the VCC or AVCC pin.
2) The clock source needs to be as close to the IC as possible. Putting the crystal and caps on a breadboard, and then running wires from the breadboard to the PCB is a recipe for disaster.
3) The USB D+ and D- traces should be as short as possible. O your board you should run the traces straight from the IC pins to the resistors, and then from the resistors straight to the USB pins. Don't stress too much about the meaning of the term 'differential pair'- in this case it you just need to keep the traces short and parallel.
4) You don't need R6. That is going from VCC to GND and is completely pointless.

Honestly, I would scrap your current PCB and start fresh. Put the decoupling capacitors and crystal+caps on the PCB itself, fix the USB data lines and put the HWB and RESET resistors and the UCAP capacitor on the PCB too.


Salikas_91

Hi Bj Henry, first I want to thank you again for the great help you are giving me. I have followed your advice and I have designed a new PCB to make it. I pass photos of the schematic and layout to give me your opinion. Thank you.

BJHenry

#23
Apr 01, 2019, 03:34 am Last Edit: Apr 01, 2019, 03:37 am by BJHenry
Hey, that looks much better. Well done. I'd make a few little changes but you're definitely on the right track.

1) The first thing would be to get rid of all those individual GND traces on the bottom of the board, and use a ground plane instead. This is a reasonable article on what a ground plane is and why you should use one, and here is a guide on how you can do it in EAGLE.
Basically, instead of using individual traces for the ground you leave most of the copper on the ground layer and use that as a ground connection. A good rule of thumb is to run every trace aside from the ground on the top layer, only using the bottom layer if you absolutely have to.
You've put your decoupling capacitors on the bottom of the board- that is acceptable but I'd put them as close to the pins of the IC as possible.

2) Your XTAL1 trace is far longer than your XTAL2 trace. You should rotate the resonator by 180° so that the two XTAL traces are the same length, and then just add a via to the ground plane for the center pin of the resonator.

3) There are a few traces that could be tidied up, this will become more apparent when you use a proper ground pour.

Here is a simple example- you've got traces crossing layers a couple of times where they don't need to.

As a last point, it would be a good idea to beef up your 5V traces. Obviously you can't make them thicker where they join the actual IC pins, but you want plenty of copper in the traces that are carrying the supply voltage all around the board.

Go Up