Author Topic: Creating controller for LED display, help / review needed  (Read 7560 times)

0 Members and 1 Guest are viewing this topic.

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Creating controller for LED display, help / review needed
« on: May 01, 2018, 05:52:55 pm »
I am trying to create controller for LED display (p10 hub12 led modules). The main/biggest problem is that I have no knowledge in electronics (probably not exactly true at this point). The whole thing consists of following parts:
[PC] -> [A male to B male USB cable] -> [USB to RS485] -> [shielded cat5e cable] -> [Controller] -> [LED display]

I have managed to write PC software, create USB to rs485 adapter and controller in way that does work in my home, but it did not work as expected when test controller was connected to real display. There was two visible problems:
- communication with controller somewhat worked once and then it completely stopped working.
- controller restarted at random times.

First cat5e cable shield is not connected, I expect that this is one of all problems. Otherwise my guess is that problem is noisy environment (car service). Trying to communicate with controller RX led was blinking too fast and received data was not usable. The only way I could reproduce something similar at home is plugging monitor or notebook power adapter into extension cord in way that produces sparks.

Searching I found that I might need pull-up resistor for reset pin. By adding it controller no longer restarts (in way I was able to reproduce it without resistor). Controller was saying that it was external reset and datasheet says that RESET pin has internal pull-up resistor. Why does extra pull-up resistor seems to solve restarting problem?

Both PCBs are single sided and are created so I could etch them at home. Are PCBs created so badly that I am just lucky that it works? The end goal is to use double sided boards (home etched boards was meant only for testing), any recommendations with what should I keep in mind when I will try to redo PCBs with two layers?

Help is needed with shielding, it is currently unconnected, because I simply have not understood how to do it / seems that there are multiple ways to do it... On USB to RS485 I have added place / option to connect shield to GND with small capacitor. I really have not understood if that is good way to do it. If I understand correctly then shield should be connected only at one end so it seems that I should connect shield at controller side, because usb device might be unconnected and then shield would not be connected or that should not be problem?

What should I do with extra / unused pairs in cat5e cable? Is it ok to leave unconnected them? Reading about RS485 somewhere I read that unused wires should be connected to GND with resistor, unfortunately seems I have not saved link about it.

Do I need to provide any extra info?
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #1 on: May 02, 2018, 06:24:03 am »
In regards to RESET - it's usually not sufficient to have only internal pull-up enabled, usually you would have something like this, with a button, for a RESET to work properly and to have a bit of debouncing for push-button. Pull-up is usually 10k-100k, but with this MCU I used a much higher one because MCU allows to do so and this is ultra low-power design. Basically, this is based on Atmel's reference designs for their evaluation boards.
« Last Edit: May 02, 2018, 06:25:41 am by Lt_Flash »
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: Creating controller for LED display, help / review needed
« Reply #2 on: May 02, 2018, 07:53:04 am »
I'd strongly recommend you to connect the USB and CAT5 cable shields to GND, using a solid ground plane, on both ends. One can see often other strategies to connect the shield, from my experience the solid GND connection is the only one that works reliably. Maybe (depending on your setup) an isolation may be required to break a ground loop from the PC to the LED display.

For the unused pins of the CAT5 cable, one could connect them to GND, or just leave them open. More GND is most cases a good choice.
Safety devices hinder evolution
 

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Re: Creating controller for LED display, help / review needed
« Reply #3 on: May 02, 2018, 12:39:08 pm »
In regards to RESET - it's usually not sufficient to have only internal pull-up enabled, usually you would have something like this, with a button, for a RESET to work properly and to have a bit of debouncing for push-button. Pull-up is usually 10k-100k, but with this MCU I used a much higher one because MCU allows to do so and this is ultra low-power design. Basically, this is based on Atmel's reference designs for their evaluation boards.

I don't use reset button, only thing that is connected to RESET is PDI. I have no problem adding pull-up resistor, 10k seems to work, but I would like to understand what might have caused RESET pin to go bellow 1.32V to trigger RESET. Or maybe it is not only RESET pin, but all power has dropped too low? But then should not chip report that it was brown-out reset not external?

I guess I should remove pull-up and make sure that brown-out is enabled and see if controller will report now that it is brown-out reset not external reset...

