IR Buddy Question
Gabe
Posts: 24
Hi guys,
I'm trying out the IR Buddy loopback test on one of the my IR Buddy. The test is printed on page 11 of the IR Buddy manual. I was wondering if the connections are the same as the previous program on page 10, because there wasn't any diagram on how the Buddy should be connected with regards to the Loopback test.
I tried out the program and the program kept returning the error "Timeout error - Check Connection" with the baud rate shown to be 2400 but no data was detected in the 0 to 255 loop in the program.
Here's part of the program:
·I was wondering if the last line is correctly printed in the manual, because in addition to the declaration of IRb24, there are also IRb48 and IRb96, do I need to change them accordingly? The declarations are as follow:
I'm of the opinion that this isn't the cause of my program·error, but just wanted to clarify this up anyway.
Any help would be greatly appreciated.
Thanks,
Gabe
I'm trying out the IR Buddy loopback test on one of the my IR Buddy. The test is printed on page 11 of the IR Buddy manual. I was wondering if the connections are the same as the previous program on page 10, because there wasn't any diagram on how the Buddy should be connected with regards to the Loopback test.
I tried out the program and the program kept returning the error "Timeout error - Check Connection" with the baud rate shown to be 2400 but no data was detected in the 0 to 255 loop in the program.
Main: FOR testNum = 0 TO 2 LOOKUP testNum, [noparse][[/noparse]2400, 4800, 9600], testBaud DEBUG CrsrXY, 6, 3, DEC testBaud ' display test baud rate LOOKUP testNum, [noparse][[/noparse]IRb24, IRb24, IRb24], testBaud FOR testVal = 0 TO 255 ' loop through holdoff values SEROUT IRbSIO, testBaud, [noparse][[/noparse]IRbLoopback, testVal] 'DEBUG DEC iRbLoopback, DEC testVal,CR SERIN IRbSIO, testBaud, 300, TO_Error, [noparse][[/noparse]STR buffer\4] FOR idx = 0 TO 3 ' display rx buffer DEBUG CrsrXY, 6, (idx + 5) DEBUG DEC buffer(idx), ClrEOL, CR NEXT IF (buffer(0) <> testVal) THEN Packet_Error IF (buffer(1) <> testVal) THEN Packet_Error IF (buffer(2) <> 254) THEN Packet_Error IF (buffer(3) <> 255) THEN Packet_Error NEXT ' testVal NEXT ' testNum Test_Complete: DEBUG CR, "Test Complete - PASS" END TO_Error: DEBUG CR, "Timeout Error - check connection" END Packet_Error: DEBUG CR, "Packet Error" END
Here's part of the program:
Main: FOR testNum = 0 TO 2 LOOKUP testNum, [noparse][[/noparse]2400, 4800, 9600], testBaud DEBUG CrsrXY, 6, 3, DEC testBaud ' display test baud rate LOOKUP testNum, [noparse][[/noparse]IRb24, IRb24, IRb24], testBaud
·I was wondering if the last line is correctly printed in the manual, because in addition to the declaration of IRb24, there are also IRb48 and IRb96, do I need to change them accordingly? The declarations are as follow:
IRb96 CON 84 + $8000 ' 9600 baud, open IRb48 CON 188 + $8000 ' 4800 baud, open IRb24 CON 396 + $8000 ' 2400 baud, open
I'm of the opinion that this isn't the cause of my program·error, but just wanted to clarify this up anyway.
Any help would be greatly appreciated.
Thanks,
Gabe
Comments
The answer to your questions will greatly depend on which Stamp platform you are using. Those are certainly valid baud rates for some Stamps, but they may not be valid for the specific Stamp platform you are using.
Which BS-2? are you using?
Regards,
Bruce Bates
I'm using the BS2p40.·
Regards,
Gabe
Here is the appropriate baudmode table as directly extracted fom the ==> Help File! <==:
Regards,
Bruce Bates
Okay. So now with these values, i just input it into the serin and serout commands (depending on what mode I want) respectively and perhaps my "Timeout error - Check Connection" error would be gone? So in other words, the error could be due to the wrong baud value being inserted, am I right?
Regards,
Gabe
Late's just put it this way. When you use the proper baud rate (baudmode parameter) you will receive the proper and correct data. Without the proper and correct input data, no program has an even chance at success. To hypothesize about what bad or erroneous data may or may not be doing, isn't normally an exercise I usually find worthwhile
Just give it a shot, and we can go on from there if there are further problems.
Regards,
Bruce Bates