Clocking

  • Running the core clock at its maximum of 120 MHz
  • Bus clocks (both of them) are their maximum of 60 MHz

Timing (what triggers what)

Coordinating the timing of everything is pretty important. The general idea is to keep everything in sync based on the FTM module(s) which drive the motor outputs. They trigger the ADCs too.

FTM0 and FTM3 are synced using the global time base when driving two motors for the pistol grip controller.

The timing is divided into "cycles". Each cycle is a fixed length of time. The start of the cycle is when the FTM module(s) have a count of 0.

See //motors/peripheral:adc_dma.cc for details on how hardware-triggered ADC sampling works.