PIC18F45K50 Pinguino

From Pinguino-Wiki
Jump to: navigation, search
Language: English  • Español • Magyar


Contents

Important Warnings for all Pinguino Users

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

Features

This version of the Pinguino board is built with a Microchip PIC18F45K50 microcontroller. This Pinguino is pin compatible with the older 4550 series and is capable of running at 5V. It also features a USB precision integrated oscillator, enabling you to build USB projects without the need of any external oscillator. There is also a CTMU unit for measurement applications.

It works with the internal crystal or with an optional external 8 or 20 MHz crystal.

The Pinguino 45K50 is USB 2.0 compatible.

The characteristics of this Pinguino board are:

  • 8-bit 12 MIPS processor core running at 48Mhz
  • 32K Program Flash Memory
  • 2048 RAM bytes
  • 256 bytes Data EEPROM
  • 17 digital input/output with 5 shared analog inputs,
  • 1 UART for serial communications, 1 SPI and 1 I2C
  • 2 fast PWM output (3000 Hz),
  • Up to 25 Channel 10-bit ADC with Voltage Reference
  • 2 Analog Comparators
  • 5-bit Digital to Analog Converter (DAC)
  • Charge Time Measurement Unit (CTMU) for measurement applications
  • 2x 8-bit Timers
  • 2x 16-bit Timers
  • Operating voltage 5V
P45K50-03a.png

The Microchip datasheet, errata, application notes, code examples and software libraries for the PIC18F45K50 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 45K50 can be found here.

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

Board overview

Schematic

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.

If no USB communication is available (no USB cable) for 5 seconds, the current program in memory is run.

This board is powered by the USB connector (5V).

It can be optionally powered through a 5V regulator (LM7805) via the VIN pin.

Any regulated external power supply from 2.3V to 5.5V can power the board via one of the 2 +/- pins.

Please read the PIC18F45K50 Datasheet if you plan to feed your board this way.

Building Instructions

The Pinguino 45K50 is one of the most simple boards to assemble.

It is small (71x26mm) but very easy to solder, even for kids.

It needs only 4 resistors and 3 capacitors to work.

We have added 2 LEDs, one reset button and a USB connector (as every Pinguino is a full-speed USB device).

The Pinguino 45K50 is also an upgradeable board.

If you need it, you can add a 5V regulator to feed the board from an external power supply.

It's also possible to add an external crystal. In this case, note that the PCB is fully compatible with the PIC18F4550 so you can easily turn your Pinguino 45K50 into a Pinguino 4550.

Bill Of Components

Resistors
  • R1,R2,R4 470 Ohm (Yellow - Purple - Black - Black)
  • R3 10K Ohm (Brown - Black - Orange)

Capacitors

  • C1,C5 100nF (marked as 104)
  • C2 220nF (marked as 224)

Diodes

  • D1, D2 3mm Red LED (+/anode = long lead)

Connectors

  • JP1 USB Type-B Female
  • P1,P2 2.54mm header strip (*)
  • K1 Power selector (3-pin header strip)
  • 18F45K50 2x20-pin round female header strip

Others

  • 18F45K50 PIC18F45K50 (DIP package)
  • SW1 Push Button (Reset)
  • PCB
P45k50-00.jpg

Optional

  • C6,C7 22pF (marked as 22)
  • C3 22uF (polarized, marked as 22uF)
  • C4 100nF (marked as 104)
  • X1 8- or 20 MHz crystal (low profile)
  • U1 LM7805 (5V regulator)
  • P0 External Power Supply connector (3-pin header strip)
  • 18F45K50 PIC18F45K50 or PIC18F4550

(*) 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):

P45k50-01a.jpg

The other one is the solder side (below):

P45k50-01b.jpg

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 out 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 soldering iron tip against one of the leads and the PCB pad for a few seconds until the joint heats up, then apply the solder wire to the joint. The solder will melt and cover the lead and the pad. Remove the soldering iron tip and the solder wire from the joint and allow the joint to cool for a few seconds. Repeat this process to solder the remaining leads of the component.

For more info on soldering, see here.

P45k50-02.jpg

Populated component side

