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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
873 次查看
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 解答
764 次查看
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 回复
765 次查看
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 项奖励
回复