Memotech-Bill / PicoBB

BBC BASIC for Raspberry Pi Pico
zlib License
32 stars 4 forks source link

Serial port #9

Closed georgestheking closed 1 year ago

georgestheking commented 1 year ago

The syntax for open a serial port using BBC BASIC Windows is :

      port% = OPENUP("COM1: baud=9600 parity=N data=8 stop=1")

What is the syntax to use for the PI PICO ?

Best regards

Georges

Memotech-Bill commented 1 year ago

As documented in the README:

Depending upon the compile options selected serial devices may appear as as single /dev/uart or the pair /dev/uart0 and /dev/uart1. A serial port may be opened using a command of the form:

port% = OPENUP("/dev/uart.baud=9600 parity=N data=8 stop=1 tx=0 rx=1 cts=2 rts=3")

Any of the pin numbers (tx, rx, cts, rts) may be omitted in which case that pin will not be connected. This enables transmit only, or receive only connections, and connections without flow control. The pin numbers selected must be valid Pico pin numbers for the relevent UART and function.

If not specified, the following defaults are assumed: parity=N data=8 stop=1.

The baud rate must be specified.

If keyword=value format is used then the parameters may be given in any order. Alternately the keyword and equals sign may be omitted in which case the parameters must be in the order shown above.

Note: Contrary to the BBC Basic documentation commas must not be used between the parameters.

If the BBC Basic user interface is connected via USB, then either serial interface may be used. If the user interface is connected via a serial connection, then do not open that interface (/dev/uart0 for a bare Pico, /dev/uart1 for a Pico on VGA Demo board).

georgestheking commented 1 year ago

Thanks

Memotech-Bill commented 1 year ago

Closed.