ZHCSN81 july 2023 ADS131B23-Q1
PRODUCTION DATA
When GPIOx is configured for PWM format using the GPIOx_FMT bit, the PWM period and duty cycle can be independently configured for a logic high and low level with fine granularity. The GPIOx_LL_PWM_LC[6:0] (GPIOx logic low level PWM low counter value) and GPIOx_LL_PWM_HC[6:0] (GPIOx logic low level PWM high counter value) bits together with the GPIOx_PWM_TB[1:0] (GPIOx PWM time base) bits determine the PWM period and duty cycle when a logic low level is driven as per the GPOx_DAT bit. Similarly, the GPIOx_LH_PWM_LC[6:0] (GPIOx logic high level PWM low counter value) and GPIOx_LH_PWM_HC[6:0] (GPIOx logic high level PWM high counter value) bits together with the GPIOx_PWM_TB[1:0] bits determine the PWM period and duty cycle when a logic high level is driven as per the GPOx_DAT bit.
The following equations specify the PWM period and duty cycle:
Figure 9-13 depicts a visual representation of how the various configuration values produce a certain PWM output. The PWM period always starts with the PWM low time. Changes to the PWM period and duty cycle based on the GPOx_DAT bit only take effect at the start of a new PWM period.
Table 9-14 provides example configuration values for GPIO1 where the logic high level is configured for 75% duty cycle using a 1-ms period and the logic low level for a 25% duty cycle using the same 1-ms period. The PWM time base is chosen as 8.192 MHz / 1024 = 125 μs, assuming an fMCLK = 8.192 MHz is used. The sum of the high and low counter must be eight in this case to yield a PWM period of 8 × 125 μs = 1 ms. Changing the GPIO1_LL_PWM_LC[6:0] = 3Ch = 60 and the GPIO1_LL_PWM_HC[6:0] = 14h = 20 (for example) results in the same 25% duty cycle, but at a PWM period of 80 × 125 μs = 10 ms.
BIT FIELD | BIT FIELD SETTING | VALUE | CORRESPONDING TIME (BASED ON fMCLK = 8.192 MHz) |
---|---|---|---|
GPIO1_PWM_TB[1:0] | 3h | 1024 × tMCLK | 125 μs |
GPIO1_LL_PWM_LC[6:0] | 06h | 6 | 750 μs |
GPIO1_LL_PWM_HC[6:0] | 02h | 2 | 250 μs |
GPIO1_LH_PWM_LC[6:0] | 02h | 2 | 250 μs |
GPIO1_LH_PWM_HC[6:0] | 06h | 6 | 750 μs |