Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20718 Discussions

Help with RS232

Altera_Forum
Honored Contributor II
1,406 Views

hello all, 

 

i am newbie here. would any of u know how to take in 10 bytes of data serially from RS232 to MAX using VHDL codes?  

 

Please further explain it with how the thing works including how the baud rate,frequency..etc is being used. 

 

 

thanks~!!
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
589 Views

First be aware of the voltage levels. Check out an RS232 driver data sheet and compare the electrical interface to your system requiremnts Then, search on UART Universal Asynchronous Reciever Transmitter. There are some code examples I found from google that get you half the way there. Looking for help from Altera I only find UART IP core references, such as users manuals. Putting one in a PLD, I assume you don't need all the fnctionality of a 16650. A 16650 is an old UART discrete part that is pretty much a standard now, and you can also search on that. There is also a Xilinx application note that promises a code exaple download: XAPP341. The two sentance summary is a minimalist asynchronous serial interface with an idle data line that you over sample to detect a transition that indicates a start of a word (start bit). You assume the bit period +-5%, clock in a byte, and wait the number of stop bit periods. There are optional buffers, controls, and handshaking. I see a couple complete descriptions on the web when I search on RS232 white paper .

0 Kudos
Altera_Forum
Honored Contributor II
589 Views

First of all, thanks for your reply. do you deal with RS232 before? may show me the basic concept? (using block diagram,flow chart etc..) 

 

sorry that i got no idea about how both RS232 and FPGA communicate using the codes.. 

i am currently doing on assignment and i am so lost.. 

 

thank you!
0 Kudos
Altera_Forum
Honored Contributor II
589 Views

i know there is a lot of codes can be found online. am i deal with both the transmitter and receiver codes? i found some codes but i hardly understand how both the things talk to each others.... 

 

sorry for troubling... 

 

thank you.
0 Kudos
Altera_Forum
Honored Contributor II
589 Views

I can only help with small bits and helpful pointers. For in depth help, you would do well to find a local coworker to dialog with. On your own, start with tutorials like: 

 

http://jamesthornton.com/freebsd/articles/serial-uart/ 

 

Start with understanding the simple two wire serial communications interface that transfers a byte, and expand from there. Two wire serial is in many EE text or reference books.
0 Kudos
Altera_Forum
Honored Contributor II
589 Views

you may be able to use the uart provided in SOPC Builder. 

 

--dalon
0 Kudos
Altera_Forum
Honored Contributor II
589 Views

although i am not fully understand..anyway thanks a lot! 

 

and what do u mean by the uart provided in SOPC Builder? 

how does it works?  

 

thanks...
0 Kudos
Altera_Forum
Honored Contributor II
589 Views

Hi 

Using SOPC builder you can build a system with user defined/ Altera provided peripherals.. 

just drag and drop the components into the SOPC builder and your system would be ready.. 

I guess you need to go through the literature to understand what and how usefull it is.. 

 

http://www.altera.com/literature/quartus2/lit-qts-sopc.jsp
0 Kudos
Reply