ZX24u PWM

Discussion specific to the 24-pin ZX microcontrollers, e.g. ZX-24r, ZX-24s and ZX-24t.
Post Reply
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

ZX24u PWM

Post by kurakaira »

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 .
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ZX24u PWM

Post by dkinzer »

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

Code: Select all

Call PutPin(pin, zxInvertIO)
- Don Kinzer
Post Reply