I have connected some software and Keil µVision Simulator of generic 8051 via 2 Serial COM-ports(RS232). Simulator executes the standard example called INTSIO2 (I have downloaded it from here). The only thing I changed is that it receives a formatted string and extracts a value of a float data type. Here is the edited main function:
void main (void) { com_initialize (); com_baudrate (38400); EA = 1; /* Enable Interrupts */ while (1){ char buf [10]; int argsread; float f; if (argsread = scanf ("start;%s ;end", buf)){ f = atof(buf); printf("start;%8g;end", (float)f); } } }
The main problem: simulator receives these strings very slow, much slower, than the program can transmit. Even when I just closed the program so it doesn't transmit anymore, the simulator keeps receiving values the program sent before for a several seconds.
Can you help me, how the speed performance of a program can be improved?