Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/13/05 18:07
Read: times


 
#93395 - I'm wondering...
Responding to: ???'s previous message
msg interrupt 4 (void)
{
unsigned char j,xchar;
unsigned int xaddress;
xchar=rec_232(); // waiting for a correct command
xaddress=0x0000;
if (xchar==0x40) // fills blank for 64 byte in the eeprom
{
for (j=0x00; j<0x40; j++)
{
write_eeprom(xaddress,0x00);
xaddress++;
}
}
send_rs232(0x39); //sending a request
do { //writing data into eeprom
xchar=rec232(); //waiting for data
write_eeprom(xaddress,xchar);
xaddress++;
} while (xchar != 0x38); // until a sentinel come
}


I'm just wondering if you realise what you're doing in this interrupt!

I can see you have worst case at least (0x40 + 0x38) makes 0x78 = 120 I2c commands in your interrupt.

Knowing that sending one byte is approx. 1-2ms (maybe a bit more, maybe a bit less), this means you're about100-200ms in your interrupt routine.

On top of that, you're doing UART processing too.

Knowing that an interrupt service should take as less as possible time (some 100's of usecs, maybe some ms), I would first work on this...

Best rgds,

--Geert

List of 6 messages in thread
TopicAuthorDate
INT 4 C51 DOES'NT WANT TO EXIT            01/01/70 00:00      
   yes well            01/01/70 00:00      
   Why would it            01/01/70 00:00      
   I'm wondering...            01/01/70 00:00      
      Problem solved            01/01/70 00:00      
         You're welcome...            01/01/70 00:00      

Back to Subject List