Hi,
Can someone put this CODE into their simulator please, and test for the HSEROUT.
I have programs, where it is intermittently working, does anyone know why?
Camerart
Can someone put this CODE into their simulator please, and test for the HSEROUT.
I have programs, where it is intermittently working, does anyone know why?
Camerart
Code:
'18F46K20 8MHz XTL LED TEST
Define CONFIG1L = 0x00
Define CONFIG1H = 0x08 '2 'XTL 8 'INT OSC
Define CONFIG2L = 0x0c
Define CONFIG2H = 0x20
Define CONFIG3L = 0x04
Define CONFIG3H = 0x80
Define CONFIG4L = 0x00 'Set for HVP
Define CONFIG4H = 0x00
Define CONFIG5L = 0x0f
Define CONFIG5H = 0xc0
Define CONFIG6L = 0x0f
Define CONFIG6H = 0xe0
Define CONFIG7L = 0x0f
Define CONFIG7H = 0x40
Define CLOCK_FREQUENCY = 8
OSCCON = %01110010 'internal 8Mhz clock
Define SINGLE_DECIMAL_PLACES = 2
Define SIMULATION_WAITMS_VALUE = 1 'Comment in for SIM out for PIC
Hseropen 9600 'does a basic config of TX and RX including BAUDCON, SPEN, CREN, TXEN etc.
Hserout "READY", CrLf
TRISB = %00000000
TRISC = %00000000
TRISD = %00000000
Symbol yled = PORTE.1
Symbol rled = PORTE.2
'START:
yled = 1
rled = 1
WaitMs 1000
yled = 0
rled = 0
WaitMs 1000
loop:
Hserout "TEST", CrLf
Toggle rled
Toggle yled
WaitMs 1000
Goto loop
End