PAUSE is limited to 65535 milliseconds (65.534) seconds
Do you have an LCD or RS232 connection? If you have either one of these I would suggest sending out the value you are retrieving from the EEprom using the DIG command to display it as it's individual digits.
Example:
This will give you a way to confirm the value you are getting out of the EEPROM, and help you troubleshoot the problem by elimination.Code:Read eeadr,data For x = 2 To 0 Step -1 Hserout[data DIG x] Next x
PAUSE works with up to a 16-bit period. If you use an expression that attempts to load anything greater than 65535 into the registers used for the delay period, they will overflow.
65535 + 54465 = 120,000. You're probably getting a delay of 1mS * 54465 due to the overflow. That would explain the ~54 S delay period.
Put together a loop like the one you're using for the LED. You could get several hours (or more) if needed.
My previous example for viewing your eeprom data for verification was a bit abbreviated, and wouldn't work as stated. So here it is in a more usable form.
With this code added to your program, you can send out, and verify the value of any byte stored in your internal eeprom as a decimalized 3 digit number (readable on any RS232 terminal program).Code:DEFINE HSER_TXSTA 20h ' enable RS232 transmission DEFINE HSER_BAUD 19200 ' set to required baud rate on your system eeadr con 100 ' set to eeprom address for data of interest eedata var byte ' eeprom data storage getdata Read eeadr,eedata ' retrieve data byte from eeprom For x = 2 To 0 Step -1 ' extract 3 digits for display eedata = (eedata DIG x) + $30 ' convert to "decimalized" ascii number Hserout[eedata] ' send ascii out RS232 Next x ' do it for all 3 digits of byte
Bookmarks