Does this work on your 12F509?
Code:DEFINE DEBUG_BAUD 9600 DEFINE DEBUGIN_REG GPIO DEFINE DEBUGIN_BIT 1 DEFINE DEBUGIN_MODE 0 '1=inverted X var byte ' dummy variable ' Pin Assignments SCADAin var gpio.1 ' data in via MAX232 Ready var gpio.4 ' signal main processor to send data low ready ' set low ' config TRISIO = %000010 ' set I/O directions (0 = output, 1 = input) OPTION_REG = %11011111 ' 12F508/9 bit 6 disables weak pull-ups Main: debugin 200,NoOp,[wait($0F)] ' wait for address and command pause 10 ' wait for serial burst to end high Ready ' signal main processor to send current data pause 2 ' with a 2mS pulse low ready goto main NoOp: GOTO Main END




Bookmarks