FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-01-2006, 12:52 AM
ZHI
Guest
 
Posts: n/a
Default How to control the uart

Here is my general idea.I generate a matrix in Matlab. I want to
transmit the numbers in matrix into FPGA. And these numbers will be
sent to an algorithm implemented FPGA board. The algorithm will deal
with these numbers and new result is sent back to PC(Matlab, I want to
compare the result from MATLAB).

I know transmitting these numbers to FPGA board. I need a UART. I have
one. I also have done the algorithms in FPGA. But I don't know how to
transmit the numbers from Matlab to FPGA. Exactly to say, I don't know
how to control uart. How does uart know the data come in? Shall i add
like "FF" file head to transmitting number? ...I am totally lost now. I
have no idea how to connect Matlab to FPGA. Please give me some
suggestions. Thanks.

Reply With Quote
  #2 (permalink)  
Old 07-01-2006, 02:42 AM
radarman
Guest
 
Posts: n/a
Default Re: How to control the uart

ZHI wrote:
> Here is my general idea.I generate a matrix in Matlab. I want to
> transmit the numbers in matrix into FPGA. And these numbers will be
> sent to an algorithm implemented FPGA board. The algorithm will deal
> with these numbers and new result is sent back to PC(Matlab, I want to
> compare the result from MATLAB).
>
> I know transmitting these numbers to FPGA board. I need a UART. I have
> one. I also have done the algorithms in FPGA. But I don't know how to
> transmit the numbers from Matlab to FPGA. Exactly to say, I don't know
> how to control uart. How does uart know the data come in? Shall i add
> like "FF" file head to transmitting number? ...I am totally lost now. I
> have no idea how to connect Matlab to FPGA. Please give me some
> suggestions. Thanks.


Do a google search on "Matlab serial I/O". I came up with this rather
promising link in under 30 seconds.

http://www.math.carleton.ca/~help/ma.../ch_seria.html

You will need some sort of control logic in the FPGA to handle the
UART, but if you are already implementing algo's in both MATLAB and
VHDL/Verilog, a simple state machine should be no problem.

Reply With Quote
  #3 (permalink)  
Old 07-01-2006, 05:21 PM
Duane Clark
Guest
 
Posts: n/a
Default Re: How to control the uart

ZHI wrote:
> ...
> I know transmitting these numbers to FPGA board. I need a UART. I have
> one. I also have done the algorithms in FPGA. But I don't know how to
> transmit the numbers from Matlab to FPGA. Exactly to say, I don't know
> how to control uart. How does uart know the data come in? ...


Every byte of data sent via the UART starts with a start bit and ends
with a stop bit (in the most commonly used scheme, 1 start bit, 1 stop
bit, no parity). In between transmission of data, the UART holds the
stop bit level. UART receivers therefore know that no data is being sent
until it receives a start bit, and it knows that the next 8 bits are data.

All this is handled by the hardware and is largely transparent to you.
Within the FPGA, the UART receiver will provide a bit indicating that
data has been received.
Reply With Quote
  #4 (permalink)  
Old 07-01-2006, 06:09 PM
ZHI
Guest
 
Posts: n/a
Default Re: How to control the uart

Thanks radarman and Duane Clark. I have read that link. It is quite
useful.
I want to make a simple test for transmission data between PC(matlab)
to FPGA(UART). I can generate the UART.bit file and download into FPGA
board successfully.
Can I ask a question of user constraint file ? I have successfully
downloaded a LED flash into FPGA board before. I copied this exercise
from the CD enclosed with the FPGA board. I remember before I implement
it into FPGA board. I not only generate the .bit file also copied the
LED user constraint file in the CD. Actually I am not quite sure the
content of the constraint file. I just copied it. Now I want to
implement UART into FPGA board. I think it also needs one user
constraint file for implementing. I think the user constraint file is
generated automatically when the programming file is generated. But
when I open the .ucf file, it is blank. What is the problem? Shall i
write it by myself? I don't know how to connect the pin? Can you
explain the .ucf function for me clearly? And How does it work and how
does it generate? Actually I have not a clear thread of it. Any
suggestions are appreciated. Thanks again.
\zhi
Duane Clark wrote:
> ZHI wrote:
> > ...
> > I know transmitting these numbers to FPGA board. I need a UART. I have
> > one. I also have done the algorithms in FPGA. But I don't know how to
> > transmit the numbers from Matlab to FPGA. Exactly to say, I don't know
> > how to control uart. How does uart know the data come in? ...

>
> Every byte of data sent via the UART starts with a start bit and ends
> with a stop bit (in the most commonly used scheme, 1 start bit, 1 stop
> bit, no parity). In between transmission of data, the UART holds the
> stop bit level. UART receivers therefore know that no data is being sent
> until it receives a start bit, and it knows that the next 8 bits are data.
>
> All this is handled by the hardware and is largely transparent to you.
> Within the FPGA, the UART receiver will provide a bit indicating that
> data has been received.


Reply With Quote
  #5 (permalink)  
Old 07-02-2006, 11:55 PM
ZHI
Guest
 
Posts: n/a
Default Re: How to control the uart

It is solved. Thanks all again.

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
uart / Nios2 HB FPGA 3 06-17-2005 11:00 AM
spart 3 uart example dollaz FPGA 2 03-05-2005 09:53 PM
CFP: SECOND CALL FOR PAPERS. Special Issue: Operational Control of Wafer Production. Production Planning & Control International Journal Rub?n Ruiz FPGA 0 01-24-2005 03:34 PM
EDK OPB Uart 16550 MS FPGA 3 09-15-2004 03:31 PM
CALL FOR PAPERS. Special Issue: Operational Control of Wafer Production. Production Planning & Control International Journal Rubén Ruiz FPGA 0 07-26-2004 04:05 PM


All times are GMT +1. The time now is 11:35 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved