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.

[SOLVED] PORTB INTERRUPT ON CHANGE PROBLEMS

Status
Not open for further replies.

bobx

Junior Member level 3
Joined
Jan 11, 2010
Messages
29
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Location
TEHRAN
Activity points
1,531
Hello.Refering to my previous e-mail,finally I convert the assembly language example firmware,
that is;(EXAMPLE 4/ page 4 of AN566 application note;[Using the PORTB Interrupt on Change as an External Interrupt] ) into C language and I attached it and AN566 pdf
with this mail.But would you please anybody answer to the following questions my helping to correct
program if required?

1.To XOR the last portB value with the new portB value and detect mismatch and which pin
caused interrupt ,I read the last portB value in the main ;before interrupt occurs,with this
instruction;

[ kpi=PORTB;//reading the initial or previous(old)state or value of PORTB.]

and read the current portB value in the interrupt after it occurs as so;

[ kpc=PORTB;//reading the current PORTB state or value]

are above instructions are valid?

2.At AN566 application note,says should force microcontroller to interrupt at rising edge,
but I do not find a special register to set the PORTB INTERRUPT ON CHANGE[RB4,RB5,RB6,RB7] for rising edge.Would you please tell how I do that?



3.I attached my short and simple program,would you please tell me if it is correct or not?
(Iused mikroC PRO V2.50 COMPILER for PIC18F452 ).

Thanks,
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top