I'd strongly recommend you to connect the USB and CAT5 cable shields to GND, using a solid ground plane, on both ends. One can see often other strategies to connect the shield, from my experience the solid GND connection is the only one that works reliably. Maybe (depending on your setup) an isolation may be required to break a ground loop from the PC to the LED display.

Well almost every time I read about and RS485 I see that shield should be connected only at one end. So I am even thinking about using unshielded connector at USB to RS485 adapter side to make sure that it is never connected at both ends.

Also the problem is that I have not understood how to properly connect shield to GND, because it seems that I should not connect it directly to GND. Is small cap "right" thing to do?

For the unused pins of the CAT5 cable, one could connect them to GND, or just leave them open. More GND is most cases a good choice.

So one pair for A and B and all other directly to GND?
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #4 on: May 02, 2018, 12:57:35 pm »
Yes, that's quite strange, I've checked the manual and it says "The RESET pin includes an internal pull-up resistor" and it's a 25kOhm resistor, which is more than enough to keep it steady. You can check reset status register after such reset occurs to see the cause of it.  Maybe that was a WDT reset? I got cought by that when I was starting with Atmel SAM devices, WDT was enabled by default and was resetting the device every 16 seconds.
 

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Re: Creating controller for LED display, help / review needed
« Reply #5 on: May 02, 2018, 01:17:39 pm »
You can check reset status register after such reset occurs to see the cause of it.

That is how I know that it is external reset. :) Thinking more about it it seems that there is no need to test if I get brown-out reset. If whole pcb has too low voltage then pull-up would not help...

What kind of things happens with voltage and/or current when there are some sparking when connecting other devices?
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #6 on: May 02, 2018, 02:14:48 pm »
If that was a BOR reset or POR - status register would have that, but you're saying it shows External reset, which means power was ok. Maybe RESET line pull-up is not enabled in fuses (if it can be enabled in there, I never worked with ATMEGAs) as that line is shared with PDI?
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: Creating controller for LED display, help / review needed
« Reply #7 on: May 02, 2018, 02:23:39 pm »

I'd strongly recommend you to connect the USB and CAT5 cable shields to GND, using a solid ground plane, on both ends. One can see often other strategies to connect the shield, from my experience the solid GND connection is the only one that works reliably. Maybe (depending on your setup) an isolation may be required to break a ground loop from the PC to the LED display.

Well almost every time I read about and RS485 I see that shield should be connected only at one end. So I am even thinking about using unshielded connector at USB to RS485 adapter side to make sure that it is never connected at both ends.

Also the problem is that I have not understood how to properly connect shield to GND, because it seems that I should not connect it directly to GND. Is small cap "right" thing to do?
One can often read what you said you read. It's simply wrong for most applications.
Connect the shield as solid as possible to GND and if applicable, to your metallic chassis. If you don't have a metallic chassis or enclosure, it is even more important to tie the shield to GND solidly. Use no components in series with this connection, make a really bold connection.


For the unused pins of the CAT5 cable, one could connect them to GND, or just leave them open. More GND is most cases a good choice.

So one pair for A and B and all other directly to GND?
If you don't need the other pairs for other signals, that would be OK, or just leave them open. But you should at least have one connection for GND within your cable (as you did in the original plan).
Safety devices hinder evolution
 

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Re: Creating controller for LED display, help / review needed
« Reply #8 on: May 03, 2018, 05:40:23 pm »
I have redone controller part. My I ask for some PCB layout review? Anything that is obviously wrong? Or any suggestion on how I could improve it?

Changes:
- removed all 0 ohm resistors that was used as jumpers
- added 10k pull-up resistor for RESET pin
- RJ45 shield and unused wires are connected to GND
- Removed second SN74LVC8T245
- Removed pins for keyboard
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #9 on: May 03, 2018, 05:45:44 pm »
I'd created a solid ground plane on both sides of the board. Also, have a look at this article in regards to bypass capacitors.

https://electronics.stackexchange.com/questions/74509/how-to-place-decoupling-capacitor-in-four-layer-pcb
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #10 on: May 03, 2018, 05:49:03 pm »
One more thing - it's best to have a 'star' or 'single point' power traces design, coming from same point, while yours are almost all serial, that leads to higher resistance, impedance and antenna effect, have a look at these articles:

https://www.maximintegrated.com/en/app-notes/index.mvp/id/3630

And this one is the best, I think, have a look at 2.2.2

