Shop OBEX P1 Docs P2 Docs Learn Events
ir-buddy simple problem — Parallax Forums

ir-buddy simple problem

ArchiverArchiver Posts: 46,084
edited 2004-02-22 15:36 in General Discussion
Ok, I have an ir_buddy connected to pin 15 and running the stock
program from parallax.com for the loopback test. its telling
me "Timeout Error - check connection" none of the other programs work
properly either. I sent the ir_buddys back and they told me they were
fine. I am using a BS2P24 and I am getting really frustrated. This is
making me feel real stupid.

Is it supposed to tell me this? I tried the program for sending and
receiving RC5 codes with my learning remote and it didnt not receive
anything, that program also told me time out error. the wire runs are
not long. everything is on the demo board.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-02-16 19:59
    The 'loopback' program is really to test a long
    wire-run to an IR_Buddy. The attached program
    should set up the IR_Buddy properly, then wait
    for you to press a key on the remote. It should
    then output the keypresses.

    Note you have to set your remote code for
    RC5, or Phillips, for this to work. Note you
    also have to connect your IR_Buddy to +5 and
    ground, as well as the signal pin.

    ' Simple IR_Buddy Test Program

    SerBaud CON $4000 + 84 ' 9600 baud, inverted

    IR_Baud CON $8000 + 84 ' 9600 baud, Open mode, NOT inverted
    IR_Pin CON 2 ' Or whatever data pin you have the IR_Buddy on.
    IRDat VAR BYTE(8) ' Use locations 0..7

    INIT:
    GOSUB IR_Buddy_Reset

    MAIN:
    GOSUB ClearData
    GOSUB IR_Buddy_GetData
    GOSUB PrintData
    PAUSE 500 ' Wait 500 mSec and go around again.
    GOTO MAIN

    END

    IR_Buddy_Reset: ' Reset Cycle
    LOW IR_Pin ' Set pin output, and low
    PAUSE 5 ' Hold for 5 mS
    INPUT IR_Pin ' Set pin High Impedance
    PAUSE 50 ' and wait 50 mS, to complete init
    RETURN

    IR_Buddy_GetData:
    SEROUT IR_Pin, IR_Baud, [noparse][[/noparse]$74, 10] ' $74 == Setup to get data to BS2
    ' 10 == Wait 10 mS before
    ' sending data.
    SERIN IR_Pin, IR_Baud, [noparse][[/noparse]STR IRDat\8\255]
    ' Get 8 bytes, or to first '255'
    RETURN

    PrintData:
    I = 0
    NextByte:
    IF (I = 8) OR (IRDat(I) = 0) THEN PrintDone
    ' else
    SEROUT 16, SerBaud, [noparse][[/noparse]DEC IRDat(I), ", "]
    I = I + 1
    GOTO NextByte
    PrintDone:
    SEROUT 16, SerBaud, [noparse][[/noparse]13] ' Linefeed
    RETURN

    ClearData:
    FOR I = 0 to 7
    IRDat(I) = 0
    NEXT
    RETURN

    --- In basicstamps@yahoogroups.com, "elfkeebler" <elfkeebler@y...>
    wrote:
    > Ok, I have an ir_buddy connected to pin 15 and running the stock
    > program from parallax.com for the loopback test. its telling
    > me "Timeout Error - check connection" none of the other programs
    work
    > properly either. I sent the ir_buddys back and they told me they
    were
    > fine. I am using a BS2P24 and I am getting really frustrated. This
    is
    > making me feel real stupid.
    >
    > Is it supposed to tell me this? I tried the program for sending and
    > receiving RC5 codes with my learning remote and it didnt not
    receive
    > anything, that program also told me time out error. the wire runs
    are
    > not long. everything is on the demo board.
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-16 21:25
    Which version of the code are you running? Since you're using the BS2p,
    you may need to modify the SEROUT/SERIN baudmode parameter. I haven't
    had the opportunity to update the demo code for conditional compilation
    ... I'll get to that as soon as I can. In the meantime, here's what you
    need for the correct SEROUT/SERIN operation:

    IRb96 CON 240 + $8000 ' 9600 baud, open
    IRb48 CON 500 + $8000 ' 4800 baud, open
    IRb24 CON 1021 + $8000 ' 2400 baud, open

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: elfkeebler [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ZYAOr_RV7UOL-Nl3fkbr4fr9jo9YjSAZUWT8yHzaJbrbpACaMV8DGhh88MXQ1eLQpQK72JabpIbH_4M]elfkeebler@y...[/url
    Sent: Monday, February 16, 2004 12:48 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] ir-buddy simple problem


    Ok, I have an ir_buddy connected to pin 15 and running the stock
    program from parallax.com for the loopback test. its telling
    me "Timeout Error - check connection" none of the other programs work
    properly either. I sent the ir_buddys back and they told me they were
    fine. I am using a BS2P24 and I am getting really frustrated. This is
    making me feel real stupid.

    Is it supposed to tell me this? I tried the program for sending and
    receiving RC5 codes with my learning remote and it didnt not receive
    anything, that program also told me time out error. the wire runs are
    not long. everything is on the demo board.




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-22 04:01
    That program didnt work on pbasic 2.5

    PrintData:
    I = 0 'it doesnt like this

    but thank you for your effort.


    --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...> wrote:
    > The 'loopback' program is really to test a long
    > wire-run to an IR_Buddy. The attached program
    > should set up the IR_Buddy properly, then wait
    > for you to press a key on the remote. It should
    > then output the keypresses.
    >
    > Note you have to set your remote code for
    > RC5, or Phillips, for this to work. Note you
    > also have to connect your IR_Buddy to +5 and
    > ground, as well as the signal pin.
    >
    > ' Simple IR_Buddy Test Program
    >
    > SerBaud CON $4000 + 84 ' 9600 baud, inverted
    >
    > IR_Baud CON $8000 + 84 ' 9600 baud, Open mode, NOT inverted
    > IR_Pin CON 2 ' Or whatever data pin you have the IR_Buddy on.
    > IRDat VAR BYTE(8) ' Use locations 0..7
    >
    > INIT:
    > GOSUB IR_Buddy_Reset
    >
    > MAIN:
    > GOSUB ClearData
    > GOSUB IR_Buddy_GetData
    > GOSUB PrintData
    > PAUSE 500 ' Wait 500 mSec and go around again.
    > GOTO MAIN
    >
    > END
    >
    > IR_Buddy_Reset: ' Reset Cycle
    > LOW IR_Pin ' Set pin output, and low
    > PAUSE 5 ' Hold for 5 mS
    > INPUT IR_Pin ' Set pin High Impedance
    > PAUSE 50 ' and wait 50 mS, to complete init
    > RETURN
    >
    > IR_Buddy_GetData:
    > SEROUT IR_Pin, IR_Baud, [noparse][[/noparse]$74, 10] ' $74 == Setup to get data to BS2
    > ' 10 == Wait 10 mS before
    > ' sending data.
    > SERIN IR_Pin, IR_Baud, [noparse][[/noparse]STR IRDat\8\255]
    > ' Get 8 bytes, or to first '255'
    > RETURN
    >
    > PrintData:
    > I = 0
    > NextByte:
    > IF (I = 8) OR (IRDat(I) = 0) THEN PrintDone
    > ' else
    > SEROUT 16, SerBaud, [noparse][[/noparse]DEC IRDat(I), ", "]
    > I = I + 1
    > GOTO NextByte
    > PrintDone:
    > SEROUT 16, SerBaud, [noparse][[/noparse]13] ' Linefeed
    > RETURN
    >
    > ClearData:
    > FOR I = 0 to 7
    > IRDat(I) = 0
    > NEXT
    > RETURN
    >
    > --- In basicstamps@yahoogroups.com, "elfkeebler" <elfkeebler@y...>
    > wrote:
    > > Ok, I have an ir_buddy connected to pin 15 and running the stock
    > > program from parallax.com for the loopback test. its telling
    > > me "Timeout Error - check connection" none of the other programs
    > work
    > > properly either. I sent the ir_buddys back and they told me they
    > were
    > > fine. I am using a BS2P24 and I am getting really frustrated. This
    > is
    > > making me feel real stupid.
    > >
    > > Is it supposed to tell me this? I tried the program for sending and
    > > receiving RC5 codes with my learning remote and it didnt not
    > receive
    > > anything, that program also told me time out error. the wire runs
    > are
    > > not long. everything is on the demo board.
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-22 04:23
    At 04:01 AM 2/22/04 +0000, elfkeebler wrote:
    >That program didnt work on pbasic 2.5
    >
    >PrintData:
    > I = 0 'it doesnt like this
    >
    >but thank you for your effort.

    Just insert the following near the top of the program:

    I var byte

    and try it again.



    >--- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...> wrote:
    >> The 'loopback' program is really to test a long
    >> wire-run to an IR_Buddy. The attached program
    >> should set up the IR_Buddy properly, then wait
    >> for you to press a key on the remote. It should
    >> then output the keypresses.
    >>
    >> Note you have to set your remote code for
    >> RC5, or Phillips, for this to work. Note you
    >> also have to connect your IR_Buddy to +5 and
    >> ground, as well as the signal pin.
    >>
    >> ' Simple IR_Buddy Test Program
    >>
    >> SerBaud CON $4000 + 84 ' 9600 baud, inverted
    >>
    >> IR_Baud CON $8000 + 84 ' 9600 baud, Open mode, NOT inverted
    >> IR_Pin CON 2 ' Or whatever data pin you have the IR_Buddy on.
    >> IRDat VAR BYTE(8) ' Use locations 0..7
    >>
    >> INIT:
    >> GOSUB IR_Buddy_Reset
    >>
    >> MAIN:
    >> GOSUB ClearData
    >> GOSUB IR_Buddy_GetData
    >> GOSUB PrintData
    >> PAUSE 500 ' Wait 500 mSec and go around again.
    >> GOTO MAIN
    >>
    >> END
    >>
    >> IR_Buddy_Reset: ' Reset Cycle
    >> LOW IR_Pin ' Set pin output, and low
    >> PAUSE 5 ' Hold for 5 mS
    >> INPUT IR_Pin ' Set pin High Impedance
    >> PAUSE 50 ' and wait 50 mS, to complete init
    >> RETURN
    >>
    >> IR_Buddy_GetData:
    >> SEROUT IR_Pin, IR_Baud, [noparse][[/noparse]$74, 10] ' $74 == Setup to get data to BS2
    >> ' 10 == Wait 10 mS before
    >> ' sending data.
    >> SERIN IR_Pin, IR_Baud, [noparse][[/noparse]STR IRDat\8\255]
    >> ' Get 8 bytes, or to first '255'
    >> RETURN
    >>
    >> PrintData:
    >> I = 0
    >> NextByte:
    >> IF (I = 8) OR (IRDat(I) = 0) THEN PrintDone
    >> ' else
    >> SEROUT 16, SerBaud, [noparse][[/noparse]DEC IRDat(I), ", "]
    >> I = I + 1
    >> GOTO NextByte
    >> PrintDone:
    >> SEROUT 16, SerBaud, [noparse][[/noparse]13] ' Linefeed
    >> RETURN
    >>
    >> ClearData:
    >> FOR I = 0 to 7
    >> IRDat(I) = 0
    >> NEXT
    >> RETURN
    >>
    >> --- In basicstamps@yahoogroups.com, "elfkeebler" <elfkeebler@y...>
    >> wrote:
    >> > Ok, I have an ir_buddy connected to pin 15 and running the stock
    >> > program from parallax.com for the loopback test. its telling
    >> > me "Timeout Error - check connection" none of the other programs
    >> work
    >> > properly either. I sent the ir_buddys back and they told me they
    >> were
    >> > fine. I am using a BS2P24 and I am getting really frustrated. This
    >> is
    >> > making me feel real stupid.
    >> >
    >> > Is it supposed to tell me this? I tried the program for sending and
    >> > receiving RC5 codes with my learning remote and it didnt not
    >> receive
    >> > anything, that program also told me time out error. the wire runs
    >> are
    >> > not long. everything is on the demo board.
    >
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >Yahoo! Groups Links
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-02-22 15:36
    Right, forgot to declare 'I'.

    Add 'I VAR BYTE' somewhere in the program.

    --- In basicstamps@yahoogroups.com, "elfkeebler" <elfkeebler@y...>
    wrote:
    > That program didnt work on pbasic 2.5
    >
    > PrintData:
    > I = 0 'it doesnt like this
    >
    > but thank you for your effort.
    >
    >
    > --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
    wrote:
    > > The 'loopback' program is really to test a long
    > > wire-run to an IR_Buddy. The attached program
    > > should set up the IR_Buddy properly, then wait
    > > for you to press a key on the remote. It should
    > > then output the keypresses.
    > >
    > > Note you have to set your remote code for
    > > RC5, or Phillips, for this to work. Note you
    > > also have to connect your IR_Buddy to +5 and
    > > ground, as well as the signal pin.
    > >
    > > ' Simple IR_Buddy Test Program
    > >
    > > SerBaud CON $4000 + 84 ' 9600 baud, inverted
    > >
    > > IR_Baud CON $8000 + 84 ' 9600 baud, Open mode, NOT inverted
    > > IR_Pin CON 2 ' Or whatever data pin you have the IR_Buddy
    on.
    > > IRDat VAR BYTE(8) ' Use locations 0..7
    > >
    > > INIT:
    > > GOSUB IR_Buddy_Reset
    > >
    > > MAIN:
    > > GOSUB ClearData
    > > GOSUB IR_Buddy_GetData
    > > GOSUB PrintData
    > > PAUSE 500 ' Wait 500 mSec and go around again.
    > > GOTO MAIN
    > >
    > > END
    > >
    > > IR_Buddy_Reset: ' Reset Cycle
    > > LOW IR_Pin ' Set pin output, and low
    > > PAUSE 5 ' Hold for 5 mS
    > > INPUT IR_Pin ' Set pin High Impedance
    > > PAUSE 50 ' and wait 50 mS, to complete init
    > > RETURN
    > >
    > > IR_Buddy_GetData:
    > > SEROUT IR_Pin, IR_Baud, [noparse][[/noparse]$74, 10] ' $74 == Setup to get data
    to BS2
    > > ' 10 == Wait 10 mS before
    > > ' sending data.
    > > SERIN IR_Pin, IR_Baud, [noparse][[/noparse]STR IRDat\8\255]
    > > ' Get 8 bytes, or to first '255'
    > > RETURN
    > >
    > > PrintData:
    > > I = 0
    > > NextByte:
    > > IF (I = 8) OR (IRDat(I) = 0) THEN PrintDone
    > > ' else
    > > SEROUT 16, SerBaud, [noparse][[/noparse]DEC IRDat(I), ", "]
    > > I = I + 1
    > > GOTO NextByte
    > > PrintDone:
    > > SEROUT 16, SerBaud, [noparse][[/noparse]13] ' Linefeed
    > > RETURN
    > >
    > > ClearData:
    > > FOR I = 0 to 7
    > > IRDat(I) = 0
    > > NEXT
    > > RETURN
    > >
    > > --- In basicstamps@yahoogroups.com, "elfkeebler"
    <elfkeebler@y...>
    > > wrote:
    > > > Ok, I have an ir_buddy connected to pin 15 and running the
    stock
    > > > program from parallax.com for the loopback test. its telling
    > > > me "Timeout Error - check connection" none of the other
    programs
    > > work
    > > > properly either. I sent the ir_buddys back and they told me
    they
    > > were
    > > > fine. I am using a BS2P24 and I am getting really frustrated.
    This
    > > is
    > > > making me feel real stupid.
    > > >
    > > > Is it supposed to tell me this? I tried the program for sending
    and
    > > > receiving RC5 codes with my learning remote and it didnt not
    > > receive
    > > > anything, that program also told me time out error. the wire
    runs
    > > are
    > > > not long. everything is on the demo board.
Sign In or Register to comment.