I think you should go back up and take another look at Ralph's post.
I know you had an LCD problem at the time, so you may have overlooked it, but it does have 2 important points.
Most important is the declarations of (sda and scl). Originally you had ...
sda var byte
scl var byte
. . .
sda=PORTB.0
scl=PORTB.1
While it may seem that this is assigning PORTB.0 to the sda variable, it doesn't work that way. What it really does is Read PORTB.0 (which is 1 due to the Pull-up resistor) then place the value in sda. Then when you try to use sda, it get's interpreted as a Pin Number (0-15). A 1 as a Pin Number points to PORTB.1
The same goes for scl, so both sda and scl will end up pointing to PORTB.1
The second big point was mentioned by Ben. The address of a 64Kx8 EEPROM has to be a WORD sized variable, not BYTE sized.
A third point that's not as critical, is shown in ralph's example. You only need to have 1 Control Byte. PBP automatically adjusts the value of the control byte depending on whether iit's a Read or a Write operation. The manual specifically says to leave bit 0 "Clear".
Oh yeah, a small typo, it should have been Serout2, that's why you got the compiler error previously.
HTH,
Darrel
Bookmarks