PIC18F26J50 Pinguino

From Pinguino
Jump to: navigation, search
Language: English  • magyar

Important Warnings for all Pinguino Users

Important Warnings: Please read the important warnings at least once!


This version of the Pinguino board is built with a Microchip PIC18F26J50 microcontroller. It works with an 8 or 20 MHz crystal and is USB 2.0 compatible.

The characteristics of this board are:

  • 8-bit 12 MIPS processor core running at 48Mhz
  • 64K Program Flash Memory
  • 3800 RAM bytes
  • 17 digital input/output with 5 shared analog inputs,
  • 2 UART for serial communications,
  • 2 fast PWM output (3000 Hz),
  • 5 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.0 - 3.6V, 5.5V tolerant digital inputs.

The Microchip datasheet, errata, application notes, code examples and software libraries for the PIC18F26J50 are available here.

CAD Files (Kicad)

KiCad is an EDA software suite for the creation of professional schematics and printed circuit boards up to 16 layers. KiCad runs on Windows, Linux and Apple OS X and is released under the open-source GNU GPL v2 free of charge. With Kicad you can do the following :

  • Schematic design.
  • Netlist creation in multiple formats (PCBNew, OrCAD, CadStar, Spice, etc...).
  • PCB design
  • 3D visualization of your PCB
  • Fabrication outputs generation (Gerber, drill files and whatever can be needed to manufacture a PCB.)

For a more detailed explanation please refer to the official Kicad site.

Kicad Schematics and PCB of the Pinguino 26J50 can be found here.

For a better result we use libraries, modules en 3D packages from Walter : http://smisioto.no-ip.org/elettronica/kicad/kicad-en.htm

Board Overview


There is one switch to reset the board. When reset is held, the board is in bootloader mode waiting for an upload from the development computer for 5 seconds. After 5 seconds, the current program in memory is run.

This board can be powered by the USB connector (5V), the Zener diode gives 3.3V to the chip. It can also be powered by an external power supply (>5V).

Building Instructions

Bill Of Components

  • R1 470 Ohm (Yellow - Purple - Black - Black)
  • R2 150 Ohm (Brown - Green - Brown)
  • R4 10K Ohm (Brown - Black - Orange)
  • R5 470 Ohm (Yellow - Purple - Black - Black)


  • C1 22pF (marked as 22)
  • C2 22pF (marked as 22)
  • C3 10uF (polarized, marked as 10uF)
  • C4 100nF (marked as 104)
  • C5 100nF (marked as 104)


  • D1 3mm Red LED (+/anode = long lead)
  • D2 BZX85C3V3 (3.3V Zener Diode, NB: black band denotes cathode)


  • JP1 USB Type-B Female
  • K1 PWM (3-pin 2.54mm header strip *)
  • K2 Power (3-pin header strip *)
  • P1 Analog (6-pin header strip *)
  • P2 Digital (8-pin header strip *)
  • P3 UART (2-pin header strip *)
  • U1 DIP28 socket (or 2x14-pin round female header strip)

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


Before you start soldering

  • Please read this before soldering.

The PCB has 2 sides. One is the component side (below):


The other one is the solder side (below):


On the component side of the board, identify the holes corresponding to the component's leads. Insert the leads in these holes and slightly bend them on the other side of the board so that the component does not fall off when the board is turned over for soldering.

Turn the PCB over and put it on a flat and dry surface with component side facing down.

Hold the solder wire at the interface of any one of the leads and its pad and touch it with the soldering iron tip. The solder will melt and cover the pad within 3 seconds. Retract the soldering iron tip and the solder wire. Repeat this process to solder the remaining leads of the component.

For more info on soldering, see here.


Populated component side


Populated solder side


Important Note: The longer pins of the male pin headers go through the PCB holes so that you can put the completed Pinguino board on a breadboard. Experience suggests that you should use a pair of pliers or the method in the photos below to push the short end through the plastic header to make the long end of the pins longer, otherwise you may not be able to securely plug the Pinguino into a breadboard without it "popping out".

  • Place and solder all the pin-header connectors.
  1. D0 to D7 (8-pin)
  2. D9 and D8 (2-pin)
  3. Power (3-pin)
  4. D10 to D12 (3-pin)
  5. RST, A0 to A4 (6-pin)
  • Place and solder all the resistors. Resistors are not polarised, so it does not matter in which direction they are placed, but for aesthetic purposes it makes sense to have them all point in the same direction. Trim the wires.
  • Place and solder the BZX85C3V3 diode. The (black) band on the diode must be at the side of the white band on the PCB silkscreen (white print on the PCB). Trim the wires.
  • Place and solder the two 22pF capacitors (marked as 22). These capacitors are not polarised, so it does not matter in which direction they are placed, but it makes sense to place them so that you can still read their markings. Trim the wires.
  • Place and solder the 8- or 20 MHz crystal. Trim the wires.
  • Place and solder the 2 x 14 round female header strip (as a DIP28 socket).
  • Place and solder the two 100nF capacitors (marked as 104). These capacitors are not polarised, so it does not matter in which direction they are placed, but it makes sense to place them so that you can still read their markings. Trim the wires.
  • Place and solder the switch button. Even if they look to be square, the four leads are not, so take extra care to insert the switch the right way round.
  • Place and solder the LED. This is a polarised part so the shorter lead must be put connected to GND. In other words: insert the shorter wire in the hole nearest to the edge of the PCB. Trim the wires.
  • Place and solder the polarised 10uF electrolytic capacitor. The white stripe on the side of the capacitor must be at the side of minus sign in the PCB silkscreen (in other words, next to the 22pF capacitors). Trim the wires.
  • Place and solder the USB connector. Bend the two metal mounting tabs before soldering.
  • Place the PIC18F26J50 microcontroller in its socket. This will be easier if you first bend the two rows of pins a little bit in towards each other. Note that the microcontroller chip has a notch at one end. This notch must be at the end where the button switch is located.

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 or you bought a board from the Pinguino Shop, the bootloader has been already burnt.

The source code (to be compiled) and .hex files (the one needed by your programmer, already compiled) for the bootloader (v4.x) can be downloaded at:

Using a PICkit-like programmer

Connect the PICkit or PICkit-like programmer with an ICSP Cable to the Pinguino pins (see table below) and upload the firmware with, for example, the Windows/OS X/Linux MPLAB X IDE, the Windows only MPLAB IDE or the Windows/OS X/Linux PICkit2 standalone program.

ICSP Connector Microchip name Pinguino name
2 VDD 3.3V
4 PGD D7
5 PGC D6

Using another Pinguino

In this part, I will explain how to connect a Pinguino to program the bootloader (firmware) on another one.

TO BE COMPLETED (for more information read PIC18F2550_Pinguino#Pinguino_Self-replication)

Testing the assembled board

Connect a USB cable between your PC and your Pinguino board. The bootloader waits 10 seconds for a program to be uploaded during which time the red LED blinks every half-second.

If the board is powered with an external power supply and the USB to PC cable is not connected, the bootloader waits about 5 seconds during which time the red LED stays lit.

Your are ready to play with your board and the Pinguino IDE.

Enjoy !!!


First Programs : 6 ways to blink a LED

Here are 6 ways to blink the built-in Led (User Led) on your new Pinguino board.

USB HID Read Write Interrupt Example

See: MikroElecktronika mikroPascal Pro example


Problem(s) with your Pinguino hardware? Please find help in the Forum here.

Pin Out

Pinguino26j50 rev0.1.png

Pin name PCB Label Digital I/O up to 5.5V tolerant Analog input Other Pin on Chip Microchip name
0 D0 Yes yes nohw Interrupt-on-Change 21 RB0/AN12/INT0/RP3
1 D1 Yes yes nohw RTCC pin 22 RB1/AN10/RTCC/RP4
2 D2 Yes yes nohw CTMU Edge 1 input 23 RB2/AN8/CTED1/VMO/REFO/RP5
3 D3 Yes yes nohw CTMU Edge 2 input 24 RB3/AN9/CTED2/VPO/RP6
4 D4 Yes yes - SPI1/I2C1 Clock 25 RB4/PMA1/KBI0/SCK1/SCL1/RP7
5 D5 Yes no - SPI1 SDI (MOSI) - I2C1 SDA 26 RB5/KBI1/SDI1/SDA1/RP8
6 D6 Yes no - ICSP PGC 27 RB6/KBI2/PGC/RP9
7 D7 Yes no - ISCP PGD 28 RB7/KBI3/PGD/RP10
8 D8 Yes yes - Serial Tx 17 RC6/TX1/CK1/RP17
9 D9 Yes yes - Serial Rx - SPI1 SDO (MISO) 18 RC7/RX1/DT1/SDO1/RP18
10 D10 Yes no - Timer1 digital clock output 11 RC0/T1OSO/T1CKI/RP11
11 D11 Yes no - Timer1 digital clock input 12 RC1/T1OSI/UOE/RP12
12 D12 Yes no nohw Boot/User Ledrun 13 RC2/AN11/CTPLS/RP13
13 A0 Yes no Yesall - 2 RA0/AN0/C1INA/ULPWU/RP0
14 A1 Yes no Yesall - 3 RA1/AN1/C2INA/RP1
15 A2 Yes no Yesall - 4 RA2/AN2/VREF-/CVREF/C2INB
16 A3 Yes no Yesall - 5 RA3/AN3/VREF+/C1INB
17 A4 Yes no Yesall - 7 RA5/AN4/SS1/HLVDIN/RCV/RP2
USB+ - - no - USB 16 RC5/D+/VP
USB- - - no - USB 15 RC4/D-/VM
Vusb - - no - USB 14 VUSB
Reset RST - yes - Reset switch / ICSP MCLR 1 MCLR
Vdd (3.3V) - - no - - 20 Vdd
Vss (GND) - - no - - 19 Vss
Vss (GND) - - no - - 8 Vss
OSC1 - - no - 8- or 20 MHz crystal 9 OSC1/CLKI/RA7
OSC2 - - no - 8- or 20 MHz crystal 10 OSC2/CLKO/RA6
  • Note hw: Analog input hardware available, but no software support
  • Note all: If one pin between 13 and 17 is used as analog input, all those pins are configured as analog inputs.


You can get all necessary files to use your Pinguino 26j50 with Fritzing here.

How to get one ?

Buy it

The PIC18F26J50 microcontroller with the USB bootloader kit is NO LONGER available from the Pinguino Shop

Make it

  1. Assemble it yourself on a breadboard
  2. Use the Kicad board file to generate your own Gerber files using Kicad or Eagle or your favourite PCB CAD program. You can then get your own PCBs manufactured by sending the Gerber files to one of the cheap PCB prototyping services.