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.

PORTB.4 and PORTB.5 conflict

Status
Not open for further replies.

jerryd

New Member
Electro Tech forum,

Thanks to help I've gotten on this forum I now have change-
state interrupts working on my 16f88. I started out using
PORTB.4 with a 10K pullup. Worked fine.

Since I need 2 change-state interrupts I tried using PORTB.5
along with PORTB.4 but when I put a pullup on PORTB.5,
PORTB.4 no longer causes an interrupt.

PORTB 5, 6 & 7 all work together or separately but PORTB.4
will not work if there is a pullup on PORTB.5.

I've tried 2 different 16f88's with the same results.

I couldn't find anything about this in the datasheet so
there must be something I don't know about this hardware.

I'm OK using RB5 and RB6 for now but I would like to
know what's going on for future use.

Here's my PORTB configuration code when using PORTB<7:4>

'configure port b for hardware spi and hardware interupts
TRISB = %11110001 'portb 0,4,5,6,7 are input
SSPCON = %00100000 'Synchronous Serial Port Enable bit
INTCON = %10010000 'Enable external interrupts
OPTION_REG = %10000000 'Turn off pull-up resistors, falling edge on RB0

Thanks for any reply,
jerryd
 
You are enabling the serial port and so that will take over some of the pins.

Edit, also, why aren't you using the internal pullups?

Mike.
 
Last edited:
Thanks Pommie.

Serial mode off, internal pullups on and everything works.

This is what I get for using code off the internet when
I don't understand the hardware.

jerryd
 
Status
Not open for further replies.

Latest threads

Back
Top