Hi, ive been searching google for about 3 hours now but still not found the answer.

My code needs to read/write a single byte on EEPROM. When i use the read command i get a weird value returned (usually 127, i have no idea where that comes from) and when i use write the chip resets ifself.

I'm new to using EEPROM but it looked simple till i tried to use it

Heres a cut down sample of my program

taddress var byte
taddress=20
write 0,taddress