Shop OBEX P1 Docs P2 Docs Learn Events
IR with RC5 is not working properly — Parallax Forums

IR with RC5 is not working properly

Jakob SelbingJakob Selbing Posts: 8
edited 2004-12-28 19:16 in General Discussion
I have made a little circuit which acts as a Bluetooth-to-IR remote control. The circuit can read an RC5 command from a remote control, and then replicate it. However, there's something fishy with the IR commands. Some commands·will only work the first time I press the button. In order to get any response from this command again, another command has to be sent first.

Does anyone know why this happens?

I suspect that it has something to do with the toggle bit of the RC5 protocol. This bit is toggled each time a command is sent, which I think is the correct behavior. I also tried switching of the toggling. Neither works properly...

Any help would be appreciated. Thanks
/Jakob

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-28 17:46
    Can you post your code?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Jakob SelbingJakob Selbing Posts: 8
    edited 2004-12-28 18:02
    Ahh sorry I forgot to mention that I use a PIC16F870, and not a BASIC stamp... I assume you don't want to go through some 600 lines of assembler. I use the FlexiPanel BASIC stamp edition for Bluetooth interface though.
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-12-28 18:19
    Sound like an assembly logic flaw, to me.

    Doesn't the RC5 protocol auto-repeat? That is, as long as you hold down the key, the remote keeps sending the key. It does set a bit on the sends to indicate when it is a 'first key-press' versus a 'repeat-key-press' -- but I've forgotten enough of the protocol by now to remember the mechanism.

    It sounds like your program is not properly doing the mecanism though.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-28 18:25
    And this is a BASIC Stamp forum -- not the right place to post PIC support questions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Jakob SelbingJakob Selbing Posts: 8
    edited 2004-12-28 19:11
    Jon,

    If you look at the topic and read my first post, you'll see that it is a question about the RC5 protocol, and not about PIC programming. And there were several other posts about infrared communications·in this forum.
  • Jakob SelbingJakob Selbing Posts: 8
    edited 2004-12-28 19:16
    I found a text which explains the toggle bit...

    The toggle bit toggles everytime you release a button and press another or the same button. That is there so the receiver can detect if you are selecting "1" or "11" for instance. The first time you press the "1" button the toggle bit may be zero, and the next time it's a one. That way the receiver can detect that you have released the button and that you are pressing it again.



    Problem solved smile.gif

    Thanks anyway
    /Jakob
Sign In or Register to comment.