RS 232 receiver using spartan 3 board

I am trying to capture RS232 data on the xilinx spartan 3 fpga on the spartan 3 development board..I have had no luck yet..For some reason, i am not able to sample the incoming data.I am using a clock that is 16X data rate of incoming rate which is 9600 Hz. I have a 16 wide shift register set to X"FFFF" and i sample the input until my shift reg is x"00FF" so i know for sure that i am at the center of my start bit or somewhere close to it.then i have a state machine that goes and counts every 16 cycles and gets one bit of information.

any ideas or literature that i can use here would be helpful..thanks.

Reply to
fpgawizz
Loading thread data ...

"fpgawizz" schrieb im Newsbeitrag news: snipped-for-privacy@localhost.talkaboutelectronicequipment .com...

Have a look at xapp 223. Have a look at

formatting link

Regards Falk

Reply to
Falk Brunner

What does it mean in this case to not be able to sample the incoming data? That statement is not clear at all.

Have you tried simulating the circuit?

Have you tried looking with an oscilloscope at the signal you are feeding to the FPGA?

--Mac

Reply to
Mac

Your data is probably bouncing a little bit on the input -- UARTs usually have some sort of a majority vote system to detect a bit, like best two out of three. You're probably much better off just looking for three consecutive high bits, or two out of three, and start your clock at 8.

With your method you'll reject 0x01ff, 0x007ff, etc., which would still indicate the onset of good data.

--
Tim Wescott
Wescott Design Services
 Click to see the full signature
Reply to
Tim Wescott

Mac I am sending data through RS232 from visual basic to Com5. When i send chr(5) I see "11111001". now I am not sure if i am actually sending that data or if the data i recived in my FPGA is wrong because my sampling logic is wrong. I just dont have an application i can use where i can just send binary data from my PC to the serial port.

Reply to
fpgawizz

If it's for education or hobbyist use, you can try our UART IP which is free (under these conditions).

All users have been extremely happy with it. It works in a few minutes, with all source code (portable), testbenches, behavioral model etc... Tested up to nearly one megabaud (reported by a Swiss user who was using a USB serial adapter w/o level translation). We don't have this 16x constraint so this IP is really optimized for high speeds and just any Xtal frequency.

See

formatting link

Let me know.

Bert Cuzeau

Reply to
info_

This doesn't answer any of my questions.

Did you simulate the design or not? If the design doesn't behave as expected in a behavioral simulation, then there is little hope it will work when downloaded into the FPGA. Personally, I would never forgo simulating an FPGA design.

Did you use an oscilloscope to look at the data coming out of the RS-232 transceiver or not? You have an idea in your head of what the waveform coming out of the transceiver should look like, right? How does the waveform in your head compare to the oscilloscope trace?

You do have an RS-232 transceiver in the design, right? You wouldn't just hook up a serial line to the FPGA, would you?

--Mac

Reply to
Mac

Hi, I have a virtex4 development kit (ML403) and I plan to communicate with a PC via rs232. I see that you have done some work in the field and I just wanted to know if you have made any progress and if you could give me any hints where to start.

Thanks

///Teodor

Reply to
teodor

PC via rs232. I see that you have done some work in the field and I just wanted to know if you have made any progress and if you could give me any hints where to start.

You should have SOC apps coming with the board running already with a UART.

But if you don't want the processor and embedded stuffs, it's very easy : with our UART IP, you would have a test setup working within minutes. It's free only for educational & hobby use (and cheap otherwise). One user did run it at 921k bauds ! (bypassing the level translators)

For the keyboard, it's even easier: the IP is on our Web and free. (the bi-directional PS/2 is normally not free).

formatting link

Bert Cuzeau

Reply to
info_

Teodor,

plese check the ML403 web pages at

formatting link
especially the "ML403 Demos and Reference Designs" section. There you will find designs for the ML403 that include software to read from and write to the UART and, thus, communicate with a PC on the other end.

The CompactFlash card that ships with the ML403 has many demos and most of them use the UART at 9600 baud. The "ML403 Getting Started Tutorial" explains in detail how to set up the board and operate these demos. See

formatting link
for more information.

- Peter

teodor wrote:

PC via rs232. I see that you have done some work in the field and I just wanted to know if you have made any progress and if you could give me any hints where to start.

Reply to
Peter Ryser

To be quite honest I wouldn't waste time or money buying IP. It's very easy to write UARTs - Go to the Xilinx website, and search...

You could start this way, and use something as easy as HyperTerminal to communicate with the board.

Ben

Reply to
Benjamin Todd

I'm doing a Spartan-III project with a UART connection to the PC, and I'm using Ken Chapman's UART core. It's a freebie in with the equally free Picoblaze core, and operation out to 115200 baud has been problem free and generally spiffy.

I think there's a UART over at opencores.com too, but I know nothing about it. Cravat emptor*.

*Let the buyer wear a silly excuse for a necktie.

-- Rob

Reply to
Rob Gaddi

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.