Let's Make Robots!

Problems with 18f252 port A and port B

I wrote a simple program with MPLAB for my PIC18F252.

Program:

 

CONFIG WDT = OFF ; DISABLE WATCH DOG TIMER

CONFIG OSC = HS   ; USE CRYSTAL

 

org 0 ; START CODE AT 0

START:

CLRF TRISA 

CLRF TRISB

CLRF PORTA 

CLRF PORTB

 

MAINLOOP

MOVLW B'11111111'

MOVWF PORTB ; MAKE ALL PINS 1(HIGH)

MOVLW B'11111111'

MOVWF PORTA ; MAKE ALL PINS 1(HIGH)

 

GOTO MAINLOOP

END

 

From this program, it should make all the pins in porta and portb high. So, if i connect and led to any of these pins (postive to pin, negative to ground) it should light up. However , it does not work for pin RA4 and does not work for RB5, RB6 and RB7. What could be the problem? Thanks.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
oops. wrong program. give me a few mins