UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
7,682 Views
Registered: ‎02-12-2013

Microblaze MCS UART sending incorrect characters.

I have Microblaze MCS clock set to 100MHz and on my board I have a 100MHz oscillator going to Microblaze. I have set the UART baud in MCS to 9600. In my Microblaze code I'm printing a simple "hello world" message using the "print" function that sends data to the UART pins of my board. I then, have a FTD chip connected to the UART pins on board that converts TXD and RXD to USB. I have this chip connected to my PC and am using secureCRT or putty to monitor the data sent from Microblaze. But I keep getting this:

 

[³²²d%¶ìv²å

 

instead of:

 

Hello World

 

First I thought maybe my FTD chip is not properly grounded but I checked that and it is properly grounded.

Then I thought maybe my FTD chip is not functional but I looped back the RX and TX of the FTD and could see characters properly echoed back. So my FTD chip is working.

 

Is it possible that a 9600 baud cannot be generated from a 100MHz clock? (I have tried a few other baud rates but still see garbage characters.) If so, what clock frequency do I need to use to generate 9600 baud? Or with 100MHz cpu clock what bauds can I generate? I don't really care what the baud rate, or what the input clock frequency is as long as it works.

 

Any help is much appreciated.

 

Thanks.

0 Kudos
3 Replies
Adventurer
Adventurer
7,673 Views
Registered: ‎01-29-2013

Re: Microblaze MCS UART sending incorrect characters.

Is it possible the baud rate could be set incorrectly in your C program? Can you paste some simple code that shows how you're setting up the uart and sending the data?

0 Kudos
Adventurer
Adventurer
7,662 Views
Registered: ‎02-12-2013

Re: Microblaze MCS UART sending incorrect characters.

Thanks for the reply. Here's my code:

#include <stdio.h>
#include "platform.h"

void print(char *str);

int main()
{
init_platform();
print("Hello World\n\r");
cleanup_platform();
return 0;
}

Looking at xparameters.h I see the following lines which shows the baud is set at the correct rate (I think):

#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_FREQ 100000000
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_USE_UART_RX 1
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_USE_UART_TX 1
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_BAUDRATE 9600
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_PROG_BAUDRATE 1
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_DATA_BITS 8
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_USE_PARITY 1
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_ODD_PARITY 0
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_RX_INTERRUPT 1
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_TX_INTERRUPT 1
#define XPAR_MICROBLAZE_MCS_0_IOMODULE_0_UART_ERROR_INTERRUPT 1

0 Kudos
Adventurer
Adventurer
7,649 Views
Registered: ‎01-29-2013

Re: Microblaze MCS UART sending incorrect characters.

Your clock should be fine... have you tried disabling hardware/software flow control in your terminal emulator program on the PC?

 

Did you perhaps have the baud rate set to something else previously and maybe you are configuring the chip with an old bitstream?

0 Kudos