http://www.ti.com/lit/an/szza009/szza009.pdf
« Last Edit: May 03, 2018, 05:51:06 pm by Lt_Flash »
 

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Re: Creating controller for LED display, help / review needed
« Reply #11 on: May 03, 2018, 06:28:25 pm »
I'd created a solid ground plane on both sides of the board.

Why? What do I gain by doing it? Or what problems I could have not doing it so?

Also, have a look at this article in regards to bypass capacitors.

Thanks for your reply. May I ask at least for little explanation what is wrong with way I have done it or why it is wrong. The linked question itself is about capacitor placement on 4 layer PCB, but I use only two layers (not sure if that changes anything, I have not read comments and answers yet).
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #12 on: May 03, 2018, 06:54:10 pm »
Ground plane is basically a big shielding, it reduces any EMI effects and also structurally it makes the board more sturdy as most of the copper stays on it. In regards to power lines - you've got a very long power trace going from one current user to another, each trace has resistance and impedance, so effectively after each device that consumes current you're getting a small voltage drop, as any trace has resistance. Also, any trace has impedance and capacitance and impedance is basically acting as a resistor, trying not to change magnetic field and thus not allowing for current to flow, this also reduces current. Yes, it's all very small values but it's still not recommended to have a power trace, that's why we have 4 layer boards - basically they have signal traces on both sides and then a solid ground and power planes in the middle.

In regards to bypass capacitors you should take into account the same - your power traces design is in series and if your MCU is switching it's outputs fast and you connect VCC points from bypass cap to next bypass cap on next chip and so on - capacitors may not charge fast enough and that would cause troubles for MCU as it will not have enough power. Bypass caps are basically devices that can provide current fast when it's required. Here's another example from TI about bypass layout. In your case you can just put traces up and down from the cap, not sideways, as you did. Also, if you have ground plane on top (don't forget to put multiple vias connecting it to bottom ground plane) - you just need to connect power line and the other end of capacitor will have perfect connection to ground.

http://slideplayer.com/slide/4662087/15/images/31/Bypass+Capacitor+Routing.jpg
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #13 on: May 03, 2018, 06:55:15 pm »
Have a look at this picture too:


 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #14 on: May 03, 2018, 06:58:39 pm »
And another good example why you would want to have a signal layer GND plane. Also, by the way, it dissipates heat very well, so, for example, for all my LiPo charger designs I'm always using GND planes on both sides with as many vias as I can put close to charger IC and power polygons instead of just traces. Here you can see a 'Signal ground' which is just a top ground plane, and you can see VCC lines for capacitors.
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #15 on: May 03, 2018, 07:04:24 pm »
You can have a look at my project here:

https://workspace.circuitmaker.com/Projects/Details/LtFlash/Sandwich-Battery-Charger

There is a release documentation down below so you can see schematic and PCB but here's an example of bypass caps ties directly to ground plane on one side and to power polygon on another, capacitors C3, C4, C5, C6 and C7.

And pretty much any device on this PCB that requires ground connection is directly attached to the top ground plane, which is very useful, you don't need to think about best ground trace layouts and connection is rock-solid.
 

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Re: Creating controller for LED display, help / review needed
« Reply #16 on: May 05, 2018, 03:53:52 pm »
In your case you can just put traces up and down from the cap, not sideways, as you did.

Not sure if I understood this part... :( Anyway, I tried to redo power traces. Should I try to keep traces on top or it is better to route at least some power traces on bottom side?

Also your linked images shows something very similar how I have placed capacitors so I don't get what is wrong with them. :( Or was it because of power traces?
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #17 on: May 05, 2018, 08:38:59 pm »
The power looks very good now. In regards to bypass caps - I meant it has to be like C15 on your PCB, with a single shortest possible track to power and to ground and as close as possible to MCU pins. C7 and C17, for example, are not optimal because their ground traces are bent. With C7 - why did you put that trace sideways anyway? There's plenty of space to put it directly below the cap! That's why I posted this picture, for example:



Also, if you'd have a GND plane on top layer - you wouldn't need vias to the back of your board. For bypass caps one of the links I showed before says 'Preferably there should be no vias for bypass caps and they should be located on the same side of the board where IC is'. Of course, on these low frequencies it would work anyway, but you've asked about good design. As to my opinion - GND planes on both sides are good, they're shielding your board, providing easy connections - you don't need vias or traces, they act as heatsinks and so on. The less vias you have - the better, ideal design would use just a single side of your board.
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #18 on: May 05, 2018, 08:43:27 pm »
Also, you can replace all the power traces past voltage regulator with a big power polygon. Any CAD would just make cutouts in that polygon for traces and you just need to rearrange them so they don't break the polygon, or make the polygon not square, but with many points. Again - that's better because it won't act as an antenna picking up EMIs and impedance would be much lower. And on top of that polygon just draw a square one covering the whole top side of the board for GND. That would actually simplify your design even more. But, of course, that's up to you :) Just my opinion.
 

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Re: Creating controller for LED display, help / review needed
« Reply #19 on: May 06, 2018, 02:02:17 pm »
Also, if you'd have a GND plane on top layer - you wouldn't need vias to the back of your board. For bypass caps one of the links I showed before says 'Preferably there should be no vias for bypass caps and they should be located on the same side of the board where IC is'.

