chipKIT® Development Platform

Inspired by Arduino™

ChipKIT BB32

Posted 2013-06-21 00:58:10 by Majenko

This is an implementation of a  ChipKIT platform on a Solderless Breadboard, using the Microchip PIC32MX250F128B that is now available with a Bootloader preinstalled. This implementation is based on the Digilent ChipKIT DP32, but modified to make it cheaper, flexible and cost effective for Hobbyists and Students in 3rd World Countries such as my own. (Shipping costs and import duties can be crippling). The circuit uses the Right Hand side of a Standard Solderless Breadboard and is designed for the smallest possible footprint. This means that more than half of the breadboard, on the Left Hand side, is available for conducting experiments and constructing interface modules, as the image shows.

![att:3]

Hardware:

Here is a closeup of the circuit itself,  it should provide sufficient information for most people to be able to build the circuit, assuming they have built circuits on a Breadboard befor.  For the wiring I suggest solid core telephone cable. Offcuts or discarded cable can often be found  on building sites or during office renovations and provide several colours of insulation. CAT5 cable could also be used.  As this is a semi permanent installation on the Breadboard I recommend that the wires be cut and bent to size for a neat and reliable construction.

![att:4]

Some notes on the components used:

  • The Voltage Regulator is a LM1117-33, the Pin marked Adj is actually the Ground Pin.
  • The Electrolytic Capacitor is a 10uF, oriented so that Positive goes to the Center Pin of the regulator.
  • The 10uF capacitor on the PIC32MX is a Low ESR tantalum capacitor, negative to Ground.
  • The 2 Capacitors on the 8Mhz Crystal are 22pF ceramics, but any close value should do, it may even oscillate without them on a breadboard.
  • All other Capacitors are 100nF (0.1uF) ceramics, any 100nF capacitors will do.
  • All Resistors are 1K with the exception of the one on the LDR which is 22K. (it forms a voltage divider so choose one that best matches your LDR Characteristics).

Features:

USB Power is regulated down to 3.3 Volts for the benefit of the PIC32MX Device. The Breadboard may be powered via USB or the ICSP Header, but it has no protection diodes. It is advisable not to power it via the ICSP Header when plugging it into a USB port.  If it is powered via the ICSP Header,  set the voltage to 3V3 only. A 5V rail is provided as the last row on the Right, to facilitate interfacing to 5V devices such as LCD Displays. This is unregulated 5V directly from the USB Header. The layout is orientated so that the 5V Tolerant PINS are located near to the 5V rail. The majority of the ChipKIT PINS are located to the Left of the device and are readily accessible by the empty portion of the Breadboard. This block of PINS includes the Analog Pins. An ICSP Header is included and serves several roles. It may be used to Install or Replace the Bootloader, Program the board with MPLAB or to connect a PICKit Serial Analyzer / Logic Analyser or UART Tool to assist in Experiments and Debugging. It is only permanently connected to the power bus, use temporary jumper leads to connect to  the appropriate breadboard rows, depending on your application. The LED's are connected to ChipKIT PIN# 13 and 14, so that the Standard Arduino Blink Sketch and others should compile and run without modification. When addressed in MPLAB they are RB2 and RB3 respectively. The Prog Button is available for use in Sketches (User Programs) as ChipKIT PIN# 17 or RB4 in MPLAB. ChipKIT PIN Numbers are indicated on the Device and Repeated on the Breadboard. Users may find it useful to print out the above Image as a reference whilst using the board. The Key is as follows:

  • The Numbers correspond to ChipKIT PIN# not Microchip Port or Pin Numbers i.e. digitalRead(17) would read pin 9 (RB4) of the PIC32MX package, analogRead(A0) would read pin 24 (RB13).
  • Numbers in RED are 5V tolerant Pins.
  • Numbers in GREEN are both Analog and Digital capable PINS and will work with both the digitalRead() and the analogRead() functions.
  • Analog Channel numbers are shown on the Breadboard Overlay along with the corresponding Digital PIN numbers.
  • Numbers with a ~ symbol may be connected to the OC Registers and used as Hardware PWM PINS.

Software:

Digilent have kindly supplied a Zip file that contains all the files and Instructions  needed to update your MPIDE to support the ChipKIT DP32. The same files will work with this BB32 implementation. http://www.digilentinc.com/Data/Products/CHIPKIT-DP32/DP32_variant.zip It should not, however, be necessary to modify the MPIDE if you are running a newer test version.  I have used the BB32 successfully with both mpide-0023-windows-20130602-test and mpide-0023-windows-20130609-test. If you have a blank device, Digilent also provide a copy of the Bootloader .HEX file.  http://www.digilentinc.com/Data/Products/CHIPKIT-DP32/chipKIT_Bootloader_DP32.zip You will need a PICKit3 or better to install it on the Device, but it can be done with the Breadboard in situ by connecting the ICSP Header pins to the appropriate PIC Pins as follows:

  • Mclr to PIC PIN# 1
  • Dat to PIC PIN# 4 (Chipkit PIN# 11)
  • Clk to PIC PIN# 5 (Chipkit PIN# 12)

If you have a PICKit3 then you will already be familiar with MPLAB, but in a nutshell, start a blank project, select your device as PIC32MX250F128B, File->Import the bootloader.hex file. Set Programmer->PICKit3 and then use the Program Button in the toolbar to upload. Disconnect the PICKit, Plug in the USB cable and if all is well the device will enumerate and you will get a new hardware found notification. If windows requests a driver it is located in the MPIDE directory: C:\....\mpide-0023-windows-20130609-test\drivers\chipKIT Drivers It should install as a stk500 device.

Getting started:

Run MPIDE.EXE from the folder you unziped too. select the Board:

Tools->Board->ChipKIT-> ChipKIT DP32

then

Tools->Serial Port and select the Port that was created by the stk500 driver

When in Bootloader Mode LED2 (RED) will flash at ~ 4Hz To test the Hardware run this Sketch: BB32_test.pde //_________________________________________________________________ // //  BB32_Test.pde // //  C.A.Roper - 2013/07/17 // //  Hardware confidance test Software for the CHIPKit-BB-32 //  CHIPKit compatable Breadboard circuit based on PIC32MX250F128B. // //  Tests Digital Output to LED's //  Teats Digital Input from Prog Button //  Tests Analog Input from LDR //  Tests Serial Output Via USB //  Tests Serial Input from USB //_________________________________________________________________ // int Last; int State; int Character; void setup() { Serial.begin(19200); pinMode(17, INPUT); pinMode(13, OUTPUT); pinMode(14, OUTPUT); } void loop() { if(Serial.available()) if(digitalRead(17)) if(State != Last) { digitalWrite(13, !State); digitalWrite(14, State); Serial.println(analogRead(A0)); } Last = State; delay(250); } Whilst uploading LED1 (Green) will flicker. Press the Prog Button to toggle the LED's and open the Serial console to see the ADC Reading and to issue commands. To return to Bootloader mode and upload other Sketches:

  1. Close the Serial Monitor if open.
  2. Press and hold the Prog Button.
  3. Press and release the Reset Button.
  4. Release the Prog Button.

The Green LED will go out and the RED LED will Flash. Thats it, all that remains is to have fun with your shiny new ChipKIT. Don't forget to Join the ChipKIT community and  read about new ChipKIT developments and uses. Cheers Chris http://caroper.blogspot.com/