Micromite User Manual Mmbasic Ver 5.05.04

Micromite User Manual Mmbasic Ver 5.05.04

Micromite User Manual MMBasic Ver 5.05.04 For updates to this manual and more details on MMBasic go to http://geoffg.net/micromite.html and http://mmbasic.com Copyright The Micromite firmware including MMBasic and this manual are Copyright 2011-2021 by Geoff Graham. I2C Support is Copyright 2011 Gerard Sexton. 1-Wire Support is Copyright 1999-2006 Dallas Semiconductor Corporation and 2012 Gerard Sexton. On the Micromite Plus: M-Stack USB/CDC driver is Copyright 2013 Alan Ott and Signal 11 Software FatFs (SD Card) driver is Copyright (C) 2014, ChaN. The USB VID and PIDs are sublicensed by Microchip Technology Incorporated for this project. The compiled object code (the .hex file) for the Micromite is free software: you can use or redistribute it as you please. The source code is available via subscription (free of charge) to individuals for personal use or under a negotiated license for commercial use. In both cases go to http://mmbasic.com for details. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This manual is distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia license (CC BY-NC-SA 3.0) Contributions Acknowledgement and thanks to Phil Boyce (WhiteWizard) for supporting the Micromite's development with much needed hardware, Peter Carnegie (G8JCF) for his help in developing the CFunction functionality and Gerard Sexton who developed the I2C and 1-Wire support for the original Maximite. A very big thanks to Peter Mather (matherp) for his ongoing support including introducing low cost LCD panels, writing the ILI9341 and ST7735S drivers, doing the original port to the MX470 and MZ chips, porting the M-Stack USB/CDC and FatFs drivers, pushing the implementation of CFunctions to new heights and the uncountable number of bugs that he has found and documented. Thank you very much Peter. Also thanks to the members of the Back Shed forum who have beta tested the Micromite firmware over the past few years and reported many, many bugs. Thanks guys. Micromite User Manual Page 2 Contents Introduction ............................................................................................................................. 4 Suitable Microcontrollers ........................................................................................................ 5 28-pin Micromite Connections ................................................................................................ 6 44-pin Micromite Connections ................................................................................................ 7 Programming the Firmware .................................................................................................... 8 Console Connection ............................................................................................................... 9 Quick Start Tutorial ............................................................................................................... 11 Using MMBasic..................................................................................................................... 13 Micromite Special Features .................................................................................................. 14 LCD Displays ........................................................................................................................ 18 Touch Support ...................................................................................................................... 20 Using an LCD Panel ............................................................................................................. 21 Micromite LCD Backpack ..................................................................................................... 24 Special Device Support ........................................................................................................ 26 Full Screen Editor ................................................................................................................. 32 Defining and Using Variables ............................................................................................... 34 Using the I/O pins ................................................................................................................. 38 Timing ................................................................................................................................... 41 Defined Subroutines and Functions...................................................................................... 42 Special Functions and the Library ........................................................................................ 47 Electrical Characteristics ...................................................................................................... 51 MMBasic Characteristics ...................................................................................................... 52 Predefined Read Only Variables .......................................................................................... 54 Commands ........................................................................................................................... 55 Functions .............................................................................................................................. 78 Obsolete Commands and Functions .................................................................................... 84 Appendix A – Serial Communications .................................................................................. 85 Appendix B – I2C Communications ...................................................................................... 89 Appendix C – 1-Wire Communications ................................................................................. 92 Appendix D – SPI Communications...................................................................................... 93 Micromite User Manual Page 3 Introduction The Micromite is a low cost Microchip PIC32 microcontroller programmed with the MMBasic firmware. MMBasic is a Microsoft BASIC compatible implementation of the BASIC language with floating point, integer and string variables, arrays, long variable names, a built in program editor and many other features. Using MMBasic you can use communications protocols such as I2C or SPI to get data from a variety of sensors. You can display data on low cost colour LCD displays, measure voltages, detect digital inputs and drive output pins to turn on lights, relays, etc. All from inside this cheap microcontroller. Everything is internal to the Micromite and it will run from a couple of AA batteries. The only extra component required is a 47 µF capacitor. The 28-pin dual in line version is particularly easy to use as it can be easily soldered or plugged into an IC socket. Even better, it costs just $4. In summary the features of the Micromite are: A fast 32 bit CPU with 256 KB of flash and 64 KB RAM running a powerful BASIC interpreter. 59 KB of non volatile flash memory is reserved for the program, 52 KB of RAM is available for BASIC variables, arrays, buffers, etc. This is sufficient for quite large BASIC programs up to 2500 lines or more. The BASIC interpreter is full featured with floating point, 64-bit integers and string variables, long variable names, arrays of floats, integers or strings with multiple dimensions, extensive string handling and user defined subroutines and functions. Typically it will execute a program at 30,000 lines per second. MMBasic allows the embedding of compiled C programs for high performance functions and the running program can be protected from being listed or modified by a PIN number. Nineteen input/output pins are available on the 28-pin chip and 33 on the 44-pin chip. These can be independently configured as digital input or output, analog input, frequency or period measurement and counting. Within MMBasic the I/O pins can be dynamically configured as inputs or outputs with or without pullups or pulldowns. MMBasic commands will generate pulses and can be used to transfer data in parallel. Interrupts can be used to notify when an input pin has changed state. Up to five PWM or SERVO outputs can be used to create various sounds, control servos or generate computer controlled voltages for driving equipment that uses an analogue input (eg, motor controllers). TFT LCD display panels using the ILI9341 and other controllers are supported allowing the BASIC program to display text and draw lines, circles, boxes, etc in 65,535 colours. Resistive touch controllers on these panels are also supported allowing them to be used as sophisticated input devices. These LCD panels typically cost US$7 and provide a low cost, high tech graphical user interface. Programming and control is done via a serial console (TTL voltage levels) at 38400 baud (configurable). Once the program has been written and debugged the Micromite can be instructed to automatically run the program on power up with no user intervention. Special software is not needed to develop programs. A full screen editor is built into the Micromite. This only requires a VT100 terminal emulator and can edit the whole program in one session. It includes advanced features such as colour coded syntax, search and copy, cut and paste to and from a clipboard. Programs can be easily transferred from another computer (Windows, Mac or Linux) using

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    95 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us