Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

PIC18 & Interrupt Problem

Status
Not open for further replies.

Sobakava

Full Member level 6
Joined
Mar 27, 2002
Messages
350
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
3,346
pic18 interrupt routin

CCS 3.148:

I am porting a 16F877 code to 18F452 but
it seems my program has problems with
interrupts.

Only RB0 EXT0 interrupt enabled. I send
"ISR" string for debugging from serial port
at the start of #INT_EXT.

Program sends ISR string continuously
even the RB0 is connected to GND and there is
no level change.

What's wrong?
 

ME

Advanced Member level 4
Joined
Mar 14, 2002
Messages
1,309
Helped
55
Reputation
112
Reaction score
40
Trophy points
1,328
Activity points
14,861
pic18 low interrupt

Maybe this can help you.
PIC17CXXX to PIC18CXXX Migration: http://www.microchip.com/download/appnote/pic18/00726a.pdf

You can try to look here as well. Migrating Designs from PIC16C74A/74B to PIC18C442: http://www.microchip.com/download/appnote/pic18/00716a.pdf

PIC16 to PIC18 Code Conversion Techniques:
http://techtrain.microchip.com/masters2002/Classes/611/611abstract.htm
http://techtrain.microchip.com/masters2002/Classes/611/611 UPG.pdf

Copied from 00726a.pdf:
External Interrupts
For the PIC17CXXX, the INT interrupt had its own vector
address. In the PIC18CXXX, it is part of the peripheral
interrupts vector address. This means that the INT
interrupt code will need to be moved into the general
peripheral interrupt service routine (ISR), and this routine
will need to add a check for the INT interrupt
source.
The PIC18CXXX family has some enhancements for
the external interrupts. First, there are now three external
interrupt pins, as opposed to one pin in the
PIC17CXXX family. Second, enhancements to the
architecture of the interrupt logic allows additional
capability (High/Low priority). These enhancements
are discussed in the section “Architectural Enhancements”
.
 

D1_DRE

Member level 3
Joined
Apr 26, 2002
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
518
interrupts external in pic18

This might not be right but if RB0 is connected to a switch. then you will have to implement a protocol to debounce it otherwise rattling of the switch is sufficient enough to to send your program in ISR all the time.
 

Sobakava

Full Member level 6
Joined
Mar 27, 2002
Messages
350
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
3,346
pic18 int_ext

RB0 is connected to another chip in my system and the other
chip generated interrupt if data is ready. PIC16F877 is success
with same hardware...
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top