16F877 newbie help on pin out

Status
Not open for further replies.

Lynny

New Member
Hi
First thanks to Chippie for the previous help

I would appreciate help on the following, when working with the 16F84A I used all the revevant pins RA and RB as input/output with no probs.

Wih the 16F877 can I do the same RA... RB...RC... RD... RE... OR is their problems in using some of the pins . I thought I read an article that advised caution with the RA !!! as this was A/D


Confused :roll:

Lynny
 
Consider, what you want the portA pins to do, when writing your code....

On a Power On reset, PortA pins are configured as, analog in, as a default and status inputs read as 0.......

here's a sample of code for initializing, taken from Microchips site......

BCF STATUS, RP0 ;
BCF STATUS, RP1 ; Bank 0
CLRF PORTA ; Initialize PortA by clearing
; output data latches
BSF STATUS, RP0 ; Select Bank 1
MOVLW 0x06 ; Configure all pins
MOVWF ADCON1 ; as digital inputs
MOVLW 0xCF ; Value used to
; initialize data direction
MOVWF TRISA : Set RA<3:0> as inputs
; RA<5:4> as outputs
; TRISA<7:6> are always
; read as 0
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…