BASIC on Raspberry Pi Pico
  • BASIC Interpreter
  • BASIC with VGA Display
  • BASIC with WiFi & Internet

  • Maximite Family
  • Colour Maximite 2
  • Original Colour Maximite
  • Monochrome Maximite
  • The Maximite Story

  • Micromite Family
  • Micromite Summary
  • Standard Micromite
  • Micromite Plus
  • The Microbridge

  • Micromite LCD Backpack
  • Micromite LCD Backpack
  • Air Quality Monitor
  • DDS Signal Generator
  • Super Clock
  • Boat Computer MkII
  • Parking Assistant

  • Other Projects
  • Pico Gamer Console
  • Precision Analog Clock
  • Watering Controller
  • Windows/DOS MMBasic
  • ASCII Video Terminal
  • Utility Power Supply
  • Precise Voltage Reference
  • ISM Band Scanner
  • Game of Pong
  • Simple GPS Based Clock

  • Useful Techniques
  • 3D Printed Cases
  • Measuring Capacitor ESR
  • Surface Mount is Easy
  • Programming PIC Micros
  • Custom PC Boards
  • The Gerber Format

  • General Articles
  • Problems in Open Source
  • Hantek DSO-2250 Scope
  • Rigol DS1000 Scope
  • Brickbats

  • WEB Site
  • Home
  • Old or Obsolete Projects
  • About



  •  

     

     

    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0)

    Building the Original Colour Maximite

     

    This page describes the circuit of the original Colour Maximite and how it works.  It then goes on to describe two different methods of building it into a working computer.

    For more information on the original Colour Maximite click on these links:




    The Colour Maximite consists of just a single chip (the Microchip PIC32) that drives everything and does all the work including colour VGA, keyboard, USB and running your BASIC program. The only other significant items in the circuit are the power supply (two simple regulators) and the battery backed clock.

    This is illustrated in the circuit diagram below (click on the image for a larger view):

    The PIC32 used in the Colour Maximite has 100 pins and is the 14x14 mm TQFP package.  This was chosen because the pins have a reasonable spacing and can be soldered by hand.

    You can use one of two variants of this chip, either the PIC32MX695F512L-80I/PF or the PIC32MX795F512L-80I/PF.  The only difference is that the second chip includes a CAN interface which we are not using anyway. Both chips run at 80MHz, have 512KB of flash program memory and 128KB of RAM. It is this huge RAM capacity along with framed SPI that makes the Colour Maximite possible, most high powered chips have only 16K or 32K of RAM and that is insufficient to implement a BASIC interpreter with the capability of that used in the Maximite.

    At the top right hand corner is the VGA driver.  For each colour this consists of a resistor and diode who's purpose is to clip the video to 0.7V and approximately match the monitor's input impedance.  The line connected to pin 9 of the VGA connector is used to select composite video (see Composite Video below).

    The method of generating the video is the same as in the original (monochrome) Maximite, the only difference is that we have three channels for red, green and blue.  This technique for producing colour was developed by Dr Kilian Singer at the University of Mainz in Germany who modified a monochrome Maximite for his prototype.

    The video is generated by standard SPI peripherals within the PIC32 chip.  They are continuously fed with data by the DMA circuitry which reads a section of memory and feeds the data to the SPI peripherals so that there is a constant stream of ones and zeroes being clocked out of the chip.  These bits represent the video signal for a horizontal line with each bit being a pixel.  The beauty of this scheme is that it happens independently of the CPU which only needs to write the required pixel data to the allocated section of memory and service an interrupt for the horizontal sync pulse. 

    The technique is described by Lucio Di Jasio in his book "Programming 32 bit microcontrollers in C” which is well worth reading if you are interested in learning more about programming for the PIC32.

    An important part of the circuit is pins D9, D14 and G9 which feeds the horizontal sync pulses (on pin D2) back to the SPI peripherals so that the start of the data stream is synchronised to the pulse.  This removes any jitter that may be caused if the CPU was used to start the data stream and results in a very steady image on the screen.

    Composite Video Output

    You can also get composite video output if you need it (monochrome only).   This is accessed via the VGA connector with this adapter cable. When this cable is plugged in MMBasic will detect (on power up) that pin 9 is connected to ground and will switch to composite output (instead of VGA).

    In versions 4.0A and later of MMBasic this feature is disabled by default and to enable it you must run the command:

    CONFIG COMPOSITE PAL or CONFIG COMPOSITE NTSC.  Either of these commands will enable the composite detect on pin 9 and set the correct timing for the video.  The command only needs to be run once and will be remembered even when the power is removed.

    I/O Connectors

    The I/O connectors (20 on the back panel and 20 on the Arduino compatible connector) are around the bottom of the chip in the diagram. Note that other than the standard protection inside the PIC32 these pins are unprotected from damaging voltages.  Where static electricity is concerned the PIC32 is well protected by reverse biased diodes integrated on the chip but you still need to guard against a large static discharge that could blow these diodes.  Generally a high value resistor to ground on floating inputs will protect against this. 

    Another danger is SCR latch up which can be caused by a large current (>20mA) being forced through the protective diodes.  This could happen if the Maximite is connected to another circuit that is powered up before the Maximite and in this case the best protection is to include a series resistor to limit the current on any susceptible inputs.

    This reference will tell you about both issues and the circuit on the right illustrates the suggested protection measures.

    Note that in a most practical situations the input circuitry (be it an accelerometer, voltage divider, etc) will provide enough protection so you do not have to go overboard on the subject.

    Sound or PWM Output

    The sound output can be used to play stereo music, sound effects or sine wave tones using MMBasic's stereo music synthesiser.  The synthesiser is a complex software routine written by Pascal Piazzalunga of France and is built into version 4.X of MMBasic.

    The output on CON9 is pulse width modulated (PWM) with a carrier of about 100KHz.  The 1K resistor and 47nF capacitor in each channel create a low pass filter which averages the output and removes most of the carrier.  The following 4.7K and 1K resistors reduce the signal level to 0.5V suitable for input to powered loudspeakers.

    You can also drive a set of earphones. The headphone coil will act as the low pass filter so you can omit resistors R13 to R16 and capacitors C15 and C16. To avoid damaging your hearing you should change R7 and R8 to 4.7K or higher.  If you can live with a low volume you can even drive an efficient speaker. Omit the same components as for headphones and change R7 and R8 to 22 ohms..

    The sound output can also be used to generate two independent analogue voltage outputs controlled by the MMBasic PWM command.  For PWM usage you need a much lower filter frequency so you should replace the values shown on the schematic with something more suited to your application. This can be calculated using the formulae:
        R * C = 1/(2 * π * f)

    Where R and C are the values in the low pass filter and f is the roll off frequency. Typical values would be 4.7K and 330nF which would give enough response for the output to quickly change while eliminating most of the carrier frequency.

    Battery Backed Clock

    IC4 (a Maxim DS1307) provides the battery backed clock. This is optional, if the clock area is not populated MMBasic will use its internal clock which is reset to zero on power up. If you do fit this chip (and associated components) MMBasic will recognise that it is there and will place a message under the startup logo displaying the current time or an error message if the time has not been set.

    Boot Load Switch

    The boot load button is connected to pin 47 which has an internal pullup resistor enabled and is used to initiate the bootload sequence if the button is pressed on power up.   When in the bootload mode the Maximite will appear as a different USB device (a HID device) and wait for new firmware to be downloaded via the USB interface.  A Windows program will be supplied with any updates and it is this software that knows how to communicate with the Maximite and reprogram the firmware while it is in the boot load mode.

    The crystal X1 connected to pins 63 and 64 provides the main clock for the chip.  This is multiplied internally to provide the 80MHz clock for the processor core in the PIC32 chip.

    The USB interface (CON2) is simple enough, it directly connects to the PIC32 as all the required components (pullup resistors, transceiver, etc) are integrated in the chip.   The firmware monitors the voltage on pin 54 and uses that to detect when the USB interface is connected to a host computer.

    Pin 85 on the top of the PIC32 in the schematic is connected to the internal 1.8V regulator that supplies power to the high speed processing core of the chip.  C10 provides noise filtering for that regulator and it is important that the capacitor specified in the parts list is used (10μF 16V Ceramic X5R dielectric).  For example, Element14 1845747.  Pin 30 is the power supply for the analog portions of the chip and R1 in conjunction with C11 provides some isolation from the main 3.3V supply (which is quite noisy).

    Prototype PCB - Note that the final PCB is a little different around IC3 and the SD card connector


    The power supply is very simple providing +5V (which is only used by the keyboard) and +3.3V which is used by the PIC32 and the SD card.  Diodes D2 and D3 are used to automatically select the external power supply or the USB supply as the source of 5V for the rest of the circuit.  There are many 100nF capacitors on the output of the 3.3V supply and these are distributed on the PC board close to the power pins of the PIC32 where they help reduce transients on the power line.

    Construction

    You can buy the Colour Maximite fully assembled and tested from Circuit Gizmos.  However if you want to build your own the simplest way is to buy the kit from Altronics (K9555) as it includes everything including the original magazine articles which describes the construction in detail.

    You can also download the Colour Maximite Construction Pack at the bottom of this page.  It contains all you need to build the Colour Maximite including the circuit, parts list, PCB layouts, firmware, etc. You can make your own board or send the Gerbers to a PCB fabricator who will make them for you. The blank PIC32 chip can be purchased from microchip.com or futurlec.com. All the other parts are generic and can be sourced from many suppliers.

    A better (and cheaper solution) is to buy The PCB board and the PIC32 chip from Silicon Chip magazine (see below for details)

    Construction takes an hour or two and don't be put off by soldering surface mounted devices, it is easy, see my web page Surface Mount is Easy.

    Sourcing the Parts

    All the parts are generic and can be sourced from many places, refer to the parts list in the Construction Pack for typical suppliers and part numbers.   To make the process easy for international enthusiasts I have mostly listed part numbers from Element14 (Farnell) but all the parts are available from multiple suppliers.

    The printed circuit board can be purchased from Silicon Chip magazine (code nbr 07109121).  The preprogrammed PIC32 chip is also available from Silicon Chip (part PIC32MX695F512L-80I/PF).

    You can also purchase the PIC32 chip from Microchip direct or Element14 but in that case you will need a PIC programmer to load the firmware+bootloader onto the chip.  If you are sourcing your own chip and using my PCB design make sure that you purchase the chip in the larger 14 x 14mm package (ie, with the /PF suffix) as the board is designed for that size.

    The SD card socket is the Hirose DM1A which is available form many suppliers including Mouser, RS Components, Element14, etc. I tried to make the PCB footprint compatible with a number of other manufacturers but the Hirose is the only connector that I have tested and I recommend that you stick with that.

    The high density VGA connector is also available in a number of different footprints so I used the most popular which is overall 22mm in depth (front to back). The 10µF capacitor (C3) connected to pin 85 of the PIC32 must be a ceramic with XR5 dielectric. Both of these can be purchased from Element14 and others.

    You can replace the 3.3V regulator with a different device (with the same pin configatation) but I selected this component (TC1262) because of its low dropout voltage (you need less than 0.8V) and its high accuracy.  Because the 3.3V rail is used as the reference when MMBasic measures a voltage the accuracy of the measurement is dependent on the accuracy of this regulator.

    For the battery in the battery backed clock section I designed the PCB to accomodate two options. You could use a battery holder and a coin battery, or you could use a battery with solder tabs. The PCB layout will accommodate either option.  All the components for the battery backed clock are available from futurlec.com and, if you are adding the clock to a pre built Colour Maximite, I recommend that you order all the parts from them as they are cheap and their freight charge is reasonable.

    The box is reasonably generic and is available from Altronics and Jaycar in Australia and Element14 and others overseas.  I made the front panel by printing the artwork (included in the Construction Pack) onto adhesive paper using an ink jet printer, then covered the paper with a thin layer of adhesive plastic of the type used to protect book covers.  When trimmed and stuck on the front panel the result is very professional.

    Loading the Firmware

    When you buy a PIC32 chip from Microchip is is supplied completely blank.  So, the first thing that you must do is program the chip with the firmware included in the construction pack (available at the bottom of this page).  This operation is illustrated on the right. 

    This firmware must be loaded by a PIC programmer (such as the PICKit 3) and includes both the main program (including MMBasic) and a boot loader.  The boot loader sits in a special region of memory and is used to upgrade the firmware at a later date.

    You only have to bother with this stage if you bought the PIC32 chip direct from Microchip or similar.  If you bought the Colour Maximite from a kit supplier they will have already programmed the chip for you, so you can skip that step.

    Once the boot loader is in place you can update the firmware via the USB interface and a Windows computer.  Full instructions will be included with the update but in essence the boot loader is run at power up and its job is to download the new firmware and reprogram the main program memory (as illustrated on the left).

    Because the boot loader is located in a protected area of memory it is completely unaffected by failures when programming the main memory. For example, if you loose power or accidentally unplug the USB cable while programming you can just go back to the beginning and restart the boot load process – the boot loader will never be corrupted or lost.

    The first thing you should do after building the Colour Maximite is go to the main page (link) and download the latest version of the firmware.  You can update the firmware in the Colour Maximite as many times as you like, for example to test a an earlier version or experiment with a special version.

    An Alternative Colour Maximite

    If you like the idea of a Colour Maximite but want to keep the cost and construction effort to a minimum one option is to build it around the UBW32 board.

    The UB32 is a small PC board holding the 100-pin version of the PIC32 microcontroller and its associated components (power supply, crystal, USB connector, etc). Almost all of the connections to the microcontroller are brought out as solder pads on the edge of the board making it easy to use this board as the core of a Colour Maximite.

    The standard Colour Maximite firmware will load and run on this board just the same as if it was running on a Colour Maximite. All you need is a few extra components (some resistors and diodes) and the necessary connectors (VGA, mini DIN and SD card) and you have a full Colour Maximite at a reasonable cost. The Colour MMBasic firmware can be loaded using the standard bootloader supplied with the UBW32 and you always have the option to revert back to the factory supplied UBW32 firmware if you needed to.

    The circuit is essentially the same as for the Colour Maximite without the power supply, crystal and similar components (which are part of the UBW32).   All details including the circuit and instructions are included in the file "Colour Maximite on the UBW32" which can be downloaded below.

    Mick Gulovsen has designed a low cost (about $6) circuit board that holds the extra components required and he has even written a comprehensive assembly manual.   See this link for more details (for prices look in the folder named "00 Prices & Contact Details").

    The UBW32 board itself can be purchased from http://sparkfun.com and dontronics-shop.com.

    Downloads

    Maximite Construction Pack DOWNLOAD
    Colour Maximite on the UBW32 DOWNLOAD


    For more information on the original Colour Maximite click on these links:

    Other useful pages: