Port RA4 PIC16F84A

General discussion on mikroElektronika website & forums.
Post Reply
Author
Message
jrobes
Posts: 1
Joined: 14 Feb 2005 19:41

Port RA4 PIC16F84A

#1 Post by jrobes » 14 Feb 2005 19:54

I´m a begginer with microcontrollers.
I purchased EasyPic2 and PIC16F84A
One of the first programs were the following

processor 16F84
RADIX hex


__config _WDT_OFF & _XT_OSC

ORG 0
goto start

Start
bsf STATUS, 5
movlw 0x00
movwf TRISA
bcf STATUS, 5
movlw b'00011000'


Loop
goto Loop

end

This is the best simple program, illuminating LEDS 3 and 4 of the EasyPic2.
When tested with the EasyPic2, with SW3(PORTA --> ON
The program should set to on LEDS RA3 and RA4, but althought RA3 is OK, RA4 is not working.

I checked with a voltmeter RA4 and there no voltage on it.
Does anyone know the reason for that, appart that the Chip could be damaged?

Thanks very much

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: Port RA4 PIC16F84A

#2 Post by zristic » 14 Feb 2005 21:03

You are missing one line:

processor 16F84
RADIX hex


__config _WDT_OFF & _XT_OSC

ORG 0
goto start

Start
bsf STATUS, 5
movlw 0x00
movwf TRISA
bcf STATUS, 5
movlw b'00011000'
movwf PORTA

Loop
goto Loop

end

If you are a beginner, try with mikroBasic, it will make more sense on how PIC actually works.

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#3 Post by anton » 14 Feb 2005 22:09

Hello jrobes.

If that doesn't solve your problem, you must remember that the RA4 is open drain type. This means that it can't pull this pin up to +5V.

So you must connect the LED's catode to the pic and the anode through the resistor to 5V.

Now if you say BCF PORTA,4 the LED will turn on and BSF PORTA,4 will turn the LED off.

Anton :roll:

Post Reply

Return to “Website & Forums General Discussion”