Shop OBEX P1 Docs P2 Docs Learn Events
Need help on Stamp controlled robosapiens V2 by IR — Parallax Forums

Need help on Stamp controlled robosapiens V2 by IR

seconikaseconika Posts: 18
edited 2007-01-14 03:16 in Robotics
I need help on how to solve this.
I would like to send IR codes to my Robosapiens V2 from my BS2p (40 pin)

As I understand it, I need to have a external cirquet that modulate the IR Carrier to 39.2kHz.
I was thinking NE555 IC ?

Then to the bigger problem !!
How to fix this ??

*****·· From a web page· ****
http://www.aibohack.com/robosap/ir_codes_v2.htm
****************************

The V2 modulation scheme is similar to the RoboSapien V1 IR Codes. The IR Carrier is 39.2kHz. Data is modulated using a space coded signal with 12 data bits (data clock is 1200Hz, but actual data rate varies depending on the data). The V1 format is 8 data bits. I suspect the RoboRaptor and RoboPet use a similar encoding (with a different prefix)

For modulating the signals yourself, the signal looks something like this: Timing based on 1/1200 second clock (~.833ms)Signal is normally high (idle, no IR).Start: signal goes low for 8/1200 sec.Data bits: for each of 12 data bits, space encoded signal depending on bit value Sends the most significant data bit first If the data bit is 0: signal goes high for 1/1200 sec, and low for 1/1200 sec. If the data bit is 1: signal goes high for 4/1200 sec, and low for 1/1200 sec. BTW: the first 4 bits are always "0011" for the Robosapien V2 ("0001" for Roboraptor and "0010" for Robopet)When completed, signal goes high again.No explicit stop bit. Minimal between signals is not known.***********************************************************************
************************************************************************·More info on the link above.Is there anyone here that can give me a hand ???Best regardsNiklas

Comments

  • AImanAIman Posts: 531
    edited 2007-01-08 03:08
    Don't know that I can give you a direct answer but I can tell you somethings from other experience. If this is basic for you its not meant as an offense.

    Whenever you are trying to get different computer things to talk all it takes is a very minor slip in the code and nothing works. For example, when Extra Basic talks to VBA you have to set·Session, Sess0 and System·as·objects or you can't work things out. If Sess0 becomes a typo of SessO it won't work (one ends in zero one ends in o). So if you are trying to splice two different anything together in a computer you need to be 100% positive that it will work and then question it a few more times.

    In short, review what you have for the code identifying the two and if you can't see anything wrong with it try posting it in the sandbox and see what people will say. My guess is there is some very minor detail missing.
  • seconikaseconika Posts: 18
    edited 2007-01-10 10:26
    Hi there,

    Thank you for the support, but my troubble is more related towards the IR out programming.
    I dont get hang of how to send the codes via IR.

    The hardware is no problem, Im sending serial data to my PC from my Robotnova with standard serialout command. But here there are more to unerstand to get it working.

    How do I set upp the timing for the startbit and how do I do the "1" and "0" with· space between like explained on the webpage.

    Can anyone help me ?cry.gif
    Thank you very much,
    Niklas
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-01-10 14:35
    Were I to do something like this with a BS2:

    1. You need a 555-based circuit with an IR-LED, tuned to 39.5 Khz when active. There's NutsAndVolts on how to do this.

    2. You then activate the circuit using the "PULSOUT P555, 416" -- Since on the BS2, the PULSOUT command is in 2 uSec 'ticks', 416 'ticks' == 833 uSecs

    3. I'd then put an IR-Decoder looking at this signal, and make sure the output of the IR-Decoder matched the pulses I was putting out.

    4. I'd then write a subroutine to take in 8 bits, and properly format them as a RoboSapien "Message". Which would probably look something like:

    PulseTicks CON 1082· ' 1082 * 0.8 uSec == 866 uSec for BS2p

    RoboSend: ' ( RoboData )
    PULSOUT P555, 8*PulseTicks ' Output 'start' bit
    FOR I = 1 to 8
    CurBit = RobotData.Bit8
    IF CurBit = 1 THEN
    SendOne
    ELSE
    SendZero
    ENDIF
    RobotData << 1
    NEXT
    RETURN

    SendOne:
    PULSOUT IdlePin, PulseTicks ' Give 'silence' on IR
    PULSOUT P555, PulseTicks ' Output 866 uSec on IR
    RETURN

    SendZero:
    PULSOUT IdlePin, 4*PulseTicks ' Give silence for 4/1200 seconds
    PULSOUT P555, PulseTicks ' Output 866 uSec on IR
    RETURN

    To get the RoboSapien to accept this, you might have to adjust the timing of the 'silence' values, since the shifting and decision making will take 300 uSec per instruction for a stock BS2. That's pretty close to the 833 uSec of silence the specification calls for, so it might be better to use one of the faster BS2's, like an SX.

    Oh, and I just realized you're talking about a BS2p40 already.· Hmm, I'll have to check the speed on that one.

    Whoosh, the BS2p uses 41 uSec per instruction.· That seems very doable.

    AND, the BS2p 'tick size' is 0.8 uSec per tick.· So all the timings will have to be adjusted.

    PulseTicks CON 1082· ' 1082 * 0.8 uSec == 866 uSec


    Post Edited (allanlane5) : 1/10/2007 2:50:13 PM GMT
  • seconikaseconika Posts: 18
    edited 2007-01-11 11:50
    Thank you very much· smile.gif

    I will try to laborate with this a.s.a.p.
    I do have a BSp40

    I hope I will get the codes from the Link in my post to work now..


    Thanks again,
    Niklas
  • Monkey4saleMonkey4sale Posts: 28
    edited 2007-01-14 03:16
    isnt there a remote controll book on pdf format somewhere on the website? It should tell you everything about IR remote controlled things and how to do it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When you see the pretty smoke come from a component. It is time to go shopping again.
Sign In or Register to comment.