I just got a 18F4431 from a friend.
I tried to make led blink, with following code , but the only LED that turn on/off is the LED on RB0, why ?
OSCCON = $60 ' Internal oscillator frequency 4 Mhz
TRISA = %11111111 ' Set PORTA to all input
TRISB = %00000000 ' Set PORTB to all output
TRISC = %00000000 ' Set PORTC to all input
TRISD = %00000000 ' Set PORTD to all output
TRISE = %00000000 ' Set PORTE to all output
ANSEL0= %00000000 ' Analog channel AN0-AN7 off
ANSEL1= %00000000 ' Analog channel AN8 off
PORTA = 0
PORTB = 0
PORTC = 0
PORTD = 0
PORTE = 0
CLear
main:
high PORTB
pause 1000
LOW PORTB
pause 1000
HIGH PORTC
pause 1000
LOW PORTC
pause 1000
high PORTD
pause 1000
low PORTD
pause 1000
high PORTE
pause 1000
LOW PORTE
pause 1000
end
Bookmarks