CMM2 Expansion Ports


Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8964
Posted: 09:07pm 10 Jul 2024      

It's very much like the PicoMite but the pin numbers are different - you use SETPIN to configure what you want a pin to do. The various options are shown in the manual.

The layout of the GPIO port is also shown in the manual (get the right one for your CMM2 version). AFAIK the RetroMax will follow the same layout, but you will need the manual for that to be sure. The diagram shows what you can configure pins for, but they can be standard digital IO pins.

For example, you could make pin 33 an input with a pullup to 3V3:
SETPIN 33, DIN, PULLUP
You can read it with
PRINT PIN(33)
so, you could set up a loop:


'this will print the value of pin 33 every 10th of a second
'use Ctrl C to stop it.
SETPIN 33, DIN, PULLUP
DO
 PRINT PIN(33)
 PAUSE 100
LOOP


It will keep printing "1"
If you now put a wire between pin 33 and GND it will print "0" while the wire is there and go back to "1" when you remove it.