Full Duplex Serial Question
TimH
Posts: 48
Hello all.
I want to be able to change the baud rate of the Full Duplex Serial - on the fly.
example:
com1.Start(15,16,0,9600)
"receive data here"
com1.Stop
com1.Start(15,16,0,4800)
"send data here"
com1.Stop
Would this work ? Is there a way to do it without starting and stopping the FDS object.
I want to be able to change the baud rate based on a switch setting.
I want to be able to change the baud rate of the Full Duplex Serial - on the fly.
example:
com1.Start(15,16,0,9600)
"receive data here"
com1.Stop
com1.Start(15,16,0,4800)
"send data here"
com1.Stop
Would this work ? Is there a way to do it without starting and stopping the FDS object.
I want to be able to change the baud rate based on a switch setting.
Comments
OK - so keeping with the FDS object (because that seems to work for me), I could start and then stop the FDS object each time I wanted to change the baud rate - how much time would that use ?
or
run 2 instances of FDS one at 9600 and one at 4800 baud and call which ever one I needed for that baud rate.
Is that correct ?
http://www.brielcomputers.com/wik/images/9/9e/PTfirmware.zip
full-duplex vt-100 emulation. i bought one - nice piece of work.
can't see any difference looking at a dipswitch to set baud or pressing a function key as in pocket terminal.
I can get FDS to work on different baud rates for RX and TX just by starting a new instance of FDS when I want to send and then again when I want to receive with no stop used
So I always TX at 115200 and RX at 9600 but I don't stop the FDS.
example
com1.start(18,19,0,115200)
send some data here
com1.start(18,19,0,9600)
receive some data here
I'm not sure why this works but it does - I wrote the code when I was starting out with the Prop and didn't really know what I was doing and because it worked I had no reason to look at it closely. Anyone have any comments on why this seems to work OK.
Is it because I'm only using the FDS in simplex mode ie I never receive and transmit at the same time?
9600 Baud is one bit every 100us roughly. That's about what it takes to stop and restart FDS ... not bad. At 115200, you're going about 10 times faster. In 100us, you can send or receive one byte. The time it takes to restart FDS is not huge compared to these other actions.
Because my project was quite small I had a couple of unused pins available, so I used them as "dummy" RX and TX for 2 instances of FDS ... it worked fine. I also have spare cogs so 2 instances of FDS was not a problem on this project.
The 4 - port serial driver looks like a better way of doing it though so I will start playing with that.
On another note - is there a serial driver that allows me to change the timing values.
I have a device that is slightly off on its 9600 baud timing.
Bit timing for 9600 should be 104 uS - this particular device has a bit timing of around 102 uS. Almost all PC ports work fine with this, but some 4-port pci type cards have problems with it.
Back in my PIC bit banging days it was able to just change the delay loop for the bit width but and am wondering if any of the serial drivers in the OBEX can do this easily. Only need to go to 9600 baud.
Tim
Tim