Fads to Obsessions and Beyond...




Free domain for life, exceptional technical support, website transfer

DIY PIC Development Board

A DIY development board for PIC microcontrollers (16F and 18F series) is documented with design and implementation notes. Includes in-circuit serial programming, LCD's, matrix keypad, RS232 I/O connection, Bluetooth serial comms, real time clock, EEPROM external memory, voltage reference for ADC.

In general, projects incorporating a PIC microcontroller involve an initial breadboard (prototype) stage, during which physical hardware connections are tested and the firmware developed. During the course of developing a number of such projects (see the PIC Projects Section for examples) it was observed that a number of common "blocks" of hardware are typically required. Such as power supply (using either a wall wart or step-down transfer into 5V regulator), I/O to PC via RS232 serial communications, output on dot-matrix screen or LCD and input via matrix keyboard.

Once such hardware "blocks" (and necessary firmware) have been developed/debugged, it is more convenient/efficient (and less error prone) to have them ready to "plug and play" rather than to re-wire on breadboard from scratch each time. Such pre-wired hardware "blocks", assembled in various forms/functionalities are termed development boards.

There are a wide variety of development boards available for PIC microcontrollers, which can be good value in terms of peripherals and components that are incorporated. However, developing a DIY development board presents a better learning opportunity, and enables a better understanding of hardware requirements and interactions enabling custom projects to be more easily produced. Further, a DIY development board enables using components that are more readily and or economically available locally, rather than being tied to a component that is pre-assembled on a commerically purchased development board.

Design Rationale

Flexibility and "changeability" are to be key requirements, since the DIY development board will evolve over time (i.e., I don't know exactly what will be included at the start, except for basic components such as power supply, connections to the actual PIC microcontroller ports, in-circuit serial programming etc). The concept is that as hardware/firmware is developed/debugged (i.e., learning about components over time) the new component(s) will be added to the DIY development board so that re-use in the future is facilitiated. Designing the entire DIY development board, with all the foreseen components/functionality, and then building/implementing is not the idea.

Therefore, the DIY development board project will be build using stripboard (veroboard) and solderless breadboard (or plugboard) rather than using a PCB. This will enable components to be added (and or removed/replaced) as development proceeds, and inherently enable the "plug and play" functionality via the solderless breadboard which will allow "hardware blocks" to be temporarily inter-connected via jumper wires. The use of breadboard will entail some limitations to potential circuits that can be prototyped, but for the typical hobby project for which it is envisaged, these are not likely to be crucial. For completeness, limitations of typical solderless breadboard include (1) relatively large stray capacitance, high induction between some connections, relatively high and not producible contact resistance all which will limit circuits to relatively low frequencies (< 10Mhz), further, voltage and current limitations (generally 1A at 5V).

A 1660 tie point solderless breadboard (for the "prototyping" area) inconjunction with a 1680 point veroboard (for the "hardware blocks") are used (see Photographs Section). While these sizes were chosen more for convenience as I had them on hand, should provide sufficient space for future evolution of the DIY development board. In order to minimise desk space, the veroboard is to be mounted at a right angle to the solderless breadboard (providing a vertical surface). In order to facilitate this mounting of the veroboard, a "mounting tab" was constructed (see the Construction Notes/Trouble Shooting Section) to provide a large vertical plane at the rear of the solderless breadboard. This then also allows for mounting of large components such as LCD screens, matrix keypads etc without taking up space on the veroboard.

The DIY development board is primarily aimed at PIC 16F and 18F micrcontrollers, because I have a relatively large number of such components available (particular PIC18F248) from fortuitous purchases on ebay. A zero insertion force (ZIF) IC socket (40 pin) will be used to enable ready replacement of microcontroller parts to enable use of PIC parts up to 40 lead dual inline 600mil body (PDIP) packages.

The wide availability of surplus laptop power chargers provides convenient (and safe) power supply, rather than using step down transformer and diode rectifier bridge etc direct from AC supply. Another suitable "safe" alternative would be to simply use any available external bench power supply (for example from a converted ATX-PSU power supply or a commerically available model). I choose the "wall wart" approach to utilise the charger from a scrapped laptop (provides 16-24V at 65W max). Therefore, the DIY development board requires a suitable power connector and voltage regulator to provide the 5V typically needed by microcontroller circuits. In addition, since many common parts now require 3.3V the DIY development board will also provide a 3.3V regulated supply.

In-circuit serial programming will be supported (so that the PIC microcontroller does not need to be removed during prototyping) and performed using a PICkit 2 programmer (because that is what I have on hand - and happens to be versatile and economical for the PIC parts I normally use).

As previously mentioned, a full list of all desirable functionality (i.e. which components) to be handled by the DIY development board is not stipulated at the outset (hence the need for the flexibility of the basic "architecture") but some generally useful components will include:

    • Matrix keypad input
    • Output to dot-matrix and LCD display
    • PC connectivity via RS232
    • Bluetooth connectivity
    • PIC Port expansion via external IC's
    • Extending RAM via external IC's

Many commerically available development boards include banks of LED's, momentary on/off switches, transistors for driving external loads, and "speciality" components such as temperature sensors etc. Such items are not planned to be incorporated initially, as these are deemed to be "project" specific and not "generic". The solderless breadboard component of the DIY development board will enable easy incorporation of such items. Further, the flexibility of the design means that if particular hardware components are found to be used in projects on a frequent basis, they can then be easily added as a "hardware block" at a later time if desired.

The "Testing/Experimental Results" and the "Construction Notes/Trouble Shooting" Sections below record the detail about physical implementation of the DIY development board and the various circuit components and specific parts incorporated over time.


Brief details about the DIY development board circuit in terms of individual hardware "blocks" are given below. "Major" components such as the Nokia 5510 LCD and matrix keypad etc are discussed in more detail on seperate pages with the links provided.

Power Supply

As mentioned in the Project Background Section, a "wall wart" power supply was chosen rather than constructing a dedicated DC power supply dropping/converting from a AC wall socket. Surplus chargers from laptops are readily available (in this case supplying 16-24V with 65W max) which provide not only a safer option (compared to construction from a suitable transformer, rectifier, connection to AC etc) but also a much more economical option (generally zero cost for a surplus charger, compared to ten's of dollars for a suitable transformer, let alone cost of ancillary circuitry, PCB etc).

The surplus laptop charger requires suitable socket connection and a voltage regulator, in this case a LM317T, to provide the regulated 5V generally required by PIC microcontrollers. The power supply circuit is given in the Schematics Section. The LM317T circuit is the standard design direct from the datasheet, with input and output capacitors to provide smoothing and the resistor/potentiometer to provide selection of output voltage.

A variable LM317 option was chosen, rather than a fixed 5V regulator, as this enabled the power supply of the DIY Development Board to be more generally versatile if to be used for another application/project. A small heat sink was included with the LM317 as the laptop charger provides 16V input, which means ~10V needs to be dissipated.

Since many peripherals and components now being produced utilise 3.3V input, the DIY Development Board provides a seperate fixed 3.3V source via the LM1086 regulator. The LM1086 input is from the regulated 5V to minimise necessary voltage dissipation, and hence no heat sink was necessary.

Basic Microcontroller Connection

The minimal circuitry required to operate the typical PIC (18F and 16F series in this case) include 5V regulated supply, oscillator (generally external crystal oscillator), in-circuit serial programming connections and a method to connect to the various I/O ports.

The power supply is discussed previously (LM317 regulator). Since the DIY Development Board will use a variety of microcontrollers, option is made so that various crystal oscillators can be used as required (i.e. a crystal was not hardwired, but a couple of input pins provided so that the physical crystal can be changed as necessary). The PIC datasheets discuss required type of crystal or ceramic resonator and necessary capacitance, however, a 22pF capacitance is readily available, falls within the middle of the recommended ranges, and in practice does not seem particularly critical. Therefore, a fixed 22pF is provided on the DIY Development Board for the crystal oscillator.

In Circuit Serial Programming

The PICkit has a 6-pin connector (molex/dupont), but since it is the female end, a DIY connector made from suitable cables/pins is easy to fabricate. For the "usual" 18F and 16F series PIC microcontrollers (40 pin) only five pins are actually used, and the pin order is given in the schematics. The PGM pin 6 is not used (this is only for specialised programming in a commerical production setting).

Since the ICSP will be for a development board, where the actual hardware and wiring will vary and the potential for "mistakes" is relatively high, the ICSP connection circuitry is perhaps overly cautious and would not necessarily all be required in a final built design. Again, because of the planned use in "development environment" a reset switch is also included.

The PICkit 2 provides target Vdd (5V) during programming and the MCLR (pin 1) is the programming voltage which is generally 13V. Diode D1 in the schematic prevents the ICSP high voltage from interacting with the power supply circuit. Resistor R1 is the necessary pull-up for the PIC MCLR pin, whereas, diode D2 and capacitor C3 provide quick turn-off and a defined rise time for power-on/reset start. Switch SW2 provides reset of the PIC.

The signals on the PGD and PGC lines transmit the actual programming to the PIC, and since the PIC pins (generally port B pin 6 and 7 for the 18F and 16F series) are also general purpose I/O lines, it is recommended that these are isolated from any attached circuitry during programming. This will avoid the PICkit2 (or other programmer) attempting to power-up such circuitry. Similarily, since the PICkit2 provides the target Vdd, the PIC Vdd pin 20 is also isolated during ICSP to stop any potential interaction with the power supply.

Isolation of ICSP pins 1, 4 and 5 (Vdd, PGD and PGC respectively) is enabled by single pole, multiple throw switch SW1. Again, this is being overly cautious, but since the multiple throw switch was available, safer to include such an option. Alternatively, simple jumper wire links could be used instead (although not as convenient as an actual switch).

Connection to the various PIC ports is provided by hard wired leads that enable using the solderless breadboard component of the DIY development board as a "junction" box. This is a very flexible and easily implemented option.

Peripherals

The currently implemented peripherals are listed as follows:

    • Matrix Keypad (including external I2C support via PDF8574 8-bit port expander to maximise "free" I/O pins on the interfaced PIC)
    • TTP229 Capacitive Touch Keypad (16 keys)
    • LCD Display 16x2 Character (HD44780 compliant)
    • RS232 connectivity (PIC USART and MAX232)
    • Nokia 5110 LCD 84x48 LCD
    • HC-05 Bluetooth serial communications
    • SD Card (<2MB) Interface

Circuit descriptions for these accessories are detailed in the links in the above list. The Schematic Diagram section provides the connection schematics for each component utilised.

Accessories

The currently implemented accessories are listed as follows:

Circuit descriptions for these accessories are detailed in the links in the above list. The Schematic Diagram section provides the connection schematics for each component utilised.


Note: Image loading can be slow depending on server load.

  • Microcontroller I/O SchematicMicrocontroller I/O Schematic

    Silver Membership registration gives access to full resolution schematic diagrams.

    Microcontroller I/O Schematic

  • DIY Development Board - Microcontroller I/O

  • Power Supply SchematicPower Supply Schematic

    Silver Membership registration gives access to full resolution schematic diagrams.

    Power Supply Schematic

  • DIY Development Board - Power Supply

  • Peripherals SchematicPeripherals Schematic

    Silver Membership registration gives access to full resolution schematic diagrams.

    Peripherals Schematic

  • DIY Development Board - Peripherals

  • Accessories SchematicAccessories Schematic

    Silver Membership registration gives access to full resolution schematic diagrams.

    Accessories Schematic

  • DIY Development Board - Accessories


Note: Image loading can be slow depending on server load.

As explained in the Project Background Section, the DIY development board project is build using stripboard (veroboard) and solderless breadboard (or plugboard) rather than using a PCB. This enables components to be added (and or removed/replaced) as development proceeds, and inherently enable "plug and play" functionality via the solderless breadboard which will allow "hardware blocks" to be temporarily inter-connected via jumper wires.

The following diagrams pictorial display the physical connections on the stripboard (veroboard) utilised to construct the DIY development board. The Photographs Section also provides reference photographs showing the various connections between the physical components.

  • DIY development board - microcontroller ZIF socketDIY development board - microcontroller ZIF socket

    Silver Membership registration gives access to full resolution diagrams.

    DIY development board - microcontroller ZIF socket

  • DIY development board - microcontroller ZIF socket

  • DIY development board - Power SupplyDIY development board - Power Supply

    Silver Membership registration gives access to full resolution diagrams.

    DIY development board - Power Supply

  • DIY development board - Power Supply

  • DIY development board - PeripheralsDIY development board - Peripherals

    Silver Membership registration gives access to full resolution diagrams.

    DIY development board - Peripherals

  • DIY development board - Peripherals

Qty Schematic Part-Reference Value Notes
Resistors
1R1, R210K1/4W, 10% 
1R35601/4W, 10% 
1R4 - R14101W, 10% 
1RV120KPotentiometer
Diodes
1D1Red LED 
Integrated Circuits
1U1LA6358NDual Op-Amp 
Miscellaeous
1 fan12V fan
1Q1IRF540NMosfet
2 MetersMini DC 0V To 99.9V LED Digital Panel Voltmeter  

Initial testing involved construction of the power supply and checking if the desired voltages were produced.

The ZIF circuit was mounted and then connected with the ICSP, power supply and crystal oscillator. This minimial setup could then be checked via the PICkit 2 to ensure that PIC parts inserted in the ZIF socket were recognised and could be programmed.

Individual "hardware blocks" (RS232, LCD, EEPROM etc) have seperate requirements for testing and these are documented in the seperate pages devoted to these components. The links to these "hardware blocks" are given in the Circuit Details Section.

A 1660 tie point solderless breadboard (for the "prototyping" area) inconjunction with a 1680 point veroboard (for the "hardware blocks") are used (see Photographs Section). While these sizes were chosen more for convenience as I had them on hand, should provide sufficient space for future evolution of the DIY development board. In order to minimise desk space, the veroboard is mounted at a right angle to the solderless breadboard (providing a vertical surface).

In order to facilitate this mounting of the veroboard, a "mounting tab" was constructed from plastic salvaged from a disused container (~3mm polypropylene). The container was cut so as to provide a sheet approximately 300mm wide x 200mm high. This provides a large vertical plane at the rear of the solderless breadboard which allows for mounting of large components such as LCD screens, matrix keypads etc without taking up space on the veroboard. In order to mount the plastic sheet to the solderless breadboard, a right-angle bracket was formed by cutting scrap sheet metal (from the chassis of a discarded DVD player) which was then attached with pop-rivets.

The DIY development board is primarily aimed at PIC 16F and 18F micrcontrollers and to facilitate ease of placement/removal, a zero insertion force (ZIF) IC socket (40 pin) is used (PIC parts up to 40 lead dual inline 600mil body (PDIP) packages). A piece of veroboard was cut lengthwise to enable mounting of the ZIF socket, and maximise the number of solder points available for connection of components.

A multiple throw, single pole switch was available (4 terminals), so isolation of ICSP pins 1, 4 and 5 (Vdd, PGD and PGC respectively) was done (see the "Printed Circuit Board" Section for physical connections). If such a switch is not available, simple jumper wire links could be used instead (although not as convenient as an actual switch).

The power supply is relatively straight forward using a "wall wart" with a variable linear voltage regulator (LM317T) and a fixed 3.3V voltage regulator. The wall wart was surplus from a defunct laptop (14-18V and 65W) which input to the LM317T with a nominal 5V output meant that a small heat sink was required on the LM317. The power supply was mounted on a seperate veroboard that was in turn mounted to the solderless breadboard. This enable maximising space on the vertically mounted veroboard for other components. Since the power supply was adjacent to the solderless breadboard section (which would be frequently accessed during the course of prototyping) a "cowling" was made from cutting and bending plastic from a DVD (easily cut with sturdy scissors and a heat gun to help with bending and forming). This protects the user from accidently touching the power supply components during prototyping.

The "functional blocks" on the veroboard (RS232, LCD, EEPROM etc) are wired such that jumpers can isolate these blocks individually from the power supply. This then enables "plug and play" functionality with a relatively good representation of how the final circuit will behave in terms of power consumption etc.

Connection wires from the "functional blocks" to the solderless breadboard, and hence to the PIC mounted in the ZIF socket were kept as short as possible. However, in order to provide ease of connection these wires are necessarily longer than would exist on an equivalent PCB mounting. This could affect high-speed, high-frequency circuits prototyped with this setup, but with the typical DIY project, not likely to be a problem in this regard.


Comments/Questions

No comments yet.

Add Comment/Question

Only Logged-In Members can add comments

"If we could sell our experiences for what they cost us, we'd all be millionaires".

Please donate any amount to help with hosting this web site.

If you subscribe (only $2/annum) you can view the site without advertisements and get emails abouts updates etc.

X

Sorry!

Only logged-in users with correct Membership Level can download.


Membership starts at only $2, so join now!