Shop OBEX P1 Docs P2 Docs Learn Events
Sleep with adapter Board. — Parallax Forums

Sleep with adapter Board.

si8si8 Posts: 20
edited 2012-03-25 20:44 in Accessories
Hi,
I am using xbee adapter board wired up as showen as in "Getting started with xbee RF modules" i have also place an additional connection from PIN 9 to DTR so that can control when it sleeps.
But for some reason i cant get it to goto sleep.
I have used the exact same code with an SIP adapter which seems to work fine.
Is there something i am missing?

thank you,
Si
'DEBUG CLS, "Configuring XBee..."  PAUSE 2000 ' Guard time for command sequence
  SEROUT TX,Baud,["+++"] ' Enter command mode
  PAUSE 2000 ' Guard time for command sequence


  SEROUT TX,Baud,["ATNI XBee API TX",CR, ' Set description
                  "ATMY ", HEX 2,CR, ' Set node address
                  "ATDL ", HEX 1,CR, ' Set destination node address
                  "ATD6 1",CR, ' Use RTS for flow control
                  "ATAP 2",CR,' API with escape characters
                  "ATSM 1",CR, 
                  "ATCN",CR] ' Exit command mode
  PAUSE 2000












Main:
  DO
    LOW 9
    PAUSE 50
    GOSUB SHT_Measure_Temp
    GOSUB SHT_Measure_Humidity:
    GOSUB XBeeTx16
    PAUSE 500
    HIGH 9
    PAUSE 100
    SLEEP 3
  LOOP


'  GOTO main
  END

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2012-03-19 20:43
    Hi Si,
    While writing the XBee text, I had problems getting sleep and RTS to work at the same time. There's a note of caution on page 102. Other than possibly the buffer is not fully empty allowing it to enter sleep mode, I don't have an answer or solution. You say it did work in a different configuration with the same code? Interesting. keep us posted please if you learn anything new.

    Martin Hebel
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2012-03-19 22:45
    Si,
    Is it the Parallax #32401 "5V/3.3V adapter board"? If so, the DTR pin 9 on the XBee is not safeguarded to 5V. That is different from the #32402 SIP adapter, which does have voltage translation for DTR.

    When your program drives that pin high from the Stamp it may be stressing it. I don't know for sure, but that might explain why it does not go to sleep.

    By default the XBee itself has an internal pullup resistor on that pin. Put one LOW 9 in the initialization section of your program, and then use this sequence to alternate between wake and sleep...
    [SIZE=1][FONT=courier new]OUTPUT 9   ' XBee pin low, wakes
    ' do stuff
    INPUT 9   ' XBee pin is pulled high by its own pullup resistor, sleeps.[/FONT][/SIZE]
    
    Worth a try anyway. See the ATPR command to read about the pullup resistors.
  • si8si8 Posts: 20
    edited 2012-03-20 05:28
    On a complete side note, can you use a USB adapter board as a 5V/3.3V adapter board?
  • si8si8 Posts: 20
    edited 2012-03-20 06:26
    Tracy, thank you again

    I am using #32403
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2012-03-20 08:59
    This is with a BASIC Stamp, right, judging by your program code. The #32403 is a straight-thru adapter for the Propeller, and it provides nothing in the way of 5v/3.3V shifting. So, with a Stamp, it is definitely stressed.

    The #32401 provides level shifting for the data input and RTS lines, but not for the DTR sleep line, and the SIP adapter 32402 is the one provides level shifting for 7 signal lines, including DTR/Sleep.

    The #32400 is only for USB, to plug into your PC and powered by it, not for use with Stamp or Prop.
  • si8si8 Posts: 20
    edited 2012-03-20 09:53
    Can this cause problems with the xbee?
    I have recently noticed that mine is heating up and when i try it in a SIP adapter nothing happens. (I think i have blowen it :S )
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2012-03-20 10:49
    If it had been powered from 5V, that could be a sad end. :zombie: :sick:
  • si8si8 Posts: 20
    edited 2012-03-20 11:13
    Oh well, at least it give me the chance to get an extra SIP adapter at the same time!
    All problems solved :smile:

    Thank again for the help.
  • FalconFalcon Posts: 191
    edited 2012-03-25 15:00
    Tracy,
    I see the following WARNING (!) on page 18 of the Getting Started with XBee RF Modules tutorial, Version 1.0 (Web Release 2) begins the section describing the XBee 5V/3.3V Adapter Board:
    This section pertains to the XBee 5V/3.3V Adapter Board Rev A. The Rev B board in development will have
    I/O buffering and LED configurations similar to the XBee SIP Adapter discussed later in this chapter.
    Schematics for these boards are available from their product pages at www.parallax.com.


    The XBee SIP Adapter description on page 20 includes the following information regarding the buffering which addresses the DTR pin specifically:
    The XBee SIP Adapter has features similar to the 5V/3.3V Adapter Board, but conditions more I/O
    and provides on-board Tx and Rx LEDs. As shown in Figure 2-3, the adapter has 5 V to 3.3 V
    buffering for the following inputs: DIN, RTS, DTR/Sleep_RQ.

    I have the Rev B XBee 5V/3.3V Adapter Board so should I assume this board has the buffering similar to the SIP Adapter for the DTR pin?


    Question:


    How can I verify that the XBee is actually in SLEEP mode?

    I used your suggestion above. My XBee should only transmit 3 bytes about every 15 seconds. I have the following LED statuses:

    Blue - solid (does not change)
    Yellow - solid (does not change)
    Green - Blinking
    Red - On every ~15 seconds when the 3 bytes are transmitted

    These statuses are the same as before I added the SLEEP code.

    I currently have the BS2 I/O pin connected directly to the XBee 5V/3.3V Adapter Board DTR pin 10. The XBee transmits as it should and exhibits no problems.

    falcon
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2012-03-25 20:44
    I don't have the schematic in front of me. Parallax usually provides a schematic of the circuit, found in the instructions or as a separate pdf on the product page, and that is what I would want to find as a primary reference to answer this question. I don't have the adapter board in question and do not know the colors of leds and what they mean.

    Pin 13 on the XBee goes low when the XBee is in sleep mode, and it is high in normal mode. Another good way to know it is in sleep mode is to monitior its power supply current, about 50mA awake, about 10µA asleep. That is for the XBee itslelf, apart from voltage regulators and leds and whatnot.
Sign In or Register to comment.