Professional Documents
Culture Documents
Generate A 256-Bit Stream Out of A Pin at 4 MHZ While The Mcu Operates at 32 MHZ Clock Frequency
Generate A 256-Bit Stream Out of A Pin at 4 MHZ While The Mcu Operates at 32 MHZ Clock Frequency
Generate a 256-bit stream out of a pin at 4 MHz while the MCU operates at 32 MHz clock
frequency:
I would use an 8-bit timer and every time the timer measures 8 clock cycles I would
toggle the pin and reset the timer. (32 MHz/4 MHz = 8 clock cycles).
The timer runs independent of the CPU, there should not be any clock jitters.
If the timer supports generating an interrupt when a programmed value is reached in
the timer register, then I would use that interrupt service routine to change pin state.
if not, I can also use a while loop to continuously poll the timer value to change the pin
state and reset the timer.
For generating the 256-bit stream at 8 MHz I would simply toggle the pin every time the
timer measures 4 clock cycles (32 MHz/8 MHz = 4 clock cycles).
I would Cypress HX3 USB 3.0 hub controller (CYUSB3304- 68LTXC) for this USB3.0 hub design.