Ok, removed vias and put also gnd plane on top layer. Is that really better? Now GND plane under atxmega chip is almost completely separated from remaining gnd plane on top... Also I think I read that traces should first connect to capacitor and then to pins, but now gnd first connects to pins and only then to capacitor (C7, C16).
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #20 on: May 06, 2018, 11:40:44 pm »
Just have a look at connection width to ground plane now under ATMega chip and compare it to several small vias that were there before. Also, just to make sure, you can add more vias to bottom GND plane under the chip, just to be sure you're safe :)

In regards to capacitors - in the example picture I've shown there was a ground trace going to via under the chip and that's not good, of course. In your case - you've got a solid connection to ground, so it's good path for current to flow.

Now, after you've put the solid ground plane you can see there are still gaps in top ground like ones near IC3. You can either put vias to bottom ground plane in this case or rearrange your traces so they would be closer to each other to resolve this issue. The same with MAX3468 - rearrange traces so GND plane can fill the space, add vias to GND near bottom connector. And also, this is my personal preference, but I prefer to use solid joining of polygons to components, not the 3-point joint like you've done. Effectively you've created three thin traces to each ground from ground plane. You can usually change this in polygon settings. Nothing too bad about this as it's still a good solid connection, just my preference.
 

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #21 on: May 07, 2018, 12:07:54 am »
By the way, you still need several vias from top ground to bottom one, that's important, as they must be well connected to each other! Usually you put some vias in corners of the board, but not too close to the sides, and also, of course, you put vias in the middle to fill all the gaps and usually under the chips too.
 

Offline muktupavelsTopic starter

  • Contributor
  • Posts: 19
  • Country: lv
    • muktupavels.id.lv
Re: Creating controller for LED display, help / review needed
« Reply #22 on: May 07, 2018, 09:42:13 pm »
Is there any recommendations or something like that about vias? How many do I need? Is one via under chip enough? Centered?
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: Creating controller for LED display, help / review needed
« Reply #23 on: May 08, 2018, 05:53:10 am »
If you want to go this route (placing vias all over the board), I'd recommend to place them in a raster (maybe 5mm ... 10mm). IMO this isn't necessary for this kind of circuit, but won't harm anyway. Another good thing to look where to place the vias: If a plane (no matter which side of the board) is slotted by one or more traces, place vias left and right of these traces, to the plane on the other side will connect over the slot.

From my experience, this board looks good enough, though it may be a good excercise to go all the way. I'm more concerned about the other board, you should do the same style redesign there.

Anyway (another IMO), I wouldn't have redone the board, but in the first place just bodged some solid ground connections across the existing boards (most important would be to solidly ground and tie together the USB and RJ45 shields) to see if this strategy helps (has done quite often).
Safety devices hinder evolution
 
The following users thanked this post: muktupavels

Offline Lt_Flash

  • Regular Contributor
  • *
  • Posts: 78
  • Country: au
Re: Creating controller for LED display, help / review needed
« Reply #24 on: May 08, 2018, 02:13:15 pm »
Usually it depends on how much current is going from VCC to ground. In your case it's a low-power board, so you don't need too many vias and they not necessarily should be under the ICs. You put vias under ICs usually under QFN ICs that have a thermal pad under them, like LiPo chargers or DPAK MOSFETs. So, just put several vias about 1cm away from corners of the board and you should be fine. And, just to be sure, you can add some vias where ground planes are not looking too solid. And I'd add vias everywhere where traces have broken your GND plane just to refill it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf