Can't access Port A with PBP on 16F870.
Hello. I'm doing certain project, where I needed enough pins to interface with keyboard and so on. So I've decided to use PIC16F870. I have no problems working with Port B and Port C, but can't get the Port A to work either as TTL input or output. I've tried TRISA=0, TRISA=1, to set it as output or input but no luck - still does not works. I even tried to insert the assembly code for setting port A as digital input,m as in datasheet of 16f870, it made a huge mess to program, still does not worked. Any ideas? wiring is correct, I've double checked.
Re: Can't access Port A with PBP on 16F870.
Try setting the pins to digital, ADCON1 = 7.
Re: Can't access Port A with PBP on 16F870.
When the PIC starts up port A is analogue. To change this to digital you have to set the ADCON1 register.
To make all port A digital you would include the line
ADCON1 = %00000110
Section 10 of the datasheet 'Analog-to-digital converter' explains this.
Phil
Re: Can't access Port A with PBP on 16F870.