View Single Post
  #14   Spotlight this post!  
Unread 18-12-2003, 17:58
Random Dude Random Dude is offline
Oregon State Head FTA
AKA: Chris
no team (Oregon Robotics Tournament & Outreach Program)
 
Join Date: Aug 2002
Rookie Year: 1998
Location: Oregon
Posts: 142
Random Dude will become famous soon enoughRandom Dude will become famous soon enough
Re: Autonomous Library!

Quote:
Originally Posted by Kevin Watson
I'd think they'd only be worried about the interrupt, not whether it's enabled or not. Maybe try turning-off *all* interrupts for 16ms? On new packet data from the master, set a timer and start writing EEPROM data while keeping an eye on the time. At 16ms stop writing and re-enable the interrupts.

Hey, IFI, will this work?

-Kevin

Actually, my write function above does turn off interrupts using this line:


INTCONbits.GIE = 0;

This:

EECON2 = 0x55;
EECON2 = 0xAA;
EECON1bits.WR = 1;

is the only critical section of the write function. Since interrupts are disabled during that time there should be no problems. I haven't tested this while using iterrupts but this is stolen directly from page 81 of the PIC18FXX20 Data Sheet.