verilog code for rs232
Here's my version of a blog on how to get this UART working. Its a complete backup of my workspace
on the project in its natural tree form, and there is also a zip file of the project if you want to download it in
one fail swoop (3mb) the backup is here:
http://jleslie48.com/fpga_uartjl_01/
and the zip file of that is here:
**broken link removed**
You will also notice a notes sub-directory where these notes and discoveries are being
documented here:
**broken link removed**
I even used microsoft word to try and clean up the notes.txt file a bit.
Anyway, here is the project so far, and I'd appreciate some insight as detailed in step 6) below.
- Jon
Notes.txt:
090120
- ok so I started this project and I admit it, I'm scared and I don't really know what I'm doing.
I have the Digilent Virtex-II development system with the ISE 10.1 and Impact 10.1 software packages:
http://www.xilinx.com/products/devkits/XUPV2P.htm
This project started with the sources and chapter 7 of:
FPGA PROTOTYPING
BY VHDL EXAMPLES
Xilinx SpartanTM-3V ersion
Pong P. Chu
Cleveland State University
the authors website has even a download of the examples:
http://academic.csuohio.edu/chu_p/rtl/fpga_vhdl.html
and even chapter 7 as a pdf file:
http://academic.csuohio.edu/chu_p/rtl/fpga_vhdl_book/fpga_vhdl_sample_chapter.pdf
In this backup of my project,
all the examples from the book are stored in this tree as \vhdl_examples
and all the sources I think I need are stored in \orig because
I'm sure I'll be modifying them and so I wanted to store off my originals.
as I make milestones, I imagine new directories of backups will emerge,
named \buxx_somethingdescriptive
as this forray will also be kept online, I will zip it up and store it in the root
directory under zipYYMMDDx_somethingdescriptive.zip
so anyone wishing to follow in my footsteps or play along can do so.
with that said lets begin.
1) I started a new project with ISE 10.1 Project Navigator.
2) after that huba-balloo, I clicked 'add existing source' and added all the
source I thought I needed from the examples. I had previously put copies of
those sources in the root of the project.
I even took a screencap:
\notes\screencap01_firstsource.png
**broken link removed**
so far so good.
3) I then clicked 'synthesize -XST'. The arrows chasing each other thingy changed after
a few seconds to a spinny type thingy and the bottom view section started spewing
all kinds of report stuff. All well and good and I ended up with some warnings, which
I'd like to discuss a little later. Here's the screen cap:
\notes\screencap02_firstsynth.png
**broken link removed**
the error messages are:
Analyzing Entity <uart_test> in library <work> (Architecture <arch>).
WARNING:Xst:753 - "C:/jon/fpga_uartjl_01/uart_test.vhd" line 29: Unconnected output port 'db_level' of component 'debounce'.
Entity <uart_test> analyzed. Unit <uart_test> generated.
Analyzing generic Entity <uart> in library <work> (Architecture <str_arch>).
DBIT = 8
DVSR = 163
DVSR_BIT = 8
FIFO_W = 2
SB_TICK = 16
WARNING:Xst:753 - "C:/jon/fpga_uartjl_01/uart_core.vhd" line 37: Unconnected output port 'q' of component 'mod_m_counter'.
WARNING:Xst:753 - "C:/jon/fpga_uartjl_01/uart_core.vhd" line 46: Unconnected output port 'full' of component 'fifo'.
Entity <uart> analyzed. Unit <uart> generated.
Now I haven't used a UCF file yet, and I believe that I must, so I'd like to discuss that in a very short time period,
but let's continue with what I have done so far.
4) I then hit the 'implement design' arrow thingy. It was very obedient and started spinning as well. whe it was all
done it was very happy. No errors or warnings. Here's the screen cap of that result:
\notes\screencap03_firstimplement.png
**broken link removed**
5) checking the pinouts. well somewhere in my travels, someone mentioned looking at the pinout report for useful stuff.
so here it is:
\notes\screencap04_firstpinoutrpt.png
**broken link removed**
6) well now I want to take a break and review a few things, I can see that my pinout report has some useful stuff and some
not-so useful stuff. for instance, RX and TX I think have to somehow be associated to the DB9 that is on my board (the
root directory has a UCF file RS232.UCF in it, that I believe I should use, and the pinouts of this "hard" uart should be
properly level shifted yes?) This example also assumed a spartan 3 evaluation kit which I guess has a digital readout
and I think that is what those led<x> things are, so I want to get rid of those. I also have a question about the clock
situation. the chapter describes that all the communication is to be synched up with a clock pulse divided by 16 * something
or other (see 7.2.2) now this is all well and good, but I imagine my system clock is different (ok, I admit it, I don't even
know where it is.) and so those calculations need to be adjusted.
So at this point I'm looking for advice and review of my work so far. Can anybody give some insight into the issues I've
raised in 6) above?