Ok,
Ive got this far:
Now, it receives what i enter, and saves it, and displays it fine, however once power is cycled, and it reads from the eeprom, the 1st character is incorrect:Code:INCLUDE "modedefs.bas" ' Modes for SerOut CMCON = 7 ' set portA to digital TRISA = %00100000 ' Port A all output but MCLR TRISB = %00001010 ' Port B all output but 1,3 (Si and CCP) DEFINE DEBUGIN_REG PORTB ' Set Debug pin port DEFINE DEBUGIN_BIT 1 ' Set Debug pin bit DEFINE DEBUGIN_BAUD 9600 ' Set Debug baud rate DEFINE DEBUGIN_MODE 1 ' Set Debug mode: 0 = true, 1 = inverted DEFINE DEBUG_REG PORTB ' Set Debug pin port DEFINE DEBUG_BIT 2 ' Set Debug pin bit DEFINE DEBUG_BAUD 9600 ' Set Debug baud rate DEFINE DEBUG_MODE 1 ' Set Debug mode: 0 = true, 1 = inverted port1name var byte[8] name1 var word i var byte Main: ' Display "Waiting for input" every 5 seconds if timeout period expires DEBUGIN 5000, idle, [STR port1name\8\13] DEBUG "Received: ",STR port1name\8,13,10 for i = 1 to 8 write i,port1name(i) pause 10 next i pause 100 for i = 1 to 8 read i, port1name(i) next i DEBUG "Read eeprom after write: ",STR port1name\8,13,10 Goto Main idle: DEBUG "Waiting for input",13,10 for i = 1 to 8 read i, port1name(i) next i DEBUG "Read from eeprom: ",STR port1name\8,13,10 goto main
Received: 12345678
Read eeprom after write: 12345678
Waiting for input
then power cycle
then i get this:
Waiting for input
Read from eeprom: û2345678
any hints on what i may be doing wrong?
Also all comms is serial @ 9600, there is no LCD, therefore the LCDout command cant be used....




Bookmarks