Thanks for reply mister e and cocacolakid. Below is a snippet of code from my program. I am reading dip switches that I have connected to portc and portd and storing the values in the onboard eeprom when a switch I have connected to portb.2 is on. This code is at the beginning of program after variable declarations and only executes once on startup before program goes into loop. It works OK until I turn the switch off on portb.2 and cycle the power. The value read from the EEPROM is then 65535. Any help that you can give me will be greatly appreciated.
if PORTB.2 = 1 Then 'Check Calibration Switch. If on read Dip Switches
Write 0, PORTC 'Read Dip Switches on Port C and Store Value in
'EEPROM Address 0
pause 10
Write 1, PORTD 'Read Dip Switches on Port D and Store Value in
'EEPROM Address 1
pause 10
EndIf
Read 0, TMTR1KFLO.byte0 'Read Value in EEPROM Addres 0 and store
'in low byte of TMTR1KFLO (Declared as Word)
pause 10
read 1, TMTR1KFLO.byte1 'Read Value in EEPROM Addres 1 and store
'in Hi byte of TMTR1KFLO (Declared as Word)
pause 10
loop: 'Program Loop
Bookmarks