I have a project where I am using a propeller processor (with serial buffer IC's) to intercept data from one serial port, filter that data in real time (blocks some commands & acts on others, inserts some extra data from the other serial ports / i2c ports as required) and then sends the data out on another port.
This is working fine in both directions using "fullDuplexSerial4port.spin" and separate COGs for the send and receive data paths.
I am using SPIN for all functions & so far and it is working well.
So now for the challenge.
Both the input & output ports use the same baud rate, but the source baud rate can be changed by one of these commands I am intercepting, so I need to be able to alter my baud rate in response to a command to do so.
To do this, I think I would follow a process like this:-
(1) Stop the Serial driver;
(2) Change the SysBaud variable (this is the variable for just these 2 ports, the other 2 are fixed at 9600);
(3) re-start the start_uarts routine
S4P.Stop ' stop 4 port serial driver (SysBaud must contain new system baud rate by now)
start_uarts ' re-initialise the UARTs
My question is, Have I missed something simpler?
Is there a way of just changing the 2 baud rates concerned without shutting down the "fullDuplexSerial4port" driver and re-initializing it?
I can't think how but I am fairly new to SPIN and the propeller so could easily be missing something obvious.
My thanks for any comments on this topic