Strange behavior with PWM ch10 on a ZX24u .
If i have PutPin(17, 0) before OpenPWM , i get a voltage output of 0-600mV .
If i have PutPin(17, 1) before OpenPWM , i get a voltage output of 600mV-3.3V .
If i leave out the PutPin , the PWM is good 0-3.3V .
ZX24u PWM
Re: ZX24u PWM
I looked at the xMega datasheet and the ZBasic code and discovered that the PutPin() prior to setting up PWM are not required for the xMega devices. The ZBasic code for PWM configures the corresponding to be an output so that s why it works without the PutPin() call. This is a deficiency in the documentation.
For the xMega, if you want to change the polarity of the PWM signal you have to set up the pin for inverted output using
For the xMega, if you want to change the polarity of the PWM signal you have to set up the pin for inverted output using
Code: Select all
Call PutPin(pin, zxInvertIO)
- Don Kinzer