Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Then I suspect a bug in your software when it recovers RS422 data. Try to run it with the debugger. --- Quote End --- Porting the Design on Altera ESDK board remoev Re-initilization problem so now i port design on Altera ESDK board. Below is the Code Which i use for reading data from RS422 module. and you are write adding this peace of code create problem. like not responding to ping request once it receive data etc.
# define PktSize 640# define PktCount 460
void SSSSimpleSocketServerTask()
{
unsigned int LPktCount = 0;
unsigned int Count = 0;
unsigned int DataCount = 0;
//--------------------------Receive From RS-422 Port @ 1 mbps-------------------------------------------
printf("\n\t\t----Ready to Receive Synchronous Data----\n");
while(1)
{
Count = 0;
LPktCount = 0;
edge_capture = 0;
do
{
if(edge_capture)
{
edge_capture = 0; //Clear Interrupt
IOWR_ALTERA_AVALON_PIO_DATA(TEMP_OUT_BASE,1); //Send High to Test Pin TEMP_OUT
ImgBuff = IORD_ALTERA_AVALON_PIO_DATA(DATA_BASE); //Read Data from RS422 Port
Count++;
}
if(Count == PktSize) //check end of packet-data
{
Count = 0; //Point to Start of packet data
LPktCount++; //Increment packet Count
}
IOWR_ALTERA_AVALON_PIO_DATA(TEMP_OUT_BASE,0); //Send LOW to Test Pin TEMP_OUT
}while(LPktCount != (PktCount-1));
}
}