SPRACM3E August 2021 – January 2023 F29H850TU , F29H859TU-Q1 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280033 , TMS320F280034 , TMS320F280034-Q1 , TMS320F280036-Q1 , TMS320F280036C-Q1 , TMS320F280037 , TMS320F280037-Q1 , TMS320F280037C , TMS320F280037C-Q1 , TMS320F280038-Q1 , TMS320F280038C-Q1 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28384D , TMS320F28384S , TMS320F28386D , TMS320F28386S , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
The lead device frame transmission trigger to send the ping packet at regular intervals is done using EPWM1C module. The lead device is configured to send ping packets based on EPWM compare events. User needs to configure EPWM counter compare C register, EPWM_CMPC_VALUE, in the code as per the hardware configuration. This value depends on external factors such as distance between two nodes, device oscillator clock, isolation barriers, and so forth. The frequency to send the ping packet can be in fractions of the EPWM clock frequency and can be further adjusted by configuring the EPWM_CMPC_EVENT_COUNT parameter. The EPWM_CMPC_EVENT_COUNT parameter sets the EPWM event trigger prescalar value, which configures the frame transmission trigger to occur on every Nth compare event. The maximum value of the prescalar is 15.
The duty cycle and frequency of EPWM can be adjusted in the code by updating EPWM_CMPA_VALUE for EPWM1A duty cycle, EPWM_CMPB_VALUE for EPWM1B duty cycle and EPWM_TIMER_TBPRD for frequency. Default values are 50% duty cycle at 20 kHz EPWM frequency.