Data Serially-In Ethernet-Out on an NE64 board

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Data Serially-In Ethernet-Out on an NE64 board

跳至解决方案
1,806 次查看
Ryu
Contributor I
Hi.

I am using a Freescale EVB9S12NE64 board to take readings serially over RS232 from a device, and transmit (UDP) this data to a PC over NE64's Ethernet to a computer. It sounds simple, but I'm a bit stuck as I'm not familiar with embedded devices. Is there a simple quick method to achive this?
I tried modifying the Connector_application which came with the board, but I came to a dead end, as I couldn't find any easy way/driver to implement the data reception from the serial port (SCI). I'm using Codewarrior IDE 5.7, the special edition one. So i'm a bit restricted on code-size and files number.

Thank you
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
782 次查看
mjbcswitzerland
Specialist V
Hi Ryu

Take a look at the uTasker project - www.uTasker.com

It includes all that you need including the UART driver (with several modes - character, message with flow-control). It is free for non-commercial applications and includes full support.

To get an idea of code size see the following tutorial:
http://www.utasker.com/docs/NE64/uTaskerV1.2-Tutorial.PDF

Using just UDP it will occupy about 8..10k of space but it may be worth looking at TCP because it will allow end to end flow control (see the Telnet demo) and so avoid UART overruns.

Examples of UART->UDP and UDP->UART code

// read UART input and sent to UDP portLength = fnRead( SerialPortID, ptrUDP_Frame->ucUDP_Message, MEDIUM_MESSAGE);fnSendUDP(MyUDP_Socket, ucIP, usPortNr, ptrUDP_Frame, Length, OWN_TASK);

UDP->UART (using call back on UDP frame reception
extern int fnUDPListner(USOCKET SocketNr, unsigned char ucEvent, unsigned char *ucIP, unsigned short usPortNr, unsigned char *data, unsigned short usLength){    switch (ucEvent) {    case UDP_EVENT_RXDATA:        fnWrite(SerialPortID, data, usLength);        break;    }}

The project comes with a GNU build and a serial loader/debugger as well as a CW project.
Simply remove unwanted files (like smtp, pop3, etc. to keep below the max allowed file count of eval version). It also contains an NE64 simulator so you can completly develop and test your project before moving to the target. The UART will be simulated over a COM port and the Ethernet interface by the PC's NIC.

Good luck

Regards

Mark Butcher

P.S. There is a live NE64 demo on the web site above. You can  also telnet to it at "telnet 84.253.57.46"



在原帖中查看解决方案

0 项奖励
回复
1 回复
783 次查看
mjbcswitzerland
Specialist V
Hi Ryu

Take a look at the uTasker project - www.uTasker.com

It includes all that you need including the UART driver (with several modes - character, message with flow-control). It is free for non-commercial applications and includes full support.

To get an idea of code size see the following tutorial:
http://www.utasker.com/docs/NE64/uTaskerV1.2-Tutorial.PDF

Using just UDP it will occupy about 8..10k of space but it may be worth looking at TCP because it will allow end to end flow control (see the Telnet demo) and so avoid UART overruns.

Examples of UART->UDP and UDP->UART code

// read UART input and sent to UDP portLength = fnRead( SerialPortID, ptrUDP_Frame->ucUDP_Message, MEDIUM_MESSAGE);fnSendUDP(MyUDP_Socket, ucIP, usPortNr, ptrUDP_Frame, Length, OWN_TASK);

UDP->UART (using call back on UDP frame reception
extern int fnUDPListner(USOCKET SocketNr, unsigned char ucEvent, unsigned char *ucIP, unsigned short usPortNr, unsigned char *data, unsigned short usLength){    switch (ucEvent) {    case UDP_EVENT_RXDATA:        fnWrite(SerialPortID, data, usLength);        break;    }}

The project comes with a GNU build and a serial loader/debugger as well as a CW project.
Simply remove unwanted files (like smtp, pop3, etc. to keep below the max allowed file count of eval version). It also contains an NE64 simulator so you can completly develop and test your project before moving to the target. The UART will be simulated over a COM port and the Ethernet interface by the PC's NIC.

Good luck

Regards

Mark Butcher

P.S. There is a live NE64 demo on the web site above. You can  also telnet to it at "telnet 84.253.57.46"



0 项奖励
回复