Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18F PORTB Interrupt Problem

Status
Not open for further replies.

Amardeep

Junior Member level 3
Junior Member level 3
Joined
Aug 16, 2011
Messages
28
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,449
I am using PIC18F4520 MCU
I am try to implement interrupt on PORTB RB4:RB7
interrupt is works ok but RBIF is still 1 even RBIF=0
as per information on datasheet..
"The input pins (of RB<7:4>) are compared with the old value latched on the last
read of PORTB"
i did experiment on some condition to input like:
1) made high to low state and maintain pin at low
2) made low to high state and maintain pin at high
3) made high to low state and maintain pin at high
4) made low to high state and maintain pin at low

but still RBIF is high and it become cause of recursive interrupt.

any sugesstion.??
 

Attachments

  • New Text Document.txt
    1.2 KB · Views: 95
  • New Text Document.txt
    1.9 KB · Views: 84

Thr interrupt on these pins occur on change.

have you read datasheet properly.
read datasheet and read about portb mismatch

i had used this interrupt to interface keypad and it works fine

- - - Updated - - -

Thr interrupt on these pins occur on change.

have you read datasheet properly.
read datasheet and read about portb mismatch

i had used this interrupt to interface keypad and it works fine
 
yeah i had reed datasheet properly .. but i am still confuse what is mismatch condition ..??

example: by default state on pin is high then i did high to low transition and again made pin high ...
i found recursive interrupt.
what would be the problem ?
 

When you get interrupt on high to low transition
Then read the portb status and then write 0xff to port and wait unitil it gets high.
This will protect your recursive interrupt as you are stopping interrupt on low-high transition
 
Hello Sharma Ji ...
its works ... and RBIF is Zero after interrupt thanks alot :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top