IRIN issues with 28X1

BCJKiwi

Senior Member
Have 28X1 FW A.1 @ 16MHz
Have a Vishay TSOP4838 IR receiver/preamp.
Have a multi TV Remote with SONY setting (can't find a source for a basic SONY TV remote in NZ)!

Issue 1.
Data received is not 0,1,2,3 etc
but
11264 and similar

Issue 2.
When the IRIN is used in the basic form,
IRIN pin,Variable
AND
the same button is pressed repeatedly, then the number received gets bigger each time the button is pressed.

Resolution;
If the command is used in its more complex form;
e.g.
IRIN [4000,RTC_Set],5, w1
then the number returned does not increment but the number is still of the form 11264 etc

So to get 0 thru 9 the following subroutine works to get 2 digits combined ;
Code:
GetIR:
IRIN [4000,RTC_Set],5, w1
pause 1500
b0 =w1-11263
IRIN [4000,RTC_Set],5, w1
pause 1500
b1 =w1-11263
b0=b0*10+b1
sertxd (#b0,cr,lf)
@ptr =b0
Return
which returns
1 (for button 1)
2 (for button 2)
12 for button 1 then 2 etc and
110 for button 10 then button 10
There is no 0 button.

Q1. presumably the improper function of the IRIN in basic mode is a Compiler issue or is it a FW issue?
Q2. Is the big number a TV remote issue?
Q3. Is the big number a TSOP4838 issue?

Any feedback gratefully received.

Thanks
 
Last edited:

BCJKiwi

Senior Member
Can anyone help with this please or is no one using irin?

I'm also a bit mystified that the format of the following symbol declarations have to be different.

Code:
symbol ProgSw = Input2    'Leg 13, Program mode select Push Button
symbol ProgIn = 5     'Leg 16, IR input
.
.
.
Programming:
If ProgSw =1 then
 gosub Program
EndIf
.
.
.
GetIR:
IRIN [8000,RTC_Set],progIn, w1
.
.
If
symbol progSw = 2
is used there is an error
If
symbol progIn = Input5
is used there is an error.
 
Last edited:

BCJKiwi

Senior Member
Seems the issue is most likely with the remote as further study of the Sony protocols suggests it is putting out the newer Sony SIRC 15 bit format to device code 10 and the number received represents the whole raw number including the device code. The remote is not programmable but preprogrammed for 12 makes of TV and VCR.

This suggests IRIN does not recognise what it's getting and just passes it all through, or, IRIN is not doing it's job properly, or, I just don't understand it at all (most likely).

While what I have works (just subtracting the extra data to get the number I need), I was hoping to get code that would work without having to customise the input to suit the remote.
 
Last edited:

Technical

Technical Support
Staff member
If
symbol progSw = 2
is used there is an error
If
symbol progIn = Input5
is used there is an error.
This is correct behaviour.

An 'if' statement uses the input pin variable (pin2 aka input2). This is a bit variable that contains the value '0' or '1' depending on whether the pin is high or low. So 'pin2' is actually the name of the variable that contains the state (0/1) of that pin, not a pointer to the pin itself.

irin simply uses a constant, the name of the pin (5). This is consistant across all PICAXE commands (serin etc).

If your remote is sending a different, but related, SONY protocol the irin command may well get confused. It will just process and try to interpret the first (expected) bits of the transmission.
 
Top