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.