Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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!!
 
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top