Anyway, I am still trying to do this project.

The chips are here now, I got ten to connect at once.

I have a good example from above but its still a long way really from what I am trying to do eventually.

As Dwayne suggested I can use this code but also assume I need to setup the ports as mister_e suggested above:


Var="N";
Loop:
SERIN portx,N2400,[“ASCII”],Var,
if Var<>"N" Gosub turnonroutine.
goto Loop

turnonroutine:
Var="N"
PortX=1 'turn on that light
pause 1000 'pause 1 second
Portx=0 'turn if off
return


So looking at this example I have an serial ascii string being watched for by the pic and when the pic sees the N the code goes to the turnonroutine sub routine for 1 second.

Is it correct to say then, if I serially send the alphabet in uppercase A-Z I can switch the light on for a longerstring of letters say MNO, so the light comes on only when all three characters have been sent and in the right order.

NMO OMN etc should not gosub to turnonroutine MNO should.


So if thats what I want to do, will this code be ok:

Var="MNO";
Loop:
SERIN portx,N2400,[“ASCII”],Var,
if Var<>"MNO" Gosub turnonroutine.
goto Loop

turnonroutine:
Var="N" Also why do I need this 'N' here?
PortX=1 'turn on that light
pause 1000 'pause 1 second
Portx=0 'turn if off
return


Not sure how many output bits are left after connecting the PIC to a serial port, I also eventually want to send the pic another code to see if the PIC is responding so bi-directional serial will be used. If that makes sence.

would be great to have this ability:



Send the PIC serially "MNx" where x is the port to turn on.
The PIC turns on port x for 1 second then returns to monitoring the serial data.


Send the PIC serially "MNi".
The PIC sees that code then transmits back "I am here",
then returns to monitoring the serial data.

so from what I have seen already with an 8pin PIC will this be possible?


5V
GND
Serin
serout

port1 - lamp 1
port2 - lamp 2
port3 - lamp 3
port4 - lamp 4


Hope I am not asking too much, I just dont want to do it wrong or re-invent the wheel.

Andy