I need to send an API frame from MATLAB through my base XBee connected via USB to my PC, to a remote Xbee and get a PWM ouput on my remote xbee with the value sent form MATLAB, so far I tried this radio configuration with no luck:
BASE
ATID 3456
ATMY 1
ATDL 2
ATAP 1
ATIT 5
ATWR
REMOTE
ATID 3456
ATMY 2
ATDL 1
ATP0 2
ATAP 1
ATIA 1
ATWR
Any inputs, ideas, codes for MATLAB, etc, on how to solve this problem I would apreciate it greatly.
PS: English is my second language so please excuse any typing mistakes.
XBee API frames are a bit tricky to get correct. If one bit is wrong and the Checksum doesn’t match then the frame is silently ignored.
Study the XBee Document on the XBee module you are using (downloaded from Digi Int’s web site). Then do some googling on XBee API frames for additional information.
As for MATLAB, you just need to put all of the bytes that make up an API frame into a buffer then send the buffer contents to the COMM Port (USB virtual COMM).
I studied the xbee document and sent a frame form X-CTU form my base xbee to my remote xbee but I still can’t get a PWM ouput, I know the frame I sent is built ok because each time I send it I get a frame back that tells me the transmission was succesful, but aparently the value sent is going out the UART, and I want it to go out as a PWM output.
I configured pin 6 on my remote xbee to be a PWM output, can you help me on this matter, I just can’t get it to work, I really need some hints.
Does de PWM output only works when an analog signal is sent from the other xbee?
I tired what you suggested about the digital outputs but nothing, I don’t know what I’m doing wrong, and I’m starting to believe that the PWM output can only be acquired if I’m sending an Analog input from the other side, since everywhere I read that’s the only use it is given. , I really need that Output, what else should I try?
By the way, thanks so much for your replies until now.
Actually, to set a register on the remote xbee you need to use API identifier 0x17 (Remote AT command request). I have it on page 59 of the manual. API identifier 0x01 sends the payload data out to the remote XBee into it’s UART(buffer) to output on the Dout pin.