I talk about the WRITE
Code:WRITE WRITE Address,Value Write Value to the on-chip EEPROM at the specified Address. This instruction may only be used with a PICmicro that has an on-chip EEPROM data area such as the PIC16F84, PIC16C84 and the PIC16F87x series. WRITE is used to set the values of the on-chip EEPROM at runtime. To set the values of the on-chip EEPROM at programming-time, use the DATA or EEPROM statement. Each WRITE is self-timed and takes about 10 milliseconds to execute on a PICmicro. If interrupts are used in a program, they must be turned off (masked, not DISABLEd) before executing a WRITE, and turned back on (if desired) after the write instruction is complete. An interrupt occurring during a WRITE may cause it to fail. WRITE will not work on devices with on-chip I2C interfaced serial EEPROM like the 12CE67x and 16CE62x parts. Use the I2CWRITE instruction instead. WRITE 5,B0 ' Send value in B0 to EEPROM location 5 To write a word, each of the 2 bytes that make up the word must be written separately: w Var Word WRITE 0,w.BYTE0 WRITE 1,w.BYTE1




Bookmarks