View previous topic :: View next topic |
Author |
Message |
richi-d
Joined: 28 Aug 2007 Posts: 106
|
PIC24 - Interrupts Missing |
Posted: Mon Feb 15, 2010 10:29 am |
|
|
In the PIC24FJ128GA108 the Header file has missing interrupts for Input capture and output compare.
There are only IC1-IC5. But I need all 9 Input captures.
What can I do without buying an update? Compiler Version is: PCD 4.095
Can I add the vectors manually?
Now I always get this error: Invalid Pre-Processor directive
Code: |
////////////////////////////////////////////////////////////////// INT
// Interrupt Functions: ENABLE_INTERRUPTS(), DISABLE_INTERRUPTS(),
// CLEAR_INTERRUPT(), INTERRUPT_ACTIVE(),
// EXT_INT_EDGE()
//
// Constants used in EXT_INT_EDGE() are:
#define L_TO_H 0x40
#define H_TO_L 0
//
// Constants used in other interrupt functions are:
#define INTR_GLOBAL 0x400
#define INTR_NORMAL 0x100
#define INTR_ALTERNATE 0x200
#define INTR_NESTING 0x300
#define INTR_LEVEL0 0x500
#define INTR_LEVEL1 0x501
#define INTR_LEVEL2 0x502
#define INTR_LEVEL3 0x503
#define INTR_LEVEL4 0x504
#define INTR_LEVEL5 0x505
#define INTR_LEVEL6 0x506
#define INTR_LEVEL7 0x507
#define INTR_CN_PIN 0x8000 // or in a PIN_xx constant
#define INT_OSCFAIL 1
#define INT_ADDRERR 2
#define INT_STACKERR 3
#define INT_MATHERR 4
#define INT_DMAERR 5
#define INT_EXT0 6
#define INT_IC1 7
#define INT_OC1 8
#define INT_TIMER1 9
#define INT_IC2 70
#define INT_OC2 71
#define INT_TIMER2 72
#define INT_TIMER3 73
#define INT_SPI1 75
#define INT_RDA 76
#define INT_TBE 77
#define INT_ADC1 78
#define INT_SI2C 81
#define INT_MI2C 82
#define INT_CNI 84
#define INT_EXT1 85
#define INT_OC3 90
#define INT_OC4 91
#define INT_TIMER4 92
#define INT_TIMER5 93
#define INT_EXT2 94
#define INT_RDA2 95
#define INT_TBE2 96
#define INT_SPI2E 97
#define INT_SPI2 98
#define INT_IC3 102
#define INT_IC4 103
#define INT_IC5 104
#define INT_OC5 106
#define INT_SI2C2 114
#define INT_MI2C2 115
#define INT_EXT3 118
#define INT_EXT4 119
#define INT_UART1E 130
#define INT_UART2E 131
#define INT_UART3E 141
#define INT_RDA3 142
#define INT_TBE3 143
#define INT_UART4E 144
#define INT_RDA4 145
#define INT_TBE4 146
#define INT_SPIE 150
#define INT_COMP 152
#define INT_PMP 164
#define INT_RTC 173
#define INT_CRC 174
#list |
|
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Mon Feb 15, 2010 10:41 am |
|
|
Tell the guys at CCS. A lot of times when you find a bug, you get a free update.
Until then, I typically make a project local copy of the .h file and edit accordingly -- OR add the #defines to your project.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
richi-d
Joined: 28 Aug 2007 Posts: 106
|
|
Posted: Mon Feb 15, 2010 10:52 am |
|
|
Hello Ben,
thank you for the tipp with the update.
But how can I define additional interrupt vektors? What numbers behind:
#define INT_IC6 ???
#define INT_IC7 ???
#define INT_IC8 ???
#define INT_IC9 ???
do I have to write? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Mon Feb 15, 2010 1:18 pm |
|
|
Have a look at the data sheet for the processor. By comparing the defines for the interrupts already in the CCS code you should be able to come up with the proper defines for the missing interrupts. It's all in the data sheet. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Feb 15, 2010 1:50 pm |
|
|
Quote: | By comparing the defines for the interrupts already in the CCS code you should be able to come up
with the proper defines for the missing interrupts. It's all in the data sheet. |
It looks like, but it isn't real. The defines are meaningless for PCD interrupt implementation. The real interrupt
information is in the device database (devices4.dat). INT_IC6 to INT_IC9 are still missing with PCD V4.104, by the way.
I don't need them in my projects, otherwise I had complained at CCS.
INT_IC6 to INT_IC8 have an disabled entry in the device database however and can be enabled with the device
editor tool. There's no way to activate INT_IC9, as far as I know. Unlike other compilers, PCD misses any means
to insert entries in the vector table manually. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Mon Feb 15, 2010 10:38 pm |
|
|
Yea, I was looking at that just now.
There's no relation to the .h entries and the actual device.
Annoying.
More and more, C30 looks like a good thing. I'm considering making the jump after a pretty successful weekend with C32.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Feb 16, 2010 12:03 am |
|
|
Quote: | More and more, C30 looks like a good thing. |
I don't want to contradict strictly. A good point with C30 is, that everything can be done. And (at least as
far as I'm aware of) it lacks of these annoying bugs. But unfortunately most things must be done on your own.
Even with simple peripheral accesses, you're almost lost in a huge amount of include files.
All-in-all, I prefer the CCS embedded C programming approach. I wonder however, when the PCD building site will be finished. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Feb 16, 2010 7:39 am |
|
|
I totally agree with you FvM, but the bugs... oohhh the bugs.
That and it would be nice to make use of the demo apps and library sources that MCHP writes.. :(
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
richi-d
Joined: 28 Aug 2007 Posts: 106
|
Bad support from CCS |
Posted: Tue Feb 16, 2010 7:40 am |
|
|
This was the answer I got from CCS:
Code: |
This message is a reply to CCS e-mail id: 0B5306
You will also need to add then to the device database. Use TOOLS > DEVICE EDITOR
|
I feel this answer is a brashness...
1. I don´t use the IDE
2. I want to programm PIC processors and not C-Compilers!
As I understand you, the Compiler updates wouldn´t help? I need at least IC6 to get my project done.
What else can I do?
Thanks
Richard |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Feb 16, 2010 8:55 am |
|
|
Yea, no.
Tell them it's missing from the device database and you can't edit/add it (which I looked too and playing in the editor always makes me cringe).
I would prefer to add ASM to handle it than edit the database.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
richi-d
Joined: 28 Aug 2007 Posts: 106
|
|
Posted: Tue Feb 16, 2010 10:08 am |
|
|
"I would prefer to add ASM to handle it than edit the database. "
Me too! I not the specialist to manipulate a database!
Any ideas how to do that in ASM? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Feb 16, 2010 1:46 pm |
|
|
Quote: | You will also need to add then to the device database. |
I had rather expected, they promise to fix the bug in the next release. But then they must give you a free update.
It doesn't work for IC9, as said. I also agree, that this basically isn't your job. And you should be able to use all device
features without purchasing the IDE.
Unfortunately, you can't set ISR vectors in PCD assembler. Of course, it should be able, also to use 23-bit literals for
jump targets, and possibly a few other assembler features.
CCS should at least send an updated devices4.dat (with IC6 .. IC9). Or a forum member can do. |
|
|
treanla Guest
|
|
Posted: Wed Feb 17, 2010 2:08 am |
|
|
Also the DAC interrupts were missing before. I sent an email to CCS and promptly got new devices file and updated header file without any problems from CCS. |
|
|
richi-d
Joined: 28 Aug 2007 Posts: 106
|
|
Posted: Thu Feb 18, 2010 7:16 am |
|
|
I don´t get a answer from the support. Thats really not good! I need urgently a solution!! |
|
|
richi-d
Joined: 28 Aug 2007 Posts: 106
|
|
Posted: Thu Mar 11, 2010 8:06 am |
|
|
Now I updated the compiler to 4.105 and used the Device editor and checked the Box for INT_IC6. Now another error occours:
Line 32(19,26): Undefined identifier INT_IC6
I think now I need to add to the header file:
#define INT_IC6 XXX
But what number should I write to XXX ?
Any ideas. Where do I find this numbers? |
|
|
|