Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:26 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : COM question

Author Message
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 08:38pm 24 May 2019
Copy link to clipboard 
Print this post

Hey guys,

I need to handle this in MMBASIC.

1 start bit and 1 stop bit?
There is a QB example and it simply shows [BAUD],N,8,1

"The communication protocol uses 8 data bits, 1 start bit, 1 stop bit and no parity."

The above quote is from the documentation.

Cheers!

 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 01:41am 25 May 2019
Copy link to clipboard 
Print this post

Hi.

This is the default that the MMBASIC COM ports will use - so you do not have to do anything special to get this.

Example for 9600 baud:
OPEN "COM1:9600" AS #1


You can add extra options if you want to increase the default RX buffer size and/or use an interrupt (which I thoroughly recommend).

Regards

Gerard (vk3cg/vk3grs)
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1646
Posted: 01:48am 25 May 2019
Copy link to clipboard 
Print this post

Hi Tinine,

  Quote  8 data bits, 1 start bit, 1 stop bit and no parity

That is pretty much the default for serial communications. See the Manual in the "Serial Communications" section.

The Manual says:
  Quote  OPEN comspec$ AS #fnbr
‘fnbr’ is the file number to be used. It must be in the range of 1 to 10. The # is optional.
‘comspec$’ is the communication specification and is a string (it can be a string variable) specifying the serial port to be opened and optional parameters. The default is 9600 baud, 8 data bits, no parity and one stop bit.
It has the form "COMn: baud, buf, int, intlevel, DE, 9BIT, INV, OC, S2"

Simply:

Open "Com1:9600" as #1

will do it where 9600 is the baud rate (see the manual for the available baud rates).

Bill

Edit: Sorry Gerard I was typing at the same time.Edited by Turbo46 2019-05-26
Keep safe. Live long and prosper.
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 02:14am 25 May 2019
Copy link to clipboard 
Print this post

Hi Bill.

What can I say - great minds and all that...

Regards

Gerard (vk3cg/vk3grs)
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025