Need you generous helps. Why my program only can read out the first block 's data of 24LC16? The other data have been read out are all 0xff. The following code is my program about how to set device address and word address. For page write: I plan to write data at the address 0 of every block. void WR_MEMO_PAGE(unsigned char PAGE_NUM, unsigned char *MEMO_DATA, unsigned char PAGE_ADD) unsigned char TEMP_DATA; TEMP_DATA = PAGE_START_ADD; DEVICE_WRITE = ( TEMP_DATA << 1 ) | 0xa0; START_MEMO(); SHIFT_MEMO(DEVICE_WRITE); if ( RECACK_MEMO() == 1 ) { TEMP_DATA = ( TEMP_DATA >> 8 ); SHIFT_MEMO(TEMP_DATA); For single data write: void WR_MEMO( unsigned char SHIFT_DATA, unsigned int START_ADD) unsigned char TRAN_DAT; DEVICE_WRITE = ((BEG_DAT >> 8)<<1) | 0xa0; START_MEMO(); SHIFT_MEMO(DEVICE_WRITE); if ( RECACK_MEMO() == 1 ) { TRAN_DAT = START_ADD ; SHIFT_MEMO(TRAN_DAT); Would you gently to give me some clues? Thanks.
any one can help about that?
any one can help about that? Maybe, but who has the time to find a datasheet based on an incomplete partnumber with no manufacturer specified. Had it been 'my' EE (which it might be identical to) I would have had the answer. Erik
It is MicroChip's 24LC16B.
Why my program only can read out the first block 's data of 24LC16? The other data have been read out are all 0xff. as described on the datasheet page 6, the MSB of the memory address is part of the device address. Reading 0xff indicates that you did not write (erased flash - 0xff) Erik
Why my program only can read out the first block 's data of 24LC16? The other data have been read out are all 0xff. As Eric says ... it may be erased. This response is also given if the device returned a NAK when initially addressed and the program continued to try to read anyway.
View all questions in Keil forum