some troubles in the Pro version

Beta Testing discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Sidharta
Posts: 233
Joined: 01 Sep 2005 10:53
Location: Spain

some troubles in the Pro version

#1 Post by Sidharta » 15 Dec 2009 11:40

If I try to compile
void Timer23Int() org 0x23 {

BlinkLedPlaca(0,0) ;

}
to use interrupt 23 I get the message error
145 304 Org address must be even number Entrada.c

if I try to use the can library I get the errors
79 324 Undeclared identifier 'CAN_CONFIG_SAMPLE_THRICE' in expression CAN1.c
80 324 Undeclared identifier 'CAN_CONFIG_PHSEG2_PRG_ON' in expression CAN1.c
etc etc
After the conversion there are a lot of error but this ones seems serious...

:roll:
To be or not to be...Hum.. sure I need more options

womai
Posts: 239
Joined: 16 Apr 2008 07:45

#2 Post by womai » 15 Dec 2009 18:39

Hi Sidharta,

the dsPIC interrupt table can be a bit confusing - took me a couple of days to figure it out. Here's the solutions:

The jump table address for the interrupt routine is calculated as

address = base_address + 2 * interrupt_number

(the reason for the factor of 2 is that the interrupt table holds function pointers which each use 2 bytes. On the dsPIC30F2020 the base_address is 20 dec. = 0x14 hex, so assuming it's the same on your device (please double-check!) that makes

void Timer23Int() org (0x14 + 2* 0x23)

Wolfgang

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#3 Post by jpc » 15 Dec 2009 18:53

the best you do is have a look in the definition files, there you will find ( amongst other usefull stuff) very nice predefined interrupt vector table constants IVT_ADDR_U2RXINTERRUPT making the programmers life a lot easyer! By using these constants you do not have to modify the absolute vector-addresses for each other chip.
Au royaume des aveugles, les borgnes sont rois.

Sobrietytest
Posts: 619
Joined: 05 Jul 2008 06:05
Location: Thailand

#4 Post by Sobrietytest » 16 Dec 2009 06:42

Hi Sidharta, ME have set up a new forum for the dsPRO compiler, the main forum is locked at the moment but if you go to the beta testing forum you can post there. Some of us have had a few initial problems with the compiler and you will find solutions from the ME team...

http://www.mikroe.com/forum/viewforum.php?f=102

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#5 Post by anikolic » 16 Dec 2009 11:10

Hi,
Sidharta, as jpc has mentioned, in dsPIC PRO compilers we have introduced Definition files equipped with interrupt and alternative interrupt table addresses for each vector and you can use them when org-ing your interrupt implementation functions.

Best regards,
Aleksandar
Web Department Manager

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 Beta Testing”