MC9S12XEP100 - Generating CAN-based message according to the transmission rate

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MC9S12XEP100 - Generating CAN-based message according to the transmission rate

1,163件の閲覧回数
samsam
Contributor I

Hi there,

 

I am new to MCU design and just want to get some help on how to generate CAN message according to the official transmission rate. I am using the MC9S12XEP100, and I just figured out how to set up the ADC and be able to do the analog input conversion. I am wondering what I should do next in order to sample the converted ADC result and package them as CAN message. My concern is:

 

1) Should I use ECT, PIT, RTI, or I don't need to use interrupt at all? Let say if I want to sample the analog input for every 100ms, what is the best approach to do it?

 

2) I know the ADC module comes with an interrupt channel too, but I am not sure if it will work or not when this interrupt is time-driven (like interrupt every 100ms)rather than event-driven.

 

I am just confused with all the available counter, down-counter, and etc from the S12 family and just want to start with the best approach. Thanks for the help!

ラベル(1)
0 件の賞賛
返信
1 返信

403件の閲覧回数
jsmcortina
Contributor III

Lots of options.

 

One implementation could use the RTI as a "heartbeat" for your application. Either set the interval to your desired 100ms, or run it faster and use a software down-counter within the RTI interrupt.

 

James

0 件の賞賛
返信