Construction

  • Place and solder all the resistors (3x 470R and 10K). 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.
  • Optional : place and solder the two 22pF capacitors (C6 and C7, 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.
  • Optional : place and solder the 8 or 20 MHz crystal. Trim the wires.
  • Place and solder the 2 x 20 round female header strip (as a DIP28 socket).
  • Place and solder the 100nF capacitors (C1 and C5, C4 is optional, 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 220nF capacitor (C2, marked as 224). This capacitor is not polarised, so it does not matter in which direction it is placed, but it makes sense to place it so that you can still read its marking. Trim the wires.
  • Place and solder the 2-pin switch button. It does not matter in which direction it is placed.
  • Place and solder the 2 LEDs. An LED 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 switch button. Note that the Power LED is the nearest to the USB connector. Trim the wires.
  • Optional : place and solder the polarised 10uF electrolytic capacitor. The white or black stripe on the side of the capacitor must be at the side of minus sign on the PCB silkscreen (in other words, next to the 100nF capacitor). Trim the wires.
  • Place the USB connector and bend the two metal mounting tabs. Then solder it in place.
  • Place and solder all the pin-header connectors. Note they can be soldered on either side. It´s up to you. If you want to plug your board into a standard 2x5 solderless breadboard take care as you will only have one free row of holes to make connections once the board has been inserted.
  • Place and solder a 3-pin header connector where the silkscreen shows EXT|USB (at the end of the board. Place a jumper at the EXT or USB side to select External or USB power supply. If you only use the USB power supply you can just connect the 2 pins at the USB side with a wire or with some solder.
  • Place the PIC18F45K50 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 optional 5V regulator should be located.

See also Henk's Website (in Dutch)

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 :


Bootloader_v4.14_18f45k50_INTOSC.hex is the correct bootloader code for a board running the internal oscillator (INTOSC) without any external crystal.

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
1 MCLR pin 35
2 VDD 5V
3 GND GND
4 PGD pin 7
5 PGC pin 6
6 PGM pin 5

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 also this)

Testing the assembled board

P45k50-05.jpg

Connect a USB cable between your PC and your Pinguino board. The red (power) LED is ON. The bootloader starts and jumps to the user program (if there is any, if not nothing happens).

When the RESET button is pressed, the bootloader waits until a program is uploaded. The yellow (USERLED) LED blinks with a high rate until the user program starts to be received.

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 yellow LED stays lit and then jumps to the user program (if there is any).

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.

Troubleshooting

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

Pin Out

P45k50 cr.png

Update in progress.

Pin name PCB Label Digital I/O up to 5.5V tolerant Analog input Other Pin on Chip Microchip name
0 D0 Yes Yes I2C1 SDA
SPI1 SDI
33 RB0/AN12/INT0/FLT0/SDI/SDA
1 D1 Yes Yes I2C1 SCL
SPI1 SCK
34 RB1/AN10/INT1/SCK/SCL
2 D2 Yes Yes 35 RB2/AN8/INT2/VMO
3 D3 Yes Yes 36 RB3/AN9/VPO
4 D4 Yes Yes 37 RB4/AN11/KBI0/CSSPP
5 D5 Yes Yes ICSP PGM 38 RB5/KBI1/PGM
6 D6 Yes Yes ICSP PGC 39 RB6/KBI2/PGC
7 D7 Yes Yes ISCP PGD 40 RB7/KBI3/PGD
8 D8 / A0 Yes Yes Yes 2 RA0/AN0
9 D9 / A1 Yes Yes Yes 3 RA1/AN1
10 D10 / A2 Yes Yes Yes 4 RA2/AN2/VREF-/CVREF
11 D11 / A3 Yes Yes Yes 5 RA3/AN3/VREF+
12 D12 Yes Yes RUN LED
USERLED
6 RA4/T0CKI/C1OUT/RCV
13 D13 / A4 Yes Yes Yes 7 RA5/AN4/SS/HLVDIN/C2OUT
14 D15 14 OSC2/CLKO/RA6
15 D14 13 OSC1/CLKI/RA7
16 D16 Yes Yes 15 RC0/T1OSO/T13CKI
17 D17 Yes Yes PWM 16 RC1/T1OSI/CCP2/UOE
18 D18 Yes Yes PWM 17 RC2/CCP1/P1A
20 D20 USB unplugged 23 RC4/D-/VM
21 D21 USB unplugged 24 RC5/D+/VP
22 D22 Yes Yes Serial TX 25 RC6/TX/CK
23 D23 Yes Yes Serial RX
SPI1 SDO
26 RC7/RX/DT/SDO
24 D24 Yes Yes 19 RD0/SPP0
25 D25 Yes Yes 20 RD1/SPP1
26 D26 Yes Yes 21 RD2/SPP2
27 D27 Yes Yes 22 RD3/SPP3
28 D28 Yes Yes 27 RD4/SPP4
29 D29 Yes Yes 28 RD5/SPP5/P1B
30 D30 Yes Yes 29 RD6/SPP6/P1C
31 D31 Yes Yes 30 RD7/SPP7/P1D
32 D32 / A5 Yes Yes Yes 8 RE0/AN5/CK1SPP
33 D33 / A6 Yes Yes Yes 9 RE1/AN6/CK2SPP
34 D34 / A7 Yes Yes Yes 10 RE2/AN7/OESPP
OSC1 13 OSC1/CLKI
OSC2 14 OSC2/CLKO/RA6
RESET RST Reset switch / ICSP MCLR 1 MCLR/VPP/RE3
USB- USB 23 RC4/D-/VM
USB+ USB 24 RC5/D+/VP
Vusb USB 18 VUSB
VDD (up to 5.5V) 11 VDD
VDD (up to 5.5V) 32 VDD
VSS (Gnd) 12 VSS
VSS (Gnd) 31 VSS

Fritzing

To do.

How to get one ?

Kits

If you want to get a kit (including the PIC18F45K50 microcontroller with the USB bootloader pre-installed), please go to the Pinguino Shop

Europe VAT zone : 9.90 €

World (ex. VAT) : 8.20 € (about 11 US$)

Shipping cost  : 3.15 €

Blank PCBs

If you just want the PCB with silkscreen to build your own Pinguino 45K50, please go to the Pinguino Shop.

Europe VAT Zone : 6.05 €

World (ex. VAT) : 5.00 €

Shipping cost  : 3.15 €

Pre-programmed PIC18F45K50

If you just want the PIC18F45K50 microcontroller pre-programmed with the Pinguino bootloader to build your own Pinguino 45K50, please go to the Pinguino Shop.

Europe VAT Zone : 6.05 €

World (ex. VAT) : 5.00 €

Shipping cost  : 3.15 €

Personal tools