Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | MSCAN TX interrupt ILLEGAL BP BGND


Advertise Here

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

MSCAN TX interrupt ILLEGAL BP BGND - "ondrej.machek" - Nov 29 11:08:54 2008

Hello,
I would like ask you.
I am using interrupt for my transmit MSCAN can0 but at the end,
M68evb912DP256 jump to command ILLEGAL BP and asm BGND. Do anybody
know please where could be error?

Thank you very much to all.

void interrupt 39 Tx_CAN0(void){

unsigned volatile char i, buf_num, can_tx_msg[16];
buf_num = CAN0TFLG;
CAN0TBSEL = buf_num;
buf_num = CAN0TBSEL;

can_tx_msg[0]='S';
can_tx_msg[1]='T';
can_tx_msg[2]='0';
can_tx_msg[3]='0';
can_tx_msg[4]='A';
can_tx_msg[5]='H';
can_tx_msg[6]='O';
can_tx_msg[7]='J';
can_tx_msg[8]='0';
can_tx_msg[9]='0';
can_tx_msg[10]='0';
can_tx_msg[12]='0';
can_tx_msg[13]='4';
can_tx_msg[14]='1';
*CAN0TXFG = can_tx_msg[0];
*(CAN0TXFG +1) = can_tx_msg[1];
*(CAN0TXFG + 2) = can_tx_msg[2];
*(CAN0TXFG + 3) = can_tx_msg[3];

for(i=0; i *(CAN0TXFG +i +4) = can_tx_msg[i+4];
}
*(CAN0TXFG + 12) = can_tx_msg[12];

*(CAN0TXFG +13) = can_tx_msg[13];
CAN0TFLG = buf_num;
//CAN0TIER = buf_num;
} /*konec preruseni*/
------------------------------------



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: MSCAN TX interrupt ILLEGAL BP BGND - Edward Karpicz - Nov 29 12:16:27 2008

> can_tx_msg[12]='0';

'0' is 0x30. Keeping that in mind please look closer at these lines:

> for(i=0; i > *(CAN0TXFG +i +4) = can_tx_msg[i+4];
> }

I think this ^^ not only fills CAN0TXFG with your data, but also overwrites
all CAN1 module control registers with random data from the stack. I guess
some CAN1 interrupts get enabled and CPU jumps to not initialized CAN1
interrupt vector.

Edward
----- Original Message -----
From: "ondrej.machek"
To: <6...@yahoogroups.com>
Sent: Saturday, November 29, 2008 6:08 PM
Subject: [68HC12] MSCAN TX interrupt ILLEGAL BP BGND
> Hello,
> I would like ask you.
> I am using interrupt for my transmit MSCAN can0 but at the end,
> M68evb912DP256 jump to command ILLEGAL BP and asm BGND. Do anybody
> know please where could be error?
>
> Thank you very much to all.
>
> void interrupt 39 Tx_CAN0(void){
>
> unsigned volatile char i, buf_num, can_tx_msg[16];
> buf_num = CAN0TFLG;
> CAN0TBSEL = buf_num;
> buf_num = CAN0TBSEL;
>
> can_tx_msg[0]='S';
> can_tx_msg[1]='T';
> can_tx_msg[2]='0';
> can_tx_msg[3]='0';
> can_tx_msg[4]='A';
> can_tx_msg[5]='H';
> can_tx_msg[6]='O';
> can_tx_msg[7]='J';
> can_tx_msg[8]='0';
> can_tx_msg[9]='0';
> can_tx_msg[10]='0';
> can_tx_msg[12]='0';
> can_tx_msg[13]='4';
> can_tx_msg[14]='1';
> *CAN0TXFG = can_tx_msg[0];
> *(CAN0TXFG +1) = can_tx_msg[1];
> *(CAN0TXFG + 2) = can_tx_msg[2];
> *(CAN0TXFG + 3) = can_tx_msg[3];
>
> for(i=0; i > *(CAN0TXFG +i +4) = can_tx_msg[i+4];
> }
> *(CAN0TXFG + 12) = can_tx_msg[12];
>
> *(CAN0TXFG +13) = can_tx_msg[13];
> CAN0TFLG = buf_num;
> //CAN0TIER = buf_num;
> } /*konec preruseni*/

------------------------------------



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: MSCAN TX interrupt ILLEGAL BP BGND - "ondrej.machek" - Nov 29 13:49:49 2008

Yes I am sorry my mistake. Thank you very much.
I repair it with right length. But my problem still persist.

Do know please, how I can initialized this interrupt vector?
I am sorry, I am beginner.
Thank you very much.
--- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
>
> > can_tx_msg[12]='0';
>
> '0' is 0x30. Keeping that in mind please look closer at these lines:
>
> > for(i=0; i > > *(CAN0TXFG +i +4) = can_tx_msg[i+4];
> > }
>
> I think this ^^ not only fills CAN0TXFG with your data, but also
overwrites
> all CAN1 module control registers with random data from the stack.
I guess
> some CAN1 interrupts get enabled and CPU jumps to not initialized
CAN1
> interrupt vector.
>
> Edward
> ----- Original Message -----
> From: "ondrej.machek"
> To: <6...@yahoogroups.com>
> Sent: Saturday, November 29, 2008 6:08 PM
> Subject: [68HC12] MSCAN TX interrupt ILLEGAL BP BGND
> > Hello,
> > I would like ask you.
> > I am using interrupt for my transmit MSCAN can0 but at the end,
> > M68evb912DP256 jump to command ILLEGAL BP and asm BGND. Do anybody
> > know please where could be error?
> >
> > Thank you very much to all.
> >
> > void interrupt 39 Tx_CAN0(void){
> >
> > unsigned volatile char i, buf_num, can_tx_msg[16];
> > buf_num = CAN0TFLG;
> > CAN0TBSEL = buf_num;
> > buf_num = CAN0TBSEL;
> >
> > can_tx_msg[0]='S';
> > can_tx_msg[1]='T';
> > can_tx_msg[2]='0';
> > can_tx_msg[3]='0';
> > can_tx_msg[4]='A';
> > can_tx_msg[5]='H';
> > can_tx_msg[6]='O';
> > can_tx_msg[7]='J';
> > can_tx_msg[8]='0';
> > can_tx_msg[9]='0';
> > can_tx_msg[10]='0';
> > can_tx_msg[12]='0';
> > can_tx_msg[13]='4';
> > can_tx_msg[14]='1';
> >
> >
> > *CAN0TXFG = can_tx_msg[0];
> > *(CAN0TXFG +1) = can_tx_msg[1];
> > *(CAN0TXFG + 2) = can_tx_msg[2];
> > *(CAN0TXFG + 3) = can_tx_msg[3];
> >
> > for(i=0; i > > *(CAN0TXFG +i +4) = can_tx_msg[i+4];
> > }
> > *(CAN0TXFG + 12) = can_tx_msg[12];
> >
> > *(CAN0TXFG +13) = can_tx_msg[13];
> > CAN0TFLG = buf_num;
> > //CAN0TIER = buf_num;
> > } /*konec preruseni*/
> >
>
------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )