Command files are similar to batch files. The have an extension of mmc instead of bas. mmc = MaxiMite Control
You can use command files by dragging them from Windows explorer onto the MMCC terminal window or, provided the first line has the s\command setting present, you can also upload it from MMEdit the same way as normal bas files.
Changing many of the OPTION settings results in a reboot of the device. This
can cause the connection to the PC to be lost.
With command files, you can instruct MMCC to wait a number of seconds before attempting
to reconnect.
The following directives are available. There is no space between the ' and
the command.
'reconnect nn [port] = Disconnect the device wait nn seconds then reconnect.
If a com port in the form "com4:115200 etc is found, this port will be used
to reconnect. This is useful if you have sent a command to change the console
baud rate. Linux users - port change not available yet.
'nap nn = wait nn seconds before sending the next line. Useful for slow devices
One example of a command file is used for re-configuring a picomite after firmware updates. (This is not normally required)
'target port\com4:115200 s\command settime
option reset
'reconnect 3
flash erase all
'nap 3
var clear
'echo system cleared
'echo CPU speed changing - com port will reset
OPTION CPUSPEED 250000
'reconnect 5
OPTION SYSTEM SPI 14,15,16
'reconnect 5
OPTION SDCARD 17
'reconnect 5
OPTION LCDPANEL ILI9341,L,10,11,12
'reconnect 5
OPTION TOUCH 19,20
'reconnect 5
GUI CALIBRATE 0, 250, 504, 925, 747
'reconnect 5
'echo All done!
' OPTION SYSTEM SPI CLKpin, MOSIpin, MISOpin
' OPTION SDCARD CS
' OPTION LCDPANEL ILI9341, orientation, DCpin, RESETpin, CSpin
' OPTION TOUCH IRQpin, CSpin
Here we have reconnect 3 seconds after sending the OPTION RESET command.
snooze for three seconds after sending "FLASH ERASE ALL"
etc.
Note that, with all the pauses, Just be patient!
Updating a pico is as simple as
dragging the uf2 file onto the MMCC console, wait for the firmware update to
finish,
drag the pico.mmc configuration file onto the MMCC console area.
You now have an updated and clean picomite again.
Last edited: 12 September, 2022