Forums

MSCAN and CanReadCallBack interrupt problem

Started by jamessconnors July 26, 2004
I am using the mscan drivers from SDK3.0 and the example program
can.h which comes with that version of the SDK. In their CAN
example they setup a function "CanReadCallBack" to handle newly
received CAN messages. It is setup in the appconfig.h file as
#define CAN_RAW_CALLBACK CanReadCallBack

So, I have tried to integrate this example into my code, however, my
program makes use of many interrupts, and after integration, any
received CAN message will trigger the CanReadCallBack function, but
after that, all my interrupts are disabled, and archEnableInt()
doesn't work.

I found that removing all the lines which define the priority of any
of my existing interrupts solves the problem, but then my other
interrupts just don't work.

(e.i removing "#define GPR_INT_PRIORITY_55 6")

Maybe the problem is in using the CAN_RAW_CALLBACK?

Any help would be greatly appreciated!

-James



Hi James

Sorry I have no good ideas. Here's an unlikely one:

If you have an old enough version of CW (5.0, maybe), look at the ASM
disassembly at the end of each ISR. I always put a breakpoint near the end,
then looked at the ASM output after breaking there. In your case, you would
probably have the "break" inside your callback function, then single step
until you reached the part of the SDK interrupt dispatcher that actually
does the RTI ... to be sure that it happens.

Make sure there is an RTI, not RTS! If that is a problem, make sure you did
not check the checkbox for "deferred inlining" in Target Settings - Language
Settings". Or update to 5.0.4.

I understand that this driver is a third-party product. My manual for it
says "Motorola" everywhere, not "Metrowerks". Maybe Moto Tech Support
(Digital DNA) will offer advice. I would love to know how many copies they
sold - I thought the "virtual pipe" idea was wacky for embedded systems, but
I'm not a marketing guru.

We are spending a lot of time and money to make ourselves independent of the
SDK, especially the interrupt dispatcher. We are moving from the 5.x tools
to the 6.x CW tools, and from the 56803 and 56807 to the 568357, and are
purging the SDK from our projects. We're avoiding Processor Expert, except
as a source of sample code.

Good luck! I would love to know if it is resolved.

Rick Corey -----Original Message-----
From: jamessconnors [mailto:]
Sent: Monday, July 26, 2004 9:12 AM
To:
Subject: [motoroladsp] MSCAN and CanReadCallBack interrupt problem I am using the mscan drivers from SDK3.0 and the example program
can.h which comes with that version of the SDK. In their CAN
example they setup a function "CanReadCallBack" to handle newly
received CAN messages. It is setup in the appconfig.h file as
#define CAN_RAW_CALLBACK CanReadCallBack

So, I have tried to integrate this example into my code, however, my
program makes use of many interrupts, and after integration, any
received CAN message will trigger the CanReadCallBack function, but
after that, all my interrupts are disabled, and archEnableInt()
doesn't work.

I found that removing all the lines which define the priority of any
of my existing interrupts solves the problem, but then my other
interrupts just don't work.

(e.i removing "#define GPR_INT_PRIORITY_55 6")

Maybe the problem is in using the CAN_RAW_CALLBACK?

Any help would be greatly appreciated!

-James

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3

Yahoo! Groups Links


Interrupts also can be disabled in IPR (Interrupt Priority Register
bits 9...15 named ch6...ch0, it's address 0xFFFB). archEnableInt()
function enables all interrupts only by unmasking it in SR (Status
Register) but if, for example, ch5 bit in IPR set to 0 all interrupts
assigned to this channel will be disabled any way (i.e. all
interrupts with GPR_INT_PRIORITY set to 6 (six) in this example).

--- In , "jamessconnors"
<jamessconnors@y...> wrote:
> I am using the mscan drivers from SDK3.0 and the example program
> can.h which comes with that version of the SDK. In their CAN
> example they setup a function "CanReadCallBack" to handle newly
> received CAN messages. It is setup in the appconfig.h file as
> #define CAN_RAW_CALLBACK CanReadCallBack
>
> So, I have tried to integrate this example into my code, however,
my
> program makes use of many interrupts, and after integration, any
> received CAN message will trigger the CanReadCallBack function, but
> after that, all my interrupts are disabled, and archEnableInt()
> doesn't work.
>
> I found that removing all the lines which define the priority of
any
> of my existing interrupts solves the problem, but then my other
> interrupts just don't work.
>
> (e.i removing "#define GPR_INT_PRIORITY_55 6")
>
> Maybe the problem is in using the CAN_RAW_CALLBACK?
>
> Any help would be greatly appreciated!
>
> -James