Hai,
My serial interrupt routine collects all the data from the serial buffer (Controller) successfully, the data sent from the controller never exceed more than 2000 bytes.
The problem is when the controller sends large no. of bytes for eg 400 bytes, the array "RecBuffer" holds all the bytes successfully but when i look at the array RecBUffer after the interrupt routine or at the end in the interrupt routine as i posted below, The data inside the array is different, what manipulation do i need to make in order to make the content remain the same until its is over wriiten.
This above case is not the same for fewer bytes sent, the content is not altered.
Code:
#define ETX 3
unsigned char RecBuffer[2048];
unsigned short count;
void interrupt (*oldport1isr)();
void interrupt PORT1INT() /* Interrupt Service Routine (ISR) for PORT1 */
{
unsigned int c;
do
{
c = inportb(PORT1 + 5);
if (c & 1)
{
RecBuffer[count] = inportb(PORT1);
printf("data %x",RecBuffer[count]);
count++;
if (RecBuffer[count-1]==ETX){
count=0;
printf("RecBUffer[0]=%x ",RecBUffer[0]);// to look at the array content at the end of data collection
}
}
} while (c & 1);
outportb(0x20,0x20);
}
i work on dos, compiler turbo c
many thanks for any help