Hi everybody! I work with Keil C251 uVision2. in my programm i want to recieve string into controller. i have an array of characters incom[20], which i use as a buffer for recieving string. i recieve current byte into variable bufIn and then replace it into my array:
1. strcat(incom, bufIn);
2. incom[i] = bufIn; i++;
for(i = 0; i < 20; i++) Print(incom[i]);
Your code not full... I still don't understand it. No hardware initialization sequence. (serial port, interrupts, timers) No sense to comment all of your code, just at first look: - you must clear RI manually
if (RI) { RI = 0; // !!!
void port_io(void) interrupt 4 using 2 { if( TI ) { TI = 0; // etc } if (RI) { RI = 0; // etc } }
void port_io(void) interrupt 4 using 2