i²c EEPROM to NOKIA 3310 LCD (LPH7779):
Read character en symbol data from EEPROM & send them to the NOKIA LCD. |
|
This routine gets the data for one character from the EEPROM which is set by "charsel." It will then send 6 bytes "bytefornokia" to the nokia_write_data() routine. The NOKIA LCD has 84x48 pixels. We devide this in 6 rows of 14 characters. Each character is 6 pixels wide and 8 pixels high. When reading from the i²c EEPROM(=Slave) and seen by the PIC's point of view (=Master), we have to: 1) Send a START, write the device address (0xa0) (last bit is 0 for write), wait for ACK. 2) Write the high byte address (sets the first register to read from, which is set by "charsel" here), wait for ACK. 3) Write the low byte address (sets the first register to read from, which is set by "charsel" here), wait for ACK. 4) Send a REPEATED START, write the device address again (0xa1) (last bit is 1 for read), wait for ACK. 5) Read five bytes, wait for ACK. 6) Read the last byte, no wait for ACK, send STOP.
Also see the EEPROM 24C256 datasheet, and figure 8-2, Random Read. Graphic LCD module type LPH7779 (NOKIA 3310 LCD) And the PCD8544 datasheet.
|
Hi-Tech PICC: void ext_eeprom_to_nokialcd(void)
SEN = 1;
//
1) send
start bit START to EEPROM |