Home/Support/Support Forum/XBeeProSB2 and PWM output and Java

XBeeProSB2 and PWM output and Java

0 votes
On a remote device I want to output a PWM signal from P0 on a XBee Por SB2.
Is it ever possible? here's my configuration

XCTU reports
P0 = 1 RSSI PWM OUTPUT
P1 = 0
P2 = 0

Here are the main lines
private static final IOLine DEV1_PWM1 = IOLine.DIO10_PWM0;
remoteDevice1.setIOConfiguration(DEV1_PWM1_OUT, IOMode.PWM);
/* Here I get
com.digi.xbee.api.exceptions.ATCommandException: There was a problem sending the AT command packet. > Invalid parameter
*/

int iDutyCycle = 35;
remoteDevice1.setPWMDutyCycle(DEV1_PWM1, iDutyCycle);

Thanks in advance to any one answering
asked Mar 17, 2016 in ZigBee PRO Featureset (and legacy ZNet 2.5) by giumbolo New to the Community (1 point)
having the same issue.  you ever find a fix for this?

Please log in or register to answer this question.

2 Answers

0 votes
No, the modules firmware does not support the use of the other PWM pins.
answered Mar 17, 2016 by mvut Veteran of the Digi Community (11,300 points)
can you expound on this answer?  I am having the same issue.  

Everything looks good going in -
                            System.out.println(ioLine.getName() + " PWM Compatibility:  " + ioLine.hasPWMCapability());

Prints out this line - DIO11/PWM1 PWM Compatibility:  true
                            System.out.println(ioLine.getPWMDutyCycleATCommand());

Prints out this line - M1

IOMode ioMode = XBeeDeviceProperties.getIOMode(pin.getPinIOConfiguration().getPinIOMode());

double dc = pin.getPinIOConfiguration().getPinDutyCycle();    remoteXbee.setIOConfiguration(ioLine, ioMode);
                            remoteXbee.setPWMDutyCycle(ioLine, 0);
Are you using a programmable XBee module or some other? What is the part number of the module you are working with and what firmware version is installed in it?
I am using XB24-ZB. Series 2. The function set is ZigBee Router API and firmware version is 23A7.

I am able to use setDIOValue on the other ports I am using.
Do you mean that you are setting the D0 command to a value of (2) ADC, (3) Digital Input, (4) Digital out low or (5) Digital out high?
I am saying that what I have done with the DIO pins works.  When I try to call any function on the PWM pin (setIOConfiguration(DIO11/PWM1, PWM output) or setPWMDutyCycle(DIO11/PWM1, 50)), I get the error -
com.digi.xbee.api.exceptions.ATCommandException: com.digi.xbee.api.exceptions.ATCommandException: There was a problem sending the AT command packet. > Invalid command
    at com.digi.xbee.api.AbstractXBeeDevice.checkATCommandResponseIsValid(AbstractXBeeDevice.java:1812)
    at com.digi.xbee.api.AbstractXBeeDevice.sendParameter(AbstractXBeeDevice.java:2059)
    at com.digi.xbee.api.AbstractXBeeDevice.setParameter(AbstractXBeeDevice.java:1972)
    at com.digi.xbee.api.AbstractXBeeDevice.setPWMDutyCycle(AbstractXBeeDevice.java:1455)
That is because the commands you are trying to use do not exists on the radios firmware.  That is the radio that you are using does not support that function.  The PWM can only be set for RSSI output on that radio.
The docs say this can be done - https://docs.digi.com/display/XBJLIB/Configure+the+IO+lines

When I call hasPWMCapability() on the pin (DIO10/PWM0 or DIO11/PWM1)I get a true.

I am looking for a way to send a variable voltage (or signal) out of a pin and be able to control that voltage (or signal) from the api.



Not sure I understand what you are saying.  I have the option in XTCU to set port DIO10 to RSSI PWM OUTPUT and I still get the error.

XBeeCoordinator: setUpDevices: PWM: DIO10/PWM0
XBeeCoordinator: setUpDevices: PWM: PWM output
XBeeCoordinator: setUpDevices: PWM: 50
#######################
com.digi.xbee.api.exceptions.ATCommandException: There was a problem sending the AT command packet. > Invalid command
    at com.digi.xbee.api.AbstractXBeeDevice.checkATCommandResponseIsValid(AbstractXBeeDevice.java:1812)
    at com.digi.xbee.api.AbstractXBeeDevice.sendParameter(AbstractXBeeDevice.java:2059)
    at com.digi.xbee.api.AbstractXBeeDevice.setParameter(AbstractXBeeDevice.java:1972)
    at com.digi.xbee.api.AbstractXBeeDevice.setPWMDutyCycle(AbstractXBeeDevice.java:1455)
You are reading the wrong manual.  That manual is for the Java script.  You need to read the manual for the XBee module also to see if it supports these functions.  In this case, the XBee does not.
0 votes
By "the other PWM pins", do you mean that I can use the pin referred by P0?

So, even changing firmware, on a xBee ProS2 I can only use one or zero PWM pins?

Thanks for your answer, but I need to fully understand the limits of this hardware.
answered Mar 17, 2016 by giumbolo New to the Community (1 point)
The firmware that is from Digi Does not allow you to control the two other PWM pins.  It only allows you to use the PWM for RSSI.
...