Re: dp256

Started by Uwe Arends May 14, 2005
Ritesh,

> Can u tell me how can i write isr routine , I wrote it but as a
> function and the keyword interrupt and it no. Another way i tried out is to
> write function and put the name in the vector table.
> I am trying out CAN Communication using DP256
> Before the function definition i didnot use #pragma is that the
> problem.

you'll have to tell us which compiler you are using.
Regardless of that, your ISR has to be put into the
vector table.

-uwe


hi
i am using codewarrior v3.1tool thanks
rithesh
Uwe Arends <Uwe_Arends@Uwe_...> wrote:
Ritesh,

> Can u tell me how can i write isr routine , I wrote it but as a
> function and the keyword interrupt and it no. Another way i tried out is to
> write function and put the name in the vector table.
> I am trying out CAN Communication using DP256
> Before the function definition i didnot use #pragma is that the
> problem.

you'll have to tell us which compiler you are using.
Regardless of that, your ISR has to be put into the
vector table.

-uwe
---------------------------------
Yahoo! Groups Links

To Yahoo! India Matrimony: Find your life partneronline.



Rithes,

> i am using codewarrior v3.1tool

unfortunately, that's the one I haven't used as of yet.
I've got the special edition on my machine, so if I find
some time, I'll try to figure it out and let you know.

Regards,

-uwe


Ritesh,

> > i am using codewarrior v3.1tool
>
> unfortunately, that's the one I haven't used as of yet.
> I've got the special edition on my machine, so if I find
> some time, I'll try to figure it out and let you know.

as far as I can see, they're doing it this way:

define a constant array of function pointers exactly
the size of the vector table located at 0xFF80

define your interrupt routine as:
interrupt void SCI0_ISR(void){
}
for example

OF course, the interrupt routines you define have to
be contained in the above constant array.

Take a look at the demo project that comes with CW located
in (CodeWarrior_Examples)\MC9S12\DP\DP256B called DP256B Demo.

hth
-uwe


hello,

you can put the name of the interrupt function at the
address 0xffd6 in the vector table

;; SCI
.word def; ffd4//$FFD4, $FFD5 SCI 1 I-Bit SC1CR2
(TIE, TCIE, RIE, ILIE) $D4
.word int_SCI0 ; ffd6 //$FFD6, $FFD7 SCI 0 I-Bit
SC0CR2 (TIE, TCIE, RIE, ILIE) $D6

define your interrupt routine as:
void int_SCI0()
{
char car;
car = SCI0SR1; // clear IT of SCI by reading
it if ((SCI0SR1 & BM_3)== BM_3)
{
}
else if ((SCI0SR1 & BM_5)== BM_5)
{

PORTB = SCI0DRL;
} }
define the prototype in the top of your file:
void int_SCI0(char car) __attribute__((interrupt));
I can use it and its operates very well

use in windows the hyperterminal to watch if its
operates.

Since regards
Ludo

--- Uwe Arends <Uwe_Arends@Uwe_...> a rit:

---------------------------------
Ritesh,

> > i am using codewarrior v3.1tool
>
> unfortunately, that's the one I haven't used as of
yet.
> I've got the special edition on my machine, so if I
find
> some time, I'll try to figure it out and let you
know.

as far as I can see, they're doing it this way:

define a constant array of function pointers exactly
the size of the vector table located at 0xFF80

define your interrupt routine as:
interrupt void SCI0_ISR(void){
}
for example

OF course, the interrupt routines you define have to
be contained in the above constant array.

Take a look at the demo project that comes with CW
located
in (CodeWarrior_Examples)\MC9S12\DP\DP256B called
DP256B Demo.

hth
-uwe
---------------------------------
Yahoo! Groups Links

To

_____________________________________________________________________________
Douvrez le nouveau



hi there,
Can u tell me how can i write isr routine , I wrote it but as a
function and the keyword interrupt and it no. Another way i tried out is to
write function and put the name in the vector table.
I am trying out CAN Communication using DP256
Before the function definition i didnot use #pragma is that the
problem.

Please do reply me
Thanks Yahoo! India Matrimony: Find your life partneronline.



--- In 68HC12@68HC..., rithes ameen <ritheshamin@y...> wrote:
> hi there,
> Can u tell me how can i write isr routine , I wrote it but as a
> function and the keyword interrupt and it no. Another way i tried
out is to
> write function and put the name in the vector table.
> I am trying out CAN Communication using DP256
> Before the function definition i didnot use #pragma is that the
> problem.
>
> Please do reply me
> Thanks > Yahoo! India Matrimony: Find your life partneronline.


Best way in Codewarrior (in my opinion) is to not use any
non-standard keywords. Instead, use #pragma.

#pragma TRAP_PROC
void isr (void)
{
...
}

And then in the .prm-file:

VECTOR ADDRESS 0xFFFF

Note that sence the vector table uses 16-bit addresses you must put
all isr into non-paged memory.