I'm working in a project where I have to use produce a PWM signal which actively drives the pin low for 0, and disconnects the pin for 1. The PWM is generated by an in house created library, which uses one timer and one gpiote to toggle the pin at the correct times.
I configure the pin for the PWM as:
NRF_GPIO->PIN_CNF[PIN_NUM] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
| (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos)
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos )
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
| (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos );
However this produces a pin state that always seem to be disconnected.
Is it possible to do what I'm after?
Note: I think it is very unlikely that the issue is within our PWM library, as this library has been in use in several products over several year without issues. It has work well on both S0S1 and H0H1 modes in the past.