how to write data and let the BS2p40 to read
i am doing a project using bs2p40 and we wanted to save name and phone number into the bs2p40 by entering those name and phone no. using several button with an aid of serial 4X20 LCD and we can also read it next time we needed. do anyone have any idea on that how to write the program?
·
·

Comments
FullName DATA (40) '40 characters of "blank" or "undefined" data -- 'this way your program won't overwrite your data when you download your program Phone DATA (10) '10 character phone number EEaddr VAR Word 'EEPROM pointer somedat VAR Byte 'some data idx VAR Byte 'index counter '...........some code here to run your LCD and buttons '....and write into to EEPROM '...........here's reading the Name -- do the opposite with WRITE to store info entered via LCD EEaddr = FullName FOR idx = 0 TO 39 EEaddr = EEaddr + idx READ EEaddr, somedat DEBUG somedat NEXTWhen you are writing your data, just remember to write one byte at a time, as each character will be a byte. Is this helpful?
Regarding the 100k writes -- search the forums for Andy Lindsey's recent posts regarding "rollover" of often used EE addresses -- basically you move the data around occasionally so that you are not constantly writing to the same locations. But if you are entering phone number/name only once a week or once a month, it will be a while till you hit the limits.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST