This is an old revision of the document!
Table of Contents
ChipKIT Pi
The ChipKITPi is a PIC32, MIPS32 based add-on board for the Raspberry Pi Model B.
It is designed to be used with the Multi-Platform Integrated Development Environment but this isn't a requirement.
RPi GPIO header (RPi-Connect)
JP5 +---J4---+ NC 01 02 GPIO0/GPIO2 GPIO1/GPIO3 03 04 NC GPIO4 05 06 GND GPIO18 07 08 GPIO17 GND 09 10 GPIO21/GPIO27 GPIO23 11 12 GPIO22 GPIO24 13 14 3V3 GND 15 16 GPIO10 GPIO25 17 18 GPIO9 GPIO8 19 20 GPIO11 GPIO7 21 22 GND +--------+
I/O headers (Arduino 3V3 compatible)
JA1 PIC32MX250F128B === =============== JA4 POWER PIC32MX250F128B NC NC ========= =============== G GND 8,19,27 GND RESET 1 !MCLR 13 D13 SCK 25 RB14 3V3 13,28 3V3 12 D12 MISO 17 RB8 5V0 11 D11 MOSI PWM 3 RA1 GND 8,19,27 GND 10 D10 SS 16 RB7 GND 8,19,27 GND 9 D9 PWM 22 RB11 JP12 VIN 8 D8 21 RB10 JP13 JA2 === JA3 ANALOG 7 NC ========== 6 NC A0 2 RA0 JP15 5 NC A1 26 RB15 JP11 4 NC NC 3 D3 INT1 PWM 24 RB13 NC 2 D2 INT2 14 RB5 SDA 6 RB2 1 D1 TXD 11 RB4 SCL 7 RB3 0 D0 RXD 12 RA4
LED/SW/JTAG
LED PIC32MX250F128B === =============== LED3 13,28 3V3 LED1 2 RA0 JP15 LED2 26 RB15 JP11 RX1 12 RA4 TX1 11 RB4 SW PIC32MX250F128B == =============== BOOTLOAD-EN 18 RB9 RESET 1 !MCLR JTAG PIC32MX250128B JTAG PIC32MX250128B ==== ============== ==== ============== 6 8,19,27 GND 5 14 RB5 JP10 4 18 RB9 JP6 3 17 RB8 JP8 2 13,28 3V3 1 16 RB7 JP14
Orientation is ICSP port to the left and JTAG port to the right.
ICSP
PIC32MX250F128B RASPBERRY Pi =============== ============ 1 !MCLR --330R-- GPIO4 4 PGD1 -------- GPIO15 Rx 5 PGC1 -------- GPIO14 Tx
ICSP is wired internally to the chipKIT Pi and no other wiring is necessary.
Pickle Microchip PIC ICSP
Using Pickle we can interrogate the chip and upgrade it's firmware.
Configuration
DEVICE=RPI SLEEP=1 BITRULES=0x4F00 VPP=4 PGC=14 PGD=15 PGM=255
The BITRULES release the RPi GPIOs after programming and return GPIO14/15 to the UART mode of operation for uploading objects to the bootloader.
Detect chip
p32 id [1D000000] [PROGRAM] 00010000 WORDS [1F80F220] [DEVICEID] 26600053 PIC32MX270F256B [1FC00000] [BOOT] 00000300 WORDS [1FC00BF0] [DEVCFG3] 0FFFFFFF [1FC00BF4] [DEVCFG2] FFF979F9 [1FC00BF8] [DEVCFG1] FF6A0E5B [1FC00BFC] [DEVCFG0] 7FFFFFFB [PE] RIPE_11_000301.bin
Advanced configuration explains how to enable the program executive (PE) to enable high speed ICSP.
Firmware update
Here we will program the firmware for a PIC32MX270F256B with a 48MHz clock.
Install the PIC32 compiler for the RPi.
hg clone http://hg.kewl.org/pub/chipKITPi cd chipKITPi/firmware make p32 program CHIPKIT_PI_MX270_48.hex Total: 2900 p32 verify CHIPKIT_PI_MX270_48.hex Total: 2900 Fail: 0 cd ..
Demo
Upload LED demo to flash using the bootloader firmware installed above.
cd led make
Hold BOOTLOAD-EN and press RESET, release BOOTLOAD-EN.
kload program /dev/ttyAMA0 led.hex 24
This uploads the hex file using 24-bit addressing mode required by the AVR boot loader.