I want to generate a square wave through the serial port. How can I specify my baud rate settings other than the common ones?
Printable View
I want to generate a square wave through the serial port. How can I specify my baud rate settings other than the common ones?
if you vb 2005 - serialport1.baudrate=int
assuming that you want to select from 110 - 999999
it is possible but the availible baud rates are set by the hardware - the UART chip.
if your UART accepts non-standard baud rates it should be ok, as Microsoft say "The baud rate must be supported by the user's serial driver" . no warning is generated if you select a non-standard rate & it is not supported by your UART so it probably defaults to 9600.
if you only need low frequency you could toggle the DtrEnable or RtsEnable by using a timer - maximum frequency would be 500Hz. i don't know how accurate this would be or how square your pulse would be.
a good program for serial comms can be found here http://www.docklight.de/
they have unlimited time demo - just no saving projects etc
it allows you to set any baud rate so you can test your UART without having to having to code any VB. setup 2 computers or make yourself a loopback plug.
hope this helps
Thank you
I can generate numerous frequencies with no problems. The problem is that I do not want a break in the pulse train when I change frequencies.
How did you do this? I am also trying to generate a square wave through the serial port.Quote:
I can generate numerous frequencies with no problems. The problem is that I do not want a break in the pulse train when I change frequencies.