Jump to content
  • 0

ZyboZ7 UART receive


TeemuAtLUT

Question

Hey, pretty new the world of FPGAs and I'm trying to get UART working in both directions.

I'm using the internal UART1 example "xuartps_low_echo_example" provided by the SDK.
Vivado version is 2018.1 and I'm using Windows 7.

The outgoing serial works with both the "xil_printf" function as well as by writing characters to XUARTPS_FIFO_OFFSET.
In the example code, the process never runs past

while (!XUartPs_IsReceiveData(UartBaseAddress));

But I can receive the correct characters on the PC side. Using either the SDK terminal or by using PuTTY, I can receive the ASCII characters "0123456789:;<=>?".
When I try to send characters from the terminal to the board, only the TX led blinks.
COM port settings are 115200 baud rate, 8 data bits, 1 stop bit, no parity, no flow control.

The ZyboZ7 examples on Digilent reference page are mostly for Vivado 2016.4 and don't synthesize successfully.

I've tried with different USB cables.

I've tried the same example code with ZedBoard and MiniZed boards and they worked without any modification.

Only way I've been able to successfully send data to the ZyboZ7 is by using PetaLinux. The terminal showed me the characters I sent and I was able to run commands.

I've also tried Automatic Echo and Remote Loopback modes with no success.

I've attached images of my simple block design. I also included the example c code but it's unmodified from the imported example.

The final intention of the project is teaching students how to work with ARM features, modules and registers.

Thank you for any assistance.

ZyboZ7_Vivado.PNG

ZyboZ7_Zynq_block.PNG

xuartps_low_echo_example.c

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Hi @TeemuAtLUT,

Here is a completed Zybo-Z7-20 set up like your block design.  I used Vivado 2018.1, master xdc from here and the Digilent board files (tutorial here). I was able to get the project to work for both tx and rx. In Tera Term I had to change the baud rate to 115200 and to click into terminal setup and select local echo and  change transmit to: CR+LF. I have attached screen shots below.

thank you,

Jon

zybo_z7_uart_1.jpg

zybo_z7_uart_2.jpg

zybo_z7_uart_3.jpg

Link to comment
Share on other sites

Great! Thank you.

However, unfortunately I don't think your solution works. I may be wrong on this but using Local echo would defeat the purpose and judging by the name of the feature, it merely plays back input characters on the terminal. Also I think in principle a serial connection should not require a specific terminal software to be used.

I can't tell from your terminal window when you used lower or upper case characters but the code is supposed to change the case of the received character. This still does not work for me. The character is played back just as I sent it.

Furthermore only the TX led blinks when typing. Just like before.
And sending ESC character doesn't terminate the example like it should.
Running the code in debug mode shows that it never breaks from the waiting while loop.

All this leads me to believe that the sent character is still not received and I only see the sent characters (in the wrong case) because Local echo is enabled in the terminal.

Link to comment
Share on other sites

Hi @TeemuAtLUT,

The example code takes the letters entered in the serial emulator and returns the opposite case.

if (('a' <= RecvChar) && ('z' >= RecvChar)) {
            /* Convert the Capital letter to a small. */
            RecvChar = RecvChar - 'a' + 'A';
        }
        else if (('A' <= RecvChar) && ('Z' >= RecvChar)) {
            /* Convert the small letter to a Capital. */
            RecvChar = RecvChar - 'A' + 'a';

I have attached a screen shot of the project i linked above without selecting local echo. The project receives the entered letter and transmits back the same letter but the opposite case. In the previous screen shot i used use local echo to see what i am typing to verify i was getting the opposite case letter back.

thank you,

Jon

zybo_z7_uart_4.jpg

Link to comment
Share on other sites

Alright, I spent some time trying to track down what had caused my issue but eventually I ran out of time and had to move on.

How I solved my issue was I created a completely new Vivado project from the start and didn't disable anything as I had done before. I only enabled the UART1 functionality and then proceeded to test the example in SDK. I also used the Block Automation tool with preset enabled. Maybe that made a difference, maybe I had just disabled something I shouldn't have.

Not sure if I'm any wiser in the end but I do have a working project that I can use and I must thank you for your assistance.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...