2
\$\begingroup\$

I have to implement a rs232 receiver for my project. Does any one have any idea on how do I start learning / implementing this. Do i have to use the nios ii software or just implement it using verilog modules?

http://www.altera.com/education/univ/materials/boards/de2/unv-de2-board.html - The de2 board

http://www.altera.com/literature/ug/ug_embedded_ip.pdf Chapter 7 - UART core

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

You can either use the provided core or write your own.

The C bit is probably for use with a processor core, so you almost certainly don't have to use it with C. What the core is written in doesn't matter either as it's only the function you care about.

You need to either use a soft core processor and connect using whatever bus system Altera provide (and maybe use C), or write your own module and connect to the necessary "pins" on the module to control it. In the datasheet you linked to it gives details on the registers for control and data. You would access these through the address and data ports on the module.

It may be useful to find an example RS232 to give you an idea of what is necessary. Take your time, if you are new to this as it may take quite a while to get up to speed.
Pong P Chu's "FPGA Prototyping with Verilog Examples" is a pretty good book, it starts from the beginning and works up to things like UART implementation with example code, etc. Also I'm sure Altera have loads of examples on their site (probably the DE2 board comes with some too)

Here is a decent run through of writing a UART in Verilog. It is a few pages long so you have to click on the "next" link at the bottom of each page. At the end it has a link for the full code.

Note that in order to design something you need to have a good idea of how it works, otherwise you are flying blind. If you are not familiar with the inner workings of UART then have a read up on this too (the above link goes into some detail)

\$\endgroup\$
1
\$\begingroup\$

Just implement the UART function using VHDL or Verilog. Outputting the data to LEDs will demonstrate that it is working.

\$\endgroup\$
6
  • \$\begingroup\$ What do you mean by the UART function ... are you referring to the UART module? Because I was just reading the rs232 core ftp.altera.com/up/pub/Altera_Material/11.0/… It has implementation in c? Dont understand that \$\endgroup\$
    – user591124
    Commented Nov 14, 2011 at 22:50
  • \$\begingroup\$ Create your own UART using VHDL or Verilog, or find one you can use. \$\endgroup\$ Commented Nov 14, 2011 at 22:56
  • \$\begingroup\$ electro-tech-online.com/general-electronics-chat/… Will this be fine and how do i set the baud rate, data bits and other setting \$\endgroup\$
    – user591124
    Commented Nov 14, 2011 at 23:07
  • \$\begingroup\$ Have you looked at the DE2 manual and especially section 4.9 and the CD-ROM, as recommended yesterday? I don't know if this helps but you need to know. \$\endgroup\$
    – Russell McMahon
    Commented Nov 14, 2011 at 23:19
  • \$\begingroup\$ I have and also had a look at the rs232 datasheet provided on my cd ... it looks like i might have to implement shift registers to get this working but it is still prob best to go with the examples ... What i am not sure about now is how do i get them to sync (use the same baud speed) \$\endgroup\$
    – user591124
    Commented Nov 14, 2011 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.