I'm trying to write a very simple program but can't get off the ground. I don't read data sheets very well though I have spent hours trying. Much of it simply goes over my head. I feel sure that I'm not setting the chip up properly for digital I/O. Once I get the settings right I think I'm off and running. I've been very successful before with this but it has been a while and this is a new chip for me.

The code below is intended to turn on LEDs and leave them on. What happens is that the first LED turns on, then goes OFF as the second LED turns on. Then the second LED turns off as the third turns on. It then stays on as the next two turn on and stay on (as I expect it to). So the end result is the first two LEDS are off and the last three are on.

I suspect that PortA is not configured correctly. Can someone please help me.

Thank you!!!

Ross



@_config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF
ANSEL = 0
CMCON = 7
ADCON1 = 7
TRISA = %111000
TRISC = %111000
porta = 0
portc = 0

Push var porta.4
'************************************************* ******************************
Start: while Push = 1 ' Wait for button push
wend



Run: High porta.0 ' Turn on LED on each port every two seconds
Pause 2000
High porta.1
Pause 2000
high porta.2
pause 2000
high portc.0
pause 2000
high portc.1

End