Shop OBEX P1 Docs P2 Docs Learn Events
transciever help — Parallax Forums

transciever help

damiondamion Posts: 39
edited 2005-12-18 05:07 in General Discussion
hello hello, I just got·two transcievers and I'm wondering if anyone has any experiance interfacing these with the bs2p. I'm using the bs2p with aerocomm ac4790 transcievers. So far I've been able to transmit with the transciever still connected to the aerocomm development board, but I'm having difficulty transmitting with the transciever wired by itself to the bs2p. If I understand correctly then I should only need three wires for simple transmission. I have vdd,vss and rxd. Also the rxd on the transciever can be wired to any of the I/O pins, is that right? thanks.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-14 20:52
    VDD, VSS, and RD -- if it's only to be a receiver.·

    I'm not sure that the STAMP supplied +5V ( VDD ) is sufficient.· This is a recurrent concern.·

    RD (RXD) can be used by any PIN so long as it's programmed for SERIN (TXD - transmitted data should be connected to a PIN programmed for SEROUT.)
  • damiondamion Posts: 39
    edited 2005-12-14 21:32
    I think I just got a little more confused. I'm using the bs2p in conjunction with the transciever to transmit data. So I was under the impression that the output information from the bs2p was going into the tranmitter·on the pin designated rxd on the transmitter.·I'm using serout to·send data to the transmitter.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-14 22:31
    Well, it seems to me that data into the XCVR should be·applied to·its TD/TXD Pin and that data from the XCVR should be applied to·its RD/RXD Pin.
  • damiondamion Posts: 39
    edited 2005-12-15 01:26
    Originally that's what I figured, but I read in the instructions that pin 3 on the transciever is rxd and is labled as an input and txd is output. So since data is leaving the bs2p and going in to the transciever wouldn't it go to output.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-15 02:19
    I'd figure this device should be seen as a modem (DCE) and that your STAMP. or whatever it's connected to, should be a Terminal (DTE.)· Looking at the datasheet it describes the Pins:
    2 TXD Transmitted data out of the receiver
    3 RXD Data input to the transceiver
    ... and that's just wrong -- a Terminal's TD [noparse][[/noparse]out] should go to the Comm's TD [noparse][[/noparse]in]·and likewise with the RD.·
    But, anyways, Oh well.·
    I think that it may be the hand-shaking lines: pin 7, /CTS, should·be made·LO when you are to transmit data and pin 8, /RTS, should be HI.· When you are ready to receive data from the modem then /CTS should go HI and /RTS should be sent LO.· Ordinarily, when a Computer (Terminal) wants to talk, then it asserts the RTS (Request to Send -- "I Request to Send Data, modem"); when it's ready to listen, then it asserts CTS ("Modem, you are Clear to Send me data").

    How are you testing this?· How do you know that you are/aren't sending data, anyway?

    The datasheet says there are sections 4.10.3 & 4.10.4, but I don't see them at all.· There's a brief explanation on 18 of 51 (of the PDF):
    "Hardware flow control is called so because the control is handled by the hardware. That is, the circuitry design is such that when the transceiver is ready to receive data, it sends a Clear to Send signal to the device on the other end (?). On the other hand, when a transceiver has something it wants to send, it sends a Ready to Send, and waits for a CTS to come back its way. (?)"
    Now, that is Sick & Twisted, and Totally Wrong, on so many Levels (it's backwards, I guess that's how it is.)
  • Robert@HCCRobert@HCC Posts: 80
    edited 2005-12-15 10:39
    /waves @ Damion

    This from the manual:

    " CTS : Clear to Send – Active Low when the transceiver is ready to accept data for transmission.

    RTS : Request to Send – When enabled in EEPROM, the OEM Host can take this High when it is not ready
    to accept data from the transceiver. NOTE: Keeping RTS High for too long can cause data loss."

    Good feedback, PJ-thanks! kinda confirms my own thoughts on CTS/RTS and how to set the pins.
    PJ Allen said...
    The datasheet says there are sections 4.10.3 & 4.10.4, but I don't see them at all
    That threw me too - the info is actually at 2.10.3 and 2.10.4 on page 24



    Sorry if this is a ..err..stupid question - we are using the Aerocomm 4790-1000 modules. if these modules only send/accept 3.3v TTL , does this need to be converted to something else to be accepted by the BS2 ( not the 2p, only Damion is using that) or will it work at 3.3v levels?
    see below:

    "Serial TTL
    The AC4790-200 accepts 3.3 or 5VDC TTL level asynchronous serial data on the RXD pin and
    interprets that data as either Command Data or Transmit Data. Data is sent from the transceiver, at
    3.3V levels, to the OEM Host via the TXD pin. The AC4790-1000 transceiver ONLY accepts 3.3V level
    signals."


    Alohas,
    Robert Allen tongue.gif

    Post Edited (Robert@HCC) : 12/15/2005 10:42:54 AM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-15 13:02
    I didn't see that about the 3V logic (focussing like a laser beam.)

    I suppose that you might need a 5V to 3V converter.· Here's a circuit, for the STAMP out to the XCVR in.· You'll need a 3V to 5V converter for data back from the XCVR.
    272 x 241 - 7K
  • Robert@HCCRobert@HCC Posts: 80
    edited 2005-12-15 20:15
    Thanks PJ!
    PJ said...
    VDD, VSS, and RD -- if it's only to be a receiver.

    I'm not sure that the STAMP supplied +5V ( VDD ) is sufficient. This is a recurrent concern.

    Damion, dont forget that the Aerocomm 4790-1000 is powered by 3.3v. It would also be better (and probably safer) to use VIN instead of VSS, with a 3.3v regulator. We are using the LM7833, which we purchased from www.sparkfun.com when we got our GPS module there. You can input the 9v from VIN and get 3.3v out to power the RF.

    Aloha
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-15 21:31
    Here's a 3V to 5V converter (inverting amplifier).
    The· 5V to 3V is an inverting amplifier, too, as I'm sure you gather.
    [noparse][[/noparse]adjust the STAMP serin/serout parameters accordingly.]

    I did a project for work where I am using a couple of 900MHz XCVRs linking two STAMPS.· I posted it in the Projects forum ( http://forums.parallax.com/showpost.php?p=0 ) and there's a ZIP file with my documentation, which you may find of some value.· I used MAX233s between the STAMPs and the XCVRs, which you won't need, but I did decide to use RTS, so you could see in my program, "host_prj.bs1", how I implemented that.
    314 x 241 - 8K
  • damiondamion Posts: 39
    edited 2005-12-16 02:00
    So if I'm to understand correctly then I need to hook up these cts and rts pins.

    Ok then I'm suppose to turn them on how? By asserting the pin either high or low as appropriate? I think that almost makes sense.

    Thanks for all the help, that actually makes sense about the three volt regulater.
  • damiondamion Posts: 39
    edited 2005-12-16 02:40
    Ok so pj, I looked at the code from your project that you referred to and it definately cleared some things up. But do I need to use both cts and rts in conjuntion or seperately?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-16 03:04
    You Got It, D.

    How? By HI or LO as appropriate?· -- Yes.

    A·STAMP Pin (OUT)·needs to be dedicated as a Control line = /CTS, because the XCVR wants you to take /CTS (for some reason) LO·to "broadcast" your data stream.· You may not need to care about the /RTS line, because the STAMP doesn't require it, or any other hand-shaking (that's your call, you can make it need to get the /RTS signal.)

    Their "convention" almost makes 1/2 sense if one is to figure they reckon the XCVR is a Terminal, too (i.e. that you should Null-Modem between a STAMP or Computer and them; very strange.)

    attachment.php?attachmentid=39802

    [noparse][[/noparse] I think a XCVR is a·modem. ]
    300 x 251 - 10K
  • Robert@HCCRobert@HCC Posts: 80
    edited 2005-12-16 04:39
    Thanks for all the info, PJ! Damion and I are at two different branches of the University of Hawaii Community colleges system, working on the same project ( mini-satellite, or CanSat) Speaking for myself mostly ( and I am sure Damion feels the same) I greatly appreciate the time and patience you have devoted to helping us newbs :P

    Damion, you can actually leave the /RTS disabled, the data will transmit by default - however, the data will be transmitted as soon as it is recieved by the module. I think this may mean problems ( data loss because the stamp cannot keep up?). Just remember that /RTS is disabled by default in the modules EEPROM, and needs to be enabled in the modules EEPROM. I believe you can do that with the Aerocomm software. In fact, I believe there is a check box in the configuration tab.

    If I understand right from PJ's responses, aside from the tx/rx pins you connect from the stamp to the rf module, you also need to connect a pin from the stamp to the /CTS pin on the module, and the same for /RTS if it is used. Then, take each pin ( /CTS and /RTS) HIGH or LOW as appropiate in your code.

    Also, in between either the tx or rx connection ( between the stamp pin and module pin) the circuits ( 3.3v logic to 5v, and 5v logic to 3.3v) PJ posted needs to be setup. This is because the RF module sends( and recieves) data at 3.3v TTL, while the stamp uses 5v TTL.

    So - send data from the BS2 @ 5v, into the 5v-3.3v inverter circuit which will output a 3.3v signal to the RF module. On the host side, this conversion is not needed ( at the computer - the dev board will handle it, if I understand correctly.

    If you are sending a signal (data) from the module to the BS2: 3.3v from the module, into the 3.3v -5v inverter circuit, which outputs the signal at 5v for reciving by the BS2.

    Post Edited (Robert@HCC) : 12/16/2005 4:48:56 AM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-16 13:19
    R & D,

    · So far as receiving data goes, you should look into using formatting (it's in HELP with SERIN and SEROUT), like in the examples in my "remote" program, where it sits and waits for a particular data (like a "header") before it starts accepting or otherwise taking notice of any further data.· To me, it's better than waiting for a hand-shake.

    · ** Something else that I've done in past is just jumper RTS to CTS. **


    Post Edited (PJ Allen) : 12/16/2005 3:04:20 PM GMT
  • Robert@HCCRobert@HCC Posts: 80
    edited 2005-12-17 00:09
    PJ said...
    Here's a 3V to 5V converter (inverting amplifier).
    The 5V to 3V is an inverting amplifier, too, as I'm sure you gather.
    [noparse][[/noparse]adjust the STAMP serin/serout parameters accordingly.]
    PJ,

    If I may trouble you with one further question .....

    In the post quoted above, could you explain a bit more (if it is not to involved for a forum post) the statement "adjust the STAMP serin/serout parameters accordingly" ?
    Alternatively, if the info is documented, can you point me to the area of the manual where it is covered? Took a look, but still learning here, and have so much info in my brain it is quite full turn.gif

    ahhhh but discovery and new knowledge is a wonderful thing ! smilewinkgrin.gif

    Thanks,
    Robert
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-17 16:22
    Yep, by accordingly, I was alluding to the two data/logic forms that SERIN and SEROUT need to know about, whether the data is "true" or "inverted", so that it knows "what's what" (or --·"is a '1' a HI or a LO"?)· That's covered by the Baudmode parameter (which is a combination of: true or inverted data/logic, baud rate, # of data bits, parity used.)
    While typing away, I got to figuring:·we can·invert the inverter (because I love transistors) and make this·true/inverted matter·a non-issue, especially since you guys are learning two things at once (STAMPs and Aerocomm.)·
    So, here's a circuit whose output polarity will match its input, HI 5V in gives HI 3V out·(see attachment.)··Use the·2N3904 (or 2N2222, MPS2222, etc.) --·any "switching" transistor will suffice.

    Maybe consider rigging this up connected to a STAMP doing a PULSOUT routine/loop, get dialed-in with the basics.
    
    
    DIRS = $0F
    OUTL = %00000100  'preset OUTs; P2=1; P1,0 = 0
    

    Ausgang:
       PULSOUT 0,50        'hit /MR ( /RESET )
       PAUSE 100
       GOTO Ausgang
    




    Post Edited (PJ Allen) : 12/17/2005 4:36:17 PM GMT
    642 x 470 - 26K
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-12-17 21:49
    Here is a schematic that allows for bi-directional data between 3.3V and 5V.

    Note: The diode is optional and when used, closer resembles the output from the
    two transistor version PJ Allen posted. This circuit will work in both directions, because
    of the threshold voltage level of the Stamp being 1.4V. When 3.3V is applied to the
    circuit ( between the two resistors) the output ( 2.2K resistor) should still be 3.3V .
    Since 3.3V is greater than the 1.4V threshold, the Stamp "sees" this as a HIGH.



    
    DATA DIRECTION  5V ----> 3.3V
    
    
             2.2K         3.9K
    +5V >----/\/\----o----/\/\----> GND
                     |
                     |
                     o------------> +3.19V
    
    or...
    
                 2.2K         3.9K
    +5V >---o----/\/\----o----/\/\----> GND
            |            |
            |   diode    |
            o-----|<-----o------------> +3.19V
    
    
    
    
    DATA DIRECTION  5V <---- 3.3V
    
    
               2.2K         3.9K
    +3.3V <----/\/\----o----/\/\----> GND
                       |
                       |
                       o------------< 3.3V
    
    or
    
                   2.2K         3.9K
    +3.3V <---o----/\/\----o----/\/\----> GND
              |            |
              |   diode    |
              o-----|<-----o------------< +3.3V
    
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Robert@HCCRobert@HCC Posts: 80
    edited 2005-12-18 05:07
    Wow!
    great info here!

    Thank for clearing that up for me ,PJ - I belive I understand now.
    As for learning two things -lol! Actually, I am working with the aerocomm modules, a memesic acc., sensirion temp/humd. sensor and a trimble lassen IQ GPS module - while learning the stamp and PBASIC along the way. Got the sensors working fine in debug window using debug command and serin/out. The RF is the real challenge, once that is done, the GPS stuff will fall into place as well, as it presents similiar problems to the RF. Working on trying to fit a pressure sensor and EEPROM for datalogging as well - we will see if I run out of variable space first! In addition, I am spending this weekend ( well since thursday) working my way through I2C with the BS2 - with mixed but fairly satisfingresults, with some great "AHA" moments [noparse]:D[/noparse] that make the research more than worth the time I put into it. Hvaing the time of my life, to tell the truth!

    I am going to try out both of those circuits on monday when our team meets - although I confess that I am partial to the simplicity and the bidirectional feature of Beau's circuit - but would like to play with some transistors to get some knowledge in that area as well. Our design is very "space-challenged" - not alot of room in a 12oz soda can, so that is a major consideration, and simplicity is a real plus for us newbs, lol... Its real nice to have so many options though!

    Thank you PJ, and Thank you Beau - people such as yourselves who give so freely of your time patience and knowledge make this journey of discovery a true pleasure ... and perhaps a bit less painful! [noparse]:D[/noparse]

    Aloha,
    Robert
Sign In or Register to comment.