Hello for everybody.
My name is Carlos, and I writing from Brazil.
This is my first time in this forum, and I would like to anticipate my excuses for my poor English.
Well, my problem is:
How can I decode the HT6P20B of efficient form with PBP?
Certain time, I used the code below to decode the HT12E, but this code is very slow and not very efficient, and the HT6P20B has more code bits that the HT12E .
'------------
'Variables
IRCONT VAR BYTE
BITVALUE VAR BYTE
DEVICECODE VAR BYTE
DEVICEDATA VAR BYTE
IRIN VAR PORTA.1
'------------------
LEIR:
DEVICECODE = 0
DEVICEDATA = 0
BITVALUE = 0
PULSIN IRIN,0,BITVALUE
IF BITVALUE > 150 THEN
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.7 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.6 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.5 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.4 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.3 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.2 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.1 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICECODE.0 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICEDATA.0 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICEDATA.1 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICEDATA.2 = BITVALUE
BITVALUE = 0
PULSIN IRIN,1,BITVALUE
GOSUB TESTABIT
DEVICEDATA.3 = BITVALUE
ENDIF
RETURN
'-------------
TESTABIT:
IF BITVALUE > 60 THEN
BITVALUE = 0
ELSE
BITVALUE = 1
ENDIF
RETURN
'--------------
Thank you, and again, sorry for my english.
Carlos
Bookmarks