D daredavel New Member Mar 2, 2010 #1 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!!
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!!
Gayan Soyza Active Member Mar 2, 2010 #2 I cannot remember what pins are inputs.Check the data sheet & configure the TRIS registers as outputs & set the port pins in PORTX registers.
I cannot remember what pins are inputs.Check the data sheet & configure the TRIS registers as outputs & set the port pins in PORTX registers.
D daredavel New Member Mar 2, 2010 #3 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
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
Gayan Soyza Active Member Mar 2, 2010 #4 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: Mar 2, 2010
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