Shop OBEX P1 Docs P2 Docs Learn Events
Serial Data interface — Parallax Forums

Serial Data interface

dodgerdodger Posts: 37
edited 2009-03-13 03:09 in Propeller 1
Anyone know how to interface a serial data input to the propeller mc?


Thanks

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-02-15 04:27
    see the object exchange for "FullDuplexSerial" (presuming you mean software interface).
    If you mean hardware, search the forum using the search link in my address below.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps (SixBladeProp)
    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz
  • dodgerdodger Posts: 37
    edited 2009-02-15 04:30
    I should be more clear. I would like to interface a serial output from a torque sensor to the propller mc. I dont have many specifics about the baud and data bits yet, but im just gathering info at the moment.

    Thanks,
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2009-02-15 10:23
    I've had many dynos, but I have never heard of a torque sensor that uses a serial protocol?

    Maybe you should digg a bit more first
  • InSilicoInSilico Posts: 52
    edited 2009-02-15 10:24
    make sure you get information whether this is I2C, SPI (3-wire or 4-wire), RS232, or PWM or number of pulses/sec, etc., then you can select the proper propeller object for the job. the datasheet for your torque sensor should give you a very detailed description of its serial interface.

    or it may not even have a serial interface like Capt. Quirk said -·it might give you·perhaps·1 millivolt/Newton-Meter or something. In this case you need an ADC of some sort. Again, the datasheet will give you this information.

    hope this helps!

    Post Edited (InSilico) : 2/15/2009 10:30:25 AM GMT
  • dodgerdodger Posts: 37
    edited 2009-02-15 16:19
    The torque sensor that was given to me has no documentation, no data sheet, make or model. The torque sensor is sealed in a water tight enclosure so i cant look inside to get more info. There are 5 wires comming out of the box 2 that are power and a white gray and black wire, which i assume are data out. I was only told that the output is a serial output. I am posting this in case someone has any ideas on figuring out what the outputs might be. A shot in the dark but maybe someone has encountered something similar in the past.
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-02-15 17:20
    Hello Dodger,

    hm - to say it positive - this is a really challenging situation.

    OK my first approach would be to connect the sensor to an oscilloscope and watch the voltage level comimg out of the wires.
    Therefrom you can get some basic information like voltage-level at all and pulse-length to get an idea what the baudrate might be.

    Of course you can do some shots from the hip connecting the sensor to a RS232-interface
    switching through all baudrates number of startbits, parity-modes, no of databits, no of stopbits, inverted mode on rx and/or tx
    hardware-flow-control and softwareflow-control
    As you can see from this parameterlist quite a lot of variations just for RS232

    Then do the same with SPI and I2C

    a complete different approach: try google picture-search to find a picture of the sensor

    I think this sensor was NOT falling out of the sky. There must be some information about
    where this sensor was used before or who worked with the same or similar sensors.

    It is used in connection with some kind of object. What kind of object ? Maybe someone working with
    this kind of objects knows more about this sensor

    Another approach: what is the cost of another sensor that would do the same thing?
    In relation to the COMPLETE project-budget ?
    What only 0,5 percent ?
    Plug this f... sensor into the .... of the man that told you to use this sensor and order the other sensor
    with complete documentation !

    best regards

    Stefan
  • InSilicoInSilico Posts: 52
    edited 2009-02-17 00:02
    Who told you it was a serial interface? Maybe you can get some more information out of this person.

    Can you crack open this watertight enclosure? Then you can take a look inside and find a part number. You can always get a new enclosure if you need it.
  • dodgerdodger Posts: 37
    edited 2009-02-21 00:45
    Ok after some research i have found the information on the serial data.·

    9600 baud, no parity, 8bit, 1 stop bit, no flow

    There are 3 wires a tx, rcv, and gnd

    I would like to interface it with the propeller mc

    ·
  • JasonDorieJasonDorie Posts: 1,930
    edited 2009-02-21 03:08
    The FullDuplexSerial object will handle the software side.

    If the signal is 3.3V, you should be able to just connect tx/rx to any two pins on the Prop and tell the FullDuplexSerial object which pins.

    If it's more than 3.3V (normal serial is 12V), you'll need a level shifter, like a MAX3232 to handle the voltage conversion between the two.· It's not difficult, and only needs a few extra parts.· You could go this route too:· http://www.parallax.com/tabid/254/Default.aspx· It's a few resistors, a cap, and three transistors.

    Jason
  • dodgerdodger Posts: 37
    edited 2009-03-10 23:12
    Looking for some help on the full duplex serial object.

    Anyone know where to find more information on the full duplex object. I am trying to connect the serial torque sensor mentionioned above to the propeller. I just need to request the torque sensor to output its measurement. This is done by sending the ASC11 for D. Then I want to store the information on an SD card. I am having some trouble fine tuning the Fullduplex serial object. Any dummies guide to full dulplex serial out there.

    thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-10 23:17
    The demo code that comes with FullDuplexSerial and the comments in the source code·are pretty much it in terms of documentation.· It would help if you asked specific questions, like "how do I do X?"
  • WNedWNed Posts: 157
    edited 2009-03-11 15:41
    "RTFM" - Have you read any part of the Propeller Manual?
    After you have worked your way through the tutorials in the manual, you will be able to use all of the basic Propeller objects.
    It will take far less time to do that than it has already taken you to run these posts in the forum.
    I don't say this to be mean. It is something I had to tell myself at one point, and it has paid off.
    Or, as the old saying goes... teach yourself to fish, and you won't have to wait for fish to be tossed onto a forum page. You may have heard it put differently...

    Edit: Hardware often gets overlooked in favor of a software fix... 'cause it's easier to type software... Verify your basic hardware setup by reviewing "HOW TO SAFELY INTERFACE A 5V SIGNAL TO THE PROPELLER?", and "Computer guy's hardware guide for the beginner" in the Propeller Hardware Stickies on this forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "They may have computers, and other weapons of mass destruction." - Janet Reno

    Post Edited (WNed) : 3/11/2009 3:59:20 PM GMT
  • dodgerdodger Posts: 37
    edited 2009-03-12 16:33
    Heres what I have so far. I always have an output of zero, not sure why. I know that I probably need to delcare the number of bits and parity somewhere but not sure where. My goal for now is just to see a video output of what the propeller is recieiveing.· The device I am using needs to recieve a "D" (ASCII 68) to output its data.· I am trying to use tx(68) to trigger the device to output, not sure if this is the right command.·

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    OBJ
    SER : "FullDuplexSerial"
    TV : "TV_Terminal"
    Num : "Numbers"
    PUB Main
    Repeat 10
    Num.init
    TV. Start(12)
    TV.str(string("trial"))
    TV.out(13)
    SER.start (17,16,3,9600)
    SER.rxflush
    SER.tx(68)
    SER.rx
    TV.str(Num.ToStr(SER.rx, Num#DEC))
    TV.out(13)
    TV.str(string("trial2"))
    SER.tx(68)


    Could anyone tell me where I am going wrong/

    Thanks

    Post Edited (dodger) : 3/12/2009 4:42:02 PM GMT
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2009-03-13 01:57
    This is probably going against the protocol of the forum but maybe you should start with a stamp processor to do your discovery on the sensor. I've got to be honest, it's a pretty long steep learning curve from where you are to where you want to be.
    With a stamp, at least the minutia of the protocol is taken care of in a single command. You can do all sorts of serial protocols with a single line of code and be sure the stamp is kicking out the right signals.
    This would at least allow you some certainty in putting the problem on the sensor side of the equation. The migration to the prop would not be quite as challenging once you have some predictability with the sensor and understand it's personality.
    Jim-

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When your problem seems insurmountable, read the forum for a while.
    Solve someone else's problems and yours won't seem so bad.
  • dodgerdodger Posts: 37
    edited 2009-03-13 03:09
    Thanks for all the help so far. I've only had the propeller chip for about four days, so im not quite ready to give up on it yet, thanks for the advice thou. I'm sure i'll figure out.
Sign In or Register to comment.