Generate a 500KHz clock with an MC9S12DP512 running a bus of 24MHz

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

Generate a 500KHz clock with an MC9S12DP512 running a bus of 24MHz

ソリューションへジャンプ
879件の閲覧回数
fer
Contributor I

Hello,

I am trying to create a 500KHz clock, and I want to be able to count each cycle of the frequency so that when the clock reaches 4096 cycles, it resets a counter and triggers some functions.

I want to be able to run the counter while sending 2035 bits of data using SPI.

 

I have created the 500Khz clock, but I am not able to count each indivudual cycle.

 

I am trying to generate this so that I can control some TLC5940's LED drivers.

Any help and advise is really appreciated.

 

Thank You

ラベル(1)
0 件の賞賛
返信
1 解決策
770件の閲覧回数
RadekS
NXP Employee
NXP Employee

For generating clock you can use simply PWM module, however this module doesn’t have interrupt.

I would like to recommend externally connect PWM output pin and pin with interrupt feature.

This way you can count number of pulses.

In attachment you can find simple example code.


元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
771件の閲覧回数
RadekS
NXP Employee
NXP Employee

For generating clock you can use simply PWM module, however this module doesn’t have interrupt.

I would like to recommend externally connect PWM output pin and pin with interrupt feature.

This way you can count number of pulses.

In attachment you can find simple example code.


0 件の賞賛
返信