Hello Moz,
Ok, now we have parallel to Parallel with a dinner table as a translator.
Here is a untested but probably very close working program you are looking for I think...
Dwayne
TRISA="11111111" 'set Porta to all input...8 bit
TRISB="00000000" 'set Portb to all output...8 bit.
ReadData var byte
HoldData var byte
TranslateData var byte
Counter var byte
MainLoop:
ReadData=Porta
If ReadData!=HoldData then Gosub TableLookup
HoldData=ReadData
Goto MainLoop
TableLookup:
Counter=0
Loop2:
Read Counter,Holddata 'read table
if Holdata=$FF then Goto MainLoop 'bad data
If Holddata=ReadData then goto TransmitPortb 'MATCH!!!
Counter=Counter+2 'Must skip every other byte for table!
GotoLoop2
TransmitPortb:
Read Counter+1, HoldData 'reads Translated value
Portb=Holddata 'outputs to portb
Return
End
Last edited by Dwayne; - 1st September 2004 at 21:40.
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks