EmbeddedRelated.com

MsCAN Tx Interrupt question

Started by apedroso11 in 68HC1218 years ago 2 replies

Hi all, I've been working on a MsCAN driver for DP256. I am going over it and I have some questions: The MSCAN Block Guide V02.15 says...

Hi all, I've been working on a MsCAN driver for DP256. I am going over it and I have some questions: The MSCAN Block Guide V02.15 says that TX interrupt must be acknowledged by clearing the corresponding flag CANTFLG. 1. Should I ack the tx interrupt doing CANTFLG |= CANTFLG; ? this way I set the empty buffers ready for tx. 2. I only must clear the bit causing the interrupt, but h...


HCS12 and CAN-module

Started by mlammila in 68HC1220 years ago 6 replies

I used before HC12 (60 and 128) and it's msCAN-module which worked fine. Now I have tried to use MC9S12D64 microcontroller's...

I used before HC12 (60 and 128) and it's msCAN-module which worked fine. Now I have tried to use MC9S12D64 microcontroller's msCAN-module and I have got it to send messages (checked with oscilloscope) but there is something wrong in the sending because my monitor program (national


Problem with initialising msCAN 6812dp256b

Started by Sebastian Schuster in 68HC1220 years ago 4 replies

This time I need some help with the msCAN. The program runs in loop- mode, so the data from the transmiter buffer should turn up in...

This time I need some help with the msCAN. The program runs in loop- mode, so the data from the transmiter buffer should turn up in the reveiver buffer. But this is not the case. Regards Sebastian #include /* common defines and macr


sample msCAN code for HCS12

Started by Steve Letkeman in 68HC1220 years ago

A number of people have asked me for some sample code for the newest version of msCAN, here it is... // This file may be...

A number of people have asked me for some sample code for the newest version of msCAN, here it is... // This file may be freely distributed as long as this header remains // intact in order to encourage you to visit our web site // at www.zanthic.com home of the CAN-4-U


Problems in Using MSCAN

Started by forum_user77 in 68HC1216 years ago 5 replies

Hello, I am trying to work with the MSCAN-Module of the HCS12. I have CAN-Dongle for a PC and try to send a CAN Message from the PC to the...

Hello, I am trying to work with the MSCAN-Module of the HCS12. I have CAN-Dongle for a PC and try to send a CAN Message from the PC to the HCS12. I receive the message with the HCS12 and show the data at some LED's. But at the Computer I always get the Error-Message BUSHEAVY. Could you have a look at my code for the HCS12 and tell me what's wrong. Perhaps the baud rate is wrong. ...


MSCAN TX interrupt ILLEGAL BP BGND

Started by "ondrej.machek" in 68HC1215 years ago 2 replies

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...

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[...


9S12DP256 CAN Initialization

Started by bdcps2002 in 68HC1222 years ago 8 replies

Hi everybody, I am using MC9S12DP256 on TechnologicalArts board, which has 2 CAN ports. Even though CAN works in Loopback mode, I...

Hi everybody, I am using MC9S12DP256 on TechnologicalArts board, which has 2 CAN ports. Even though CAN works in Loopback mode, I couldn't get them to talk to each other. When initializing, do I have to do anything other than: // Enable MSCAN module.???? Anything else


MC9S12DG256: CAN Problems

Started by Daniel Winkler in 68HC1219 years ago 1 reply

Hello, i'm fairly new in HCS12 an CAN programming and have a problem getting the MSCAN Module to work properly. The problem...

Hello, i'm fairly new in HCS12 an CAN programming and have a problem getting the MSCAN Module to work properly. The problem is that i try to write a little CANMonitor for the MC9S12DG256 in C (using ImageCraft ICC12 Version 6). For the first tests i adapted a code ex


Interrupt driven MsCan bus

Started by Paul Johnson in 68HC1222 years ago 8 replies

Hi All, All of the examples I have seen using the CAN bus with the HC12 line uses simple polling. Is anyone aware of an example...

Hi All, All of the examples I have seen using the CAN bus with the HC12 line uses simple polling. Is anyone aware of an example using interrupts? Has anyone out there used interrupts themselves? On a related note, all of the examples use only one of the output registers


msCAN Transmit problem

Started by Doug Brainard in 68HC1221 years ago 2 replies

I am having a problem setting the Transmit ID buffers in my CAN setup. I am using the following code section: CAN0TIDR0 =...

I am having a problem setting the Transmit ID buffers in my CAN setup. I am using the following code section: CAN0TIDR0 = tran.id[0]; CAN0TIDR1 = tran.id[1]; CAN0TIDR2 = tran.id[2]; CAN0TIDR3 = tran.id[3]; Seems simple enough. This in turn compiles into thi


MSCAN problem

Started by Johannes Schmid in 68HC1215 years ago 13 replies

Hi everybody! I have a problem using the CAN-Bus interface of the HCS12 used in the MicroSquirt(tm) ECU we use on our Formula race...

Hi everybody! I have a problem using the CAN-Bus interface of the HCS12 used in the MicroSquirt(tm) ECU we use on our Formula race car. Following the various data sheets I came up with the following code: void CanInit(void) { /* Set up CAN communications */ /* Enable CAN, set Init mode so can change registers */ CANCTL1 |= 0x80; CANCTL0 |= 0x01; while(!(CANCTL1 & 0x01)) ...


MSCAN Identifier of a received message

Started by foru...@gmx.net in 68HC1215 years ago 16 replies

Hello, I have a communication between a HCS12 and a Computer. I receive CAN messages with the HCS12. That works fine so far, sending messages,...

Hello, I have a communication between a HCS12 and a Computer. I receive CAN messages with the HCS12. That works fine so far, sending messages, too. Is it possible to get the identifier of an received CAN message? Is it stored in a register or something like that so that I can read out the identifier of the last received CAN message? Best Regards Folgli --------------------------------...


How to set Identifier Accepance Filter register for MSCAN on MC9S12DP512

Started by Gurumurthy in 68HC1217 years ago 4 replies

Hi all... I have two messages with ID 0x100 and 0x101. What all i need to set in Acceptance filter register and acceptance mask...

Hi all... I have two messages with ID 0x100 and 0x101. What all i need to set in Acceptance filter register and acceptance mask register? Can anyone explain with an example? I am using CAN in standard forat(11 bit identifier) and 4 16 bit filter mode. Thanks in advance Gurumurthy