We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
Dear Erik: According to my understanding, those three bits in Device address decide blocks (0 – 7) and those eight bits in word address decide the word address (0 –255) in each block. After combing device address and word address together, it can make 8 * 256 = 2048 bytes. So I really do not understand, how can those three bits in device address can in effect those three MSBs in word address. I am really confused. Would you gently let me know about this? Thank you in advance.
So I really do not understand, how can those three bits in device address can in effect those three MSBs in word address. I am really confused. Do not worry about it, it works that way due to some super special innards in the chip that are no concern of yours. I surmise it is done that way because originally the chips were 256 bytes and you used a string of them with the LSBs of the device address selecting which of the 256 byte chips were selected. Erik PS: if you look at the datasheet for the 256 byte chips (still available), you will see that the 3 LSBs of the address is pin selected.
Maybe I know where it is wrong. I will try it tomorrow since I have tortured my emulator for days. It is overheat right now. I will let you know the result.
I have solved this problem. The problem is how to send the read command.