CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PIC 18F8720 Interrupt problems

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Graham Bremner
Guest







PIC 18F8720 Interrupt problems
PostPosted: Wed Dec 11, 2002 6:37 am     Reply with quote

Hi,
Currently when I am running a program and an interrupt is called then the whole PIC resets itself. I have ruled out the watchdog timer as I have disabled it and there is no change.
I have an Infa red reciever on INT_EXT1, I have enabled it and enabled global interrupts.
I have a program for the 16F877 using exactly the same interrupt code (apart form setting up the edge trigger) and it works fine.
The same problem occured when using INT_EXT2.
Does anyone have any ideas on this??

Thanks

Graham bremenr
___________________________
This message was ported from CCS's old forum
Original Post ID: 9969
R.J.Hamlett
Guest







Re: PIC 18F8720 Interrupt problems
PostPosted: Wed Dec 11, 2002 7:56 am     Reply with quote

:=Hi,
:= Currently when I am running a program and an interrupt is called then the whole PIC resets itself. I have ruled out the watchdog timer as I have disabled it and there is no change.
:=I have an Infa red reciever on INT_EXT1, I have enabled it and enabled global interrupts.
:=I have a program for the 16F877 using exactly the same interrupt code (apart form setting up the edge trigger) and it works fine.
:=The same problem occured when using INT_EXT2.
:=Does anyone have any ideas on this??
:=
First, what compiler version. The early version 3 compilers, generate some awful code for the 18 family chips...

Second, what functions do you use in the INT?. There is a significant difference in the way some code is generated between the two chips. On the 18F family, if you generate a 'switch' statement, without a 'default', it will generate a table based lookup, rather than using logic tests. Since table based lookups are also used for 'const' accesses, this results in the interrupts being disabled for massive sections of the main code (there are quite a few old threads about the latency this causes on this group). So you have to be aware of this, and if necessary alter the way code is written.

It is important to be aware that the #PRIORITY statement has a massively different behaviour between the two chip families. On the 16F chips, all this does, is change the order that the interrupts are tested for in the handler code. On the 18F family chips, there is hardware priority support, and this statement allows individual interrupts to be allocated to the high priority handler. A 'high priority' interrupt, can now interrupt a low priority handler, and there is no register save automatically performed in this case.

Obviously you must change any hardware register addresses used between the two chips.

If you use any assembler, have you looked at AN716, with regards to the address differences on RETLW calculations etc.

Again compiler verson is important, it is only recently, that some sections of the code have started working useably with these chips...

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 9970
Graham Bremner
Guest







PIC 18F8720 Interrupt problems
PostPosted: Fri Dec 13, 2002 3:24 am     Reply with quote

HI,

Thanks, I got an updated version of PCWH and the code worked Ist time.

Cheers

Graham Bremner
___________________________
This message was ported from CCS's old forum
Original Post ID: 10019
R.J.Hamlett
Guest







Re: PIC 18F8720 Interrupt problems
PostPosted: Fri Dec 13, 2002 3:32 am     Reply with quote

:=HI,
:=
:=Thanks, I got an updated version of PCWH and the code worked Ist time.
:=
:=Cheers
Good.
As you saw, that was #1 on the list of possibilities. The number of threads on interrupt problems with the 18F family (which were very frequent a few months ago), has declined now as the code has improved. :-)

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 10020
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group