Testing all ports in PIC16F877A

Status
Not open for further replies.

daredavel

New Member
Can someone help me how to set all ports in pic16f877a as output 1..to test if all ports are ok.. i'll b connecting the other end with LEDS.. thank you!!
 
I cannot remember what pins are inputs.Check the data sheet & configure the TRIS registers as outputs & set the port pins in PORTX registers.
 
is this correct sir? setting portc as output..to enable all LEDs connected..

Code:
	LIST	P=16F877A
		#include <p16f877A.inc>
		
		__CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
		
bcf STATUS,RP0
CLRF PORTC 

bsf	STATUS, RP0
	movlw	0x00
	movwf	TRISC

bsf	STATUS, RP0
movlw 0xff
movwf PORTC

end
 
Code:
		LIST	P=16F877A
		#include p16f877A.inc>
		
		__CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
		
		org	0x0000
		;
		bcf 	STATUS, RP0
		CLRF 	PORTC 

		bsf	STATUS, RP0
		movlw	0x00
		movwf	TRISC
		[COLOR="Red"]bcf[/COLOR]	STATUS, RP0
		;
		movlw 	0xff
		movwf 	PORTC

		end
 
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…