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.

How to use all pins on PIC16F88?

Status
Not open for further replies.

adamthole

New Member
Hello,

I am using a PIC 16F88 in one of my projects, and I need to use every pin as either an input or an output. However, I can only get certain pins to work. I have actually had this problem in all of my projects, but normally I just switch it to a different pin and forget about it. I am setting trisa and trisb appropriately. Are their any other registers I need to set? Any other ideas?

I see from the data sheet that porta.5 can only be an input, but Im not using porta.5, and I'm actually having problems with using pins as inputs (A0, A1, A2, B3, B7, specifically)

Thanks
 
I wonder if you're forgetting to switch off analog modes? As for RB3, if you're not turning off the LVP (low voltage programming) configuration fuse, you won't be able to use RB3 for anything...

Good luck with your project... Regards, Mike

Code:
        __CONFIG  _CONFIG1, _CCP1_RB0&_LVP_OFF&_MCLR_OFF&_PWRTE_ON&_WDT_OFF&_INTRC_IO
        __CONFIG  _CONFIG2, _IESO_OFF & _FCMEN_OFF
Code:
;
;  program initialization
;
Init    bsf     STATUS,RP0      ; bank 1                          |B1
        clrf    ANSEL           ; setup PORT A for digital I/O    |B1
        bcf     STATUS,RPO      ; bank 0                          |B0
;
[/code]
 
adamthole said:
However, I can only get certain pins to work.

Have you read the STICKY of this forum before asking the question?

If not yet, please see item 6 of the sticky.
 
Yeah, I've read the sticky and I believe I have all of that stuff set accordingly. I'll keep trying.

Thanks!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top