Hello Moz,
Moz>>What I need to do is read a 8 bit binary word say on porta, look up a value and output this binary value on portb.<<
How is the word going to be read??? Via Serial data? Via parallel data? (Many A ports that I know of, can't handle a 8 bit Parallel read). So what kind of chip are you talking about?
Now about output... are you going to output as a parallel data output, and use the whole port B (like a 8 bit LCD)? Or are you going to serial output and use just a pin?(like a Backpack LCD)
These are untested, but should work with little change in coding.
a simple psuedo code parallel
Loop:
if Porta="00110011" then gosub Newdata
goto Loop
Newdata:
Portb=Porta
return.
a simple psuedocode Series:
Readdata var byte;
trisa="11111111"
trisb="00000000"
PinIn var Porta.1
PinOut var Portb.1
Loop:
Serin PinIn, T2400, Readdata
if Readdata="00110011" then gosub Newdata
goto Loop:
Newdata:
Portb=Readdata 'for parallel output
Serout PinOut,T2400,Readdata 'for serial output
return
Dwayne
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