- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-16-2009 03:10 AM
Hello everybody, i have a problem: i dont know how to read data from the serial port.
i explain my goal: i have a mobile platform with 2 motored wheels, a nexys2 fpga board and a pc on my mobile platform. i have to create a connection between the pc and the fpga with the serial port. At the moment i can write on the serial (i use xil_printf) and i see all with hyperterminal on my pc but it isnt very important for my project. the problem is that i cant do the opposite, i dont know how to read data in the same way. The goall will be to elaborate data with the pc and send the velocity to the fpga via serial.
thanks for help and sorry for the bad english!
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-16-2009 03:59 PM
I have the same problem . I would like use rs232 with interrupt and i find this http://warp.rice.edu/trac/browser/trunk/EDK_Demos/
XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR, XPAR_OPB_INTC_0_RS232_INTERRUPT_INTR, (XInterruptHandler)uart_int_handler, (void *) 0);.
What is XPAR_OPB_INTC_0_RS232_INTERRUPT_INTR?
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-17-2009 10:06 AM
rents85 wrote:I have the same problem . I would like use rs232 with interrupt and i find this http://warp.rice.edu/trac/browser/trunk/EDK_Demos/
UberDemo/demoapp2.c?rev=15 . I don't understand this function : XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR, XPAR_OPB_INTC_0_RS232_INTERRUPT_INTR, (XInterruptHandler)uart_int_handler, (void *) 0);.
What is XPAR_OPB_INTC_0_RS232_INTERRUPT_INTR?
Look in xparameters.h.
-a
----------------------------------------------------------------
Yes, I do this for a living.
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-28-2009 09:49 AM
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-28-2009 09:54 AM
Hi all,
I'm a newbie and have a similar question. I am using a Spartan3A-1800A-DSP Board, and I want to communicate my board and PC. I'm trying to send data to RS232 by using a C program such as " printf"hello world" " , and hopefully can get it shown back on PC hyper-terminal.
Could anyone let me know how I can achieve this? Or some tutorials recommended will also be a help.Thank you in advance.
Kind regards,
tarzandavid
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-02-2009 01:44 AM
Hello tarzan,
I work with the same board, EDK, MicroBlaze and RS232.
Sending Data: There are two opportunities. You can configure the RS232 as Standard I/O. From this it follows that the methods "xil_printf" or "print" prints a string via Standard I/O (in this case RS232) to the console which is connected to the serial port of the PC (in your (windows) case: hyperterminal; for linux: minicom). Write "xil_printf("Hello World\n\r"); in your C-File and you get what you want to.
The second opportunity is to send a databuffer via RS232. Then there is no need to set it as Standard I/O. An example for sending a buffer, is delievered with EDK in its installation path (installationpath/EDK/sw/XilinxProcessorIPLib/driv
Receivind Data: see examples and xuartlite.h.
Hope this helps.
Best regards, Robbi
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-02-2009 03:51 PM
hi robbi,
Thanks a lot for your suggestion, I'll try to do as what you told me. Really appreciated. :-)
tarzan
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-03-2009 09:21 AM
Hi together,
if you want to read data from a serial port that is connected to stdin,
you may follow this link :
http://forums.xilinx.com/xlnx/board/message?board.
--Ralf
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-04-2009 03:40 AM
Hi ralfcantnerbosch,
In the link you posted you mentioned "Hyperterminal sends each character as soon as you type it. It does not wait for the <RETURN> key. ", have you connected the board to PC under this circumstances?
tarzan
Re: how to read data from the serial port?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-04-2009 03:59 AM
Hello tarzan,
are you working with EDK? If true, you can set the RS232 device as STD I/O in *.mss-file for your OS like:
BEGIN OS
PARAMETER OS_NAME = standalone
PARAMETER OS_VER = 2.00.a
PARAMETER PROC_INSTANCE = microblaze_0
PARAMETER STDIN = RS232_Uart_1
PARAMETER STDOUT = RS232_Uart_1
END
-> "Hyperterminal sends each character as soon as you type it. It does not wait for the <RETURN> key. "
I think this simply means how Hyperterminal works. If the serial connection is build up and you press a key on your keyboard (of the pc), the ASCII code of the key you pressed is sended via serial-interface. There is no need of pressing <RETURN> to confirm the sending.
I also have connected the Spartan-3A DSP Board to PC to communicate.
More questions?
Greetz Robbi











