SLLSFR8A September 2025 – October 2025 TCAN5102-Q1
ADVANCE INFORMATION
This example is a basic example of configuring a simple static-on PWM waveform.
| PARAMETER | VALUE |
|---|---|
| Switching Frequency | 10kHz |
| Output Resolution | 8-Bit |
| Duty Cycle | 20% |
There are only a few registers that need to be configured for a simple static PWM waveform. The general process and registers needed are:
| Step | Parameter | Example | Description | Value |
|---|---|---|---|---|
| 1 | Switching Frequency | 40MHz / (10kHz × 28) = 15.625 | Calculate the switching frequency divisor | |
| TRUNC(15.625) = 15 | Calculate the integer portion of the divisor | d15 or 0x00F | ||
| ROUND(0.625 × 128) = 80 | Calculate the fractional portion of the divisor | d80 or 0x50 | ||
| 2 | Duty Cycle | ROUND(20% × 256) = 51.2 | Determine and get the nearest integer duty cycle count value. | d51 or 0x33 |
After the parameters are calculated, the parameters are written into the appropriate registers as shown in the example below.
| Step | Register | Data (Hex) | Description |
|---|---|---|---|
| 1 | PWM_CTRL | 0x0F | Sets INIT, the PWM mode to static on, and enables 8-bit duty cycle resolution |
| 2 | PWM_END_VAL_CONST_FRAC_F | 0x50 | Write the fractional divisor for switching frequency |
| 3 | PWM_END_VAL_MSB | 0x00 | Write the MSB of the divisor for switching frequency |
| 4 | PWM_END_VAL_LSB | 0x0F | Write the LSB of the divisor for switching frequency |
| 5 | PWM_CONST_MSB | 0x00 | Write the MSB for the duty cycle count. Since this example is 8-bit mode, this does not really matter |
| 6 | PWM_CONST_LSB | 0x40 | Write the LSB for the duty cycle count |
| 7 | PWM_CTRL | 0x0E | Disable the INIT bit to enable IP |
| 8 | PWM_ACTION | 0x02 | Turn on PWM output |