Hi all,
on my PIC18f67K22 I use the serial port2 as a debug line to output comments during program execution.
So here and there I have an "Hserout2 ["I'm doing this",13,10]
Also I receive data from a terminal connected to serial port2 (I use Instant_Interrupt by the great Darrel R.I.P.).
Now I need that when some condictions occours, all the Hserout2 line are skipped and no strings come out from serial port2, while receiving continues to work. Lets' say this is a "ghost mode".
Then, I need that when I receive a particular string in the serial port2, the Hserout2 debug line is re-enabled and works again.
Look like it is simple by disabling the TX on the serial port2 -->> txsta2.5=0 but it doesnt't work and the program enter in a strange condition that I still have to understand. Looks like it freezes somewhere.
Do you have another smart idea on how to stop Hserout2 ?
p.s. I can't put a "If then" in every parto f the code where I use Hserout2, too much job.
on my PIC18f67K22 I use the serial port2 as a debug line to output comments during program execution.
So here and there I have an "Hserout2 ["I'm doing this",13,10]
Also I receive data from a terminal connected to serial port2 (I use Instant_Interrupt by the great Darrel R.I.P.).
Now I need that when some condictions occours, all the Hserout2 line are skipped and no strings come out from serial port2, while receiving continues to work. Lets' say this is a "ghost mode".
Then, I need that when I receive a particular string in the serial port2, the Hserout2 debug line is re-enabled and works again.
Look like it is simple by disabling the TX on the serial port2 -->> txsta2.5=0 but it doesnt't work and the program enter in a strange condition that I still have to understand. Looks like it freezes somewhere.
Do you have another smart idea on how to stop Hserout2 ?
p.s. I can't put a "If then" in every parto f the code where I use Hserout2, too much job.
Comment