PIC32 Pinguino DIY

From Pinguino
Jump to: navigation, search
Language: [[::PIC32 Pinguino DIY|English]]


Features

This board is built with a µController of the 32-bit family PIC32MX.

Characteristics of the board

  • 32-bit MIPS M4K core running at 40MHZ
  • 128kB (MX250) / 32kB (MX220) Flash
  • 32kB (MX250) / 8kB (MX220) SRAM
  • 19 digital I/O pins with 9 shared analog inputs
  • 10 mA source/sink on all I/O pins
  • 2 UART for serial communication
  • 5 PWM outputs
  • 9 analog inputs
  • 10 bit ADC
  • Peripheral Pin Select for mapping digital peripherals to various I/O ports for design flexibility
  • Hardware RTCC provides clock, calendar & alarm functions
  • Charge Time Measurement Unit (CTMU) supports capacitive touch devices
  • Operating voltage 2.3 - 3.6V , 5.5V tolerant digital inputs.

Board overview

Pinguino32-DIY-schematic-corrected june 2013.png

There is one reset button and one user button. When reset is pressed the board

This board can be powered by the USB connector (5V). It can also be powered by an external power supply (>5V).

TO BE DONE: schematic of a simple LDO voltage regulator with LP2950-3V3 or MCP1702

Building Instructions

Bill Of Components

Resistors

Part Value Color Code
R1 10 kilo Ohm brown - black - orange
R2 330 Ohm orange - orange - brown
R3 4,7 kilo Ohm yellow - purple - orange
R4 10 Ohm brown - black - black

Capacitors

Part Value Comment
C1 100nF ceramic, marked as 104
C2 100nF ceramic, marked as 104
C2 100nF ceramic, marked as 104
C3 100nF ceramic, marked as 104
C4 100nF optional ceramic, marked as 104
C5 100nF ceramic, marked as 104
C6 10µF polarized electrolytic, marked as 10uF
C8 22pF ceramic, marked as 22
C9 22pF ceramic, marked as 22
C10 10µF optional, polarized electrolytic, marked as 10uF

Diodes

  • D1 5mm Red LED (+/anode = long lead)

Connectors

  • JP1 USB Type-B Female

(*) Use 2.54mm Single Row Male Header Strip if you want a breadboard-ready Pinguino, Female if you want it like an Arduino.

Others

  • SW1 Push button (Reset)
  • SW2 Push button (user button)
  • X1 8 MHz crystal (low profile)
  • U1 PIC32MX250F032B or PIC32MX220F032B (28-pin DIP package)
  • U2 7833 voltage regulator
  • Breadboard / PCB

Construction

On a breadboard

Pinguino 32 diy on a breadboard 03072012-01.jpg

This is my version of the Pinguino32-DIY on a breadboard. I connected a 32kHz crystal to pins 11 and 12 for using the internal RTC. The wire legs of the crystal are very thin so I soldered two 0.6 mm wires to it.

Why use an external usb2serial converter? Why not use CDC for communication with the board? Well, I'm using putty as terminal software on Windows and after a reset the virtual COM port loses connection. I have to restart putty every time and that is annoying.

On a PCB

PCB Silkscreen

PCB and silkscreen as PDF-document

ICSP Programming (if required)

In-Circuit Serial Programming (ICSP) is a way to upgrade/burn the Pinguino's firmware (bootloader).

Upgrading/burning the firmware is necessary only in two cases :

  1. you made your Pinguino yourself, you need to burn the bootloader only once.
  2. (in the unlikely event that) you crashed your Pinguino board.

If you bought a commercial board, the bootloader has been already burnt.

The .hex file for the bootloader can be downloaded at http://pinguino32.googlecode.com/svn/ide/x.4/extra/bootloaders/32bit/PIC32MX250F128B_-_HID_Bootloader.hex

The bootloader of the Pinguino32 is not open source.

Quote from a forum post of jpmandon: "Pinguino32 bootloader is based on the Microchip Application Library. If you carefully read the license of this library, you can understand it is not a GPL code but a licensed code which can only be used on Microchip product. So we decided to publish only the hex file to respect this license."

In this thread I gathered some information related to the bootloader.


Using a PICkit-like programmer

Connect the ICSP cable to the Pinguino pins (see table below) and upload the firmware with (for ex.) MPLABX or with the Microchip Integrated Programming Environment (MPLAB IPE) that comes with MPLABX.

ICSP Connector Microchip name Pinguino name Pin on chip
1 MCLR RST 1
2 VDD 3.3V -
3 GND GND -
4 PGD D12 4
5 PGC D11 5
6 NC NC -

Testing the board

TO BE DONE

First Programs

TO BE DONE

Example 1 : with PIC registers

void setup()
{
   CODE
}

void loop()
{

  CODE

}


Troubleshooting

Problem(s) with your Pinguino hardware?

Find help in the Forum here.

Or take a look at this list of posts to common problems.

Before posting your problem read this.

Pins

Pin name Label Digital I/O up to 5.5V tolerant Analog input Other Pin on Chip Microchip name
0 D0 / A0 Yes No Yes 26 RB15/AN9/C3INA/RPB15/SCK2/CTED6/PMCS1
1 D1 / A1 Yes No Yes PWM 25 RB14/CVREFOUT/AN10/C3INB/RPB14/VBUSON/SCK1
2 D2 / A2 Yes No Yes PWM 24 RB13/AN11/RPB13/CTPLS/PMRD
3 D3 Yes Yes No 18 RB9/TDO/RPB9/SDA1/CTED4/PMD3
4 D4 Yes Yes No 17 RB8/TCK/RPB8/SCL1/CTED10/PMD4
5 D5 Yes Yes No 16 RB7/TDI/RPB7/CTED3/PMD5/INT0
6 D6 Yes Yes No PWM 14 RB5/TMS/RPB5/USBID
7 D7 Yes No No PWM 12 RA4/SOSCO/RPA4/T1CK/CTED9/PMA1
8 D8 Yes No No PWM 11 RB4/SOSCI/RPB4
9 D9 / A9 Yes No Yes Serial Tx1
RTCC pin
7 RB3/AN5/C1INA/C2INC/RTCC/RPB3/SCL2/PMWR
10 D10 / A10 Yes No Yes Serial Rx1 6 RB2/AN4/C1INB/C2IND/RPB2/SDA2/CTED13/PMD2
11 D11 / A11 Yes No Yes Serial Rx2
ICSP: PGEC1
5 RB1/PGEC1/AN3/C1INC/C2INA/RPB1/CTED12/PMD1
12 D12 / A12 Yes No Yes Serial Tx2
ICSP: PGED1
4 RB0/PGED1/AN2/C1IND/C2INB/C3IND/RPB0/PMD0
USB D+ D+ No No No USB 21 RB10/PGED2/RPB10/D+/CTED11
USB D- D- No No No USB 22 RB11/PGEC2/RPB11/D-
Vusb3V3 Vusb No No No USB 23 VUSB3V3
Reset Rst No Yes No Reset switch / ICSP MCLR 1 MCLR

Further information

If you want to go further and dive deeper into the basics here are a number of links where you can get additional information.