cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
red1
Observer
Observer
478 Views
Registered: ‎10-27-2019

uart

hello team

any tips about sending/receiving data using the serial port with genesys2 in vhdl?

0 Kudos
14 Replies
dpaul24
Scholar
Scholar
466 Views
Registered: ‎08-07-2014

@red1 ,

Xilinx UART IP core or your own IP core?

You need to be specific....I can give you 1 tip and I can also give you 10 tips on UART.

Please specify what you exactly want to know.

 

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem

0 Kudos
red1
Observer
Observer
449 Views
Registered: ‎10-27-2019

I need to send an image stored in ROM in Genesys 2 to a pc through the serial port using but VHDL.

or otherwise, send it from pc to Genesys 2 and display it on VGA.

thank you

0 Kudos
bruce_karaffa
Scholar
Scholar
432 Views
Registered: ‎06-21-2017

You still didn't answer @dpaul24 's question.  Will you use an UART IP core or will you write your own UART code?  Do you plan to use the USB/UART bridge?  Do you have software for the PC to do something with the image or will you just spit out the received data on a serial terminal?  How do you plan to format the data?  Will you have an interface which contains each pixel's location or will you just send everything in a certain order and hope everything stays in sync?

When sending an image to the board, you will need to store it until the entire image is received.  I don't think a UART will be fast enough to keep up with the refresh rate.

0 Kudos
red1
Observer
Observer
420 Views
Registered: ‎10-27-2019

I want to write a simple UART code in VHDL for tx and one for RX. whenI send data from Genesys iI receive it one by one using Matlab.

for transmission, the same thing, I send from Matlab and try to store it ram then display it on VGA.

I hope I am being clear now

0 Kudos
bruce_karaffa
Scholar
Scholar
410 Views
Registered: ‎06-21-2017

OK, you want to write your own UART.  Most of the UARTs and UART-like things that I have written are similar.  They have a baud rate generator, a state machine to receive bits and a state machine to send bits.  This is easier if you pick a single baud rate and protocol, that is a set number of start bits, stop bits, whether or not you are using parity or flow control.  Just pick the options your PC expects.  You will want to run your system clock considerably faster than your baud rate, probably by at least a factor of ten.  This shouldn't be a problem.  Sync up your received bits to the system clock.  Detect a high to low transition of the received data bit.  On the system clock cycle most consistent with the middle of the baud period, increment the state machine to receiving data bits.  One baud period after this, grab the data bit, count how many you have received.  If you have them all, move to the state where you verify the stop bit(s).  Go back to the state where you are waiting for a start bit.

Have you done a web search for UART code?

red1
Observer
Observer
405 Views
Registered: ‎10-27-2019

yes, I have a state machine code for receiving now I am working on the transmitting part, is it the same?

0 Kudos
dpaul24
Scholar
Scholar
330 Views
Registered: ‎08-07-2014

@red1 ,

yes, I have a state machine code for receiving now I am working on the transmitting part, is it the same?

It is same in the sense that an UART sends and receives data one bit at a time. But the process of sending and receiving is of course different.

It is good that you want to develop your own UART module. There are many working examples in the internet, you can use one and study it using simulation to understand how its VHDL code is working.

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem

0 Kudos
red1
Observer
Observer
259 Views
Registered: ‎10-27-2019

Actually I have been looking on few example in the net but although simulation works no data is received. I juste need a small example that sends an image from genesys2 to a pc.

0 Kudos
dpaul24
Scholar
Scholar
254 Views
Registered: ‎08-07-2014

@red1 ,

Actually I have been looking on few example in the net but although simulation works no data is received.

You need to have the design properly constrained for the Genesys board.

Also you UART baud rate should match with the serial interface baud rate of the PC.

Try send a simple 8 bit data first and see if you can receive it in your PC.

Other than the above points, you (I neither have the design nor the hardware to check and verify what can likely go wrong) have to find out what is failing.

Alternatively you might use UART IP core from Xilinx (which should function also in hardware).

I juste need a small example that sends an image from genesys2 to a pc.

Note: UART is not the preferred way to send images, it is way too slow for transmitting an image file.

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem

0 Kudos
red1
Observer
Observer
252 Views
Registered: ‎10-27-2019

UART IP is sci port which I don't know how to configure.

I am aware that serial is too slow but I need to send back juste one image.

Do you recommend any other way to transmit to the pc?

Thanks

0 Kudos
watari
Teacher
Teacher
196 Views
Registered: ‎06-16-2013

Hi @red1 

 

I'm sure that uart is too slow.

So, would you implement SDIO controller to read data from micro SD card ?

 

Best regards,

0 Kudos
red1
Observer
Observer
183 Views
Registered: ‎10-27-2019

Yes I agree with you watari. Can you show me how to do that with genesys2?

0 Kudos
watari
Teacher
Teacher
176 Views
Registered: ‎06-16-2013

Hi @red1 

 

For example, would you refer the following URL ?

 

https://opencores.org/projects/sdcard_mass_storage_controller

 

Best regards,

0 Kudos
red1
Observer
Observer
133 Views
Registered: ‎10-27-2019

Thanks watari for your reply but I could not register in opencores. Could you send it to me in private at kaibouredouane@gmail.com

0 Kudos