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
Solved! Go to Solution.
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.
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.