• 0
stunix

Uartlite communication in MicroBlaze design fails on Cmod A7 board

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!

Edited by stunix

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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 

Share this post


Link to post
Share on other sites
  • 0
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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

>> 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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now