Help

Status
Not open for further replies.

Mihindu_gajaba

New Member
Hi ,

the thing is i'm new to this i mean to the forum and also for Microcontrollers.

so from the help of this site i have learned alot.

i have written a code that make all the Ports are acting like output and making All the pins High . after that i have power up the PIC and Connect a led to RA1 but it doesnt turned on. same as the other pins i mean RA0 RA1 , can you please help me why this is happening..

Code is :

#include <p16F84A.inc>
__CONFIG _CP_OFF & _WDT_OFF

bsf STATUS,5
movlw 00h
movwf TRISA
bcf STATUS,5

movlw b'11111'
movwf PORTA

end

 
Code:
	org	0000h

	bsf 	STATUS,RP0
	movlw 	00h
	movwf 	TRISA
	bcf 	STATUS,RP0
	clrf	PORTA

Main	movlw	b'00000010'	;turn on RA1
	movwf	PORTA
	goto	Main
 
Gayan Soyza said:
Code:
	org	0000h

	bsf 	STATUS,RP0
	movlw 	00h
	movwf 	TRISA
	bcf 	STATUS,RP0
	clrf	PORTA

Main	movlw	b'00000010'	;turn on RA1
	movwf	PORTA
	goto	Main

Thanks For the Help , And What about The Configuration Word
 
It looks ok.You can add PWRT=on & OSC as well

__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _RC_OSC
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…