Jump to content
  • 0

Uartlite communication in MicroBlaze design fails on Cmod A7 board


stunix

Question

Dear experts,

I have a MicroBlaze design using uartlite on my Cmod A7 board. Uart communication between the Cmod A7 and a Raspberry Pi works fine both ways when debugging/stepping through the code. However, when simply running, the Cmod A7 receives all packets as expected but the replies it sends seem random. Both the Cmod and the Pi have the same uart settings (9600 baud).

To me this issue seems like a problem with the clock, since communication works fine when stepping through the code, but fails when running normally.

Another, less likely, cause could be that the Cmod board is powered via USB when debugging but through the pins when running normally. Not really sure how this could affect uart communication though.

Any help would be greatly appreciated.

Thanks!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Hi @stunix,

You have a few different voltages to choose from when powering from the pins as described in the Cmod A7 reference manual here in section 1.1 Power Input Options. 

1) What voltage and amperage are you using to power the Cmod A7?

2) What are you using to power the Cmod A7?

3) Are you able to get normal uart communications with your PC when powering through the USB?

4) Have you tried using different USB cables?

thank you,

Jon 

Link to comment
Share on other sites

3 hours ago, xc6lx45 said:

>> but through the pins when running normally

could it be a simple grounding issue?

This was indeed my first suspicion. However, I connect TX, RX and GND between the Cmod and the Pi, so I would think grounding is fine (but please correct me if I'm wrong).

2 hours ago, jpeyron said:

Hi @stunix,

You have a few different voltages to choose from when powering from the pins as described in the Cmod A7 reference manual here in section 1.1 Power Input Options. 

1) What voltage and amperage are you using to power the Cmod A7?

2) What are you using to power the Cmod A7?

3) Are you able to get normal uart communications with your PC when powering through the USB?

4) Have you tried using different USB cables?

thank you,

Jon 

1) I'm powering the Cmod A7 with 5V / 3A.

2) I'm using a lab power supply.

3) Yes

4) No. The USB cable seems fine. It works for programming, debugging, etc.

 

Thanks.

Link to comment
Share on other sites

Hi @stunix,

If both the Cmod A7 and the Raspberry Pi are being powered through an external power supply from the general source (i.e. a power strip) that should be fine. Any differences that would exist in that case should be mitigated by connecting the grounds like you described.

How are you monitoring the packets being sent to and from the Cmod A7 and the Raspberry Pi? In general, I would expect that it would be a timing error based on what you described, but I'm not certain.

Thanks,
JColvin

Link to comment
Share on other sites

>> problem with the clock

BTW, UARTs are pretty robust towards frequency error because the sampling instant re-syncs every byte.

Electrical interference could be an issue, since there is more noise on the power supplies when the CPU is busy. What I'd try is look at the signal with a scope, or add some resistor to ground. A ferrite choke might also help, if it's a noise problem.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...