PICO high speed serial problem
Author
Message
phil99
Guru
Joined: 11/02/2018
Location: AustraliaPosts: 3319
Posted: 12:49am 20 Jun 2024
Apendix A said
The OPEN Command
A serial port is opened using the command:
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, int-trigger, EVEN, ODD, S2, 7BIT"
where:
‘n’ is the serial port number for either COM1: or COM2:.
‘baud’ is the baud rate. This can be any number from 1200 to 921600. Default is 9600.
‘buf’ is the receive buffer size in bytes (default size is 256). The transmit buffer is fixed at 256 bytes.
‘int’ is interrupt subroutine to be called when the serial port has received some data.
‘int-trigger’ is the number of characters received which will trigger an interrupt.
All parameters except the serial port name (COMn:) are optional. If any one parameter is left out then all the
following parameters must also be left out and the defaults will be used.
Five options can be added to the end of 'comspec$'. These are:
'S2' specifies that two stop bits will be sent following each character transmitted.
EVEN specifies that an even parity bit will be applied, this will result in a 9-bit transfer unless 7BIT is set.
ODD specifies that an odd parity bit will be applied, this will result in a 9-bit transfer unless 7BIT is set
7BIT specifies that there a 7bits of data. This is normally used with EVEN or ODD
INV specifies that the output signals will be inverted and input assumed to be inverted
Edited 2024-06-20 10:52 by phil99