Hello Ladies and Gentlemen,

I am working on a project that is starting to get me somewhat frustrated...

The thing is.. I have a 18F6720 with a 4x20 LCD, USART comms, and a 24LC256 EEPROM connected.

For the LCD I use the PBP LCDOUT routines as well as for the EEPROM.
For the USART reception and the LCD backlight I use an asm interrupt routine.

In the E2PROM I have stored predefined text strings for the LCD.
When the user has not been presseing buttons for at while, the system returns to an "idle" state where the backlight is turned down to about 1/3.

the code part that causes me headache is this:
for n=0 to 19

temp1=n+(rec*20)+temp
I2CREAD SDA,SCL,160,temp1,[text[n]]
text[n]=text[n]-48

next n

temp1 is temporary adress for EEPROM,
rec is the record in the EERPOM I wish to acces
text[20] is my working array for the current record (AD values etc. may be added before written to the LCD)

It seems that when a USART interrupt occurs during the I2CREAD statement it might be reversed to a write - causing random characters to be written to the EEPROM. Usually it is characters 161 and 255 just by each other.
The characters makes no sense together with the communication.

The fast one might suggest simply disabling interrupts during the I2Cread - but this leads to poor communications and flickering backligt..

I hope my description makes sense - Is there anyone outthere who can give me a clue of where to look.

Very best regards
HenrikBuhl