This article begins a short series about getting the most from a high-performance 8-bit PIC: the 18F2550. In this first installment, we look at the trainer’s construction and features. With the essentials in place, this development tool gives us a reliable platform for testing code before moving on to more ambitious applications. It offers USB connectivity, an I²C bus, multiple 10-bit analog inputs and plenty of capabilities to explore. If you need a simple, sturdy and useful trainer, this is a practical place to start.

Microcontroller enthusiasts often settle on a particular family. Some of us work almost exclusively with PICs; others prefer Atmel, for example. A designer may favor one brand for its comfortable workflow and versatility, or choose different brands for different applications. And then there are those of us who adopt one kind of microcontroller and use it for the experiments we want to learn from.

AB20.jpg
The PIC 18F2550, a little giant with USB

The 18F2550 follows in the footsteps of popular devices such as the 16F84A, 16F628A and 16F877A. It is broadly similar to the older 16F876A, but benefits from the advantages of the 18F family: notably, more program memory and the ability to build applications with USB connectivity. That is especially useful now that USB ports have largely taken over from serial ports on portable computers.

After repeatedly assembling and dismantling test circuits on a breadboard, we soon see the appeal of a permanent, dependable setup. Perhaps we have a new I²C thermometer to try, an accelerometer with linear outputs, or a brand-new graphic LCD. A board that is always ready lets us test these devices before incorporating them into larger, more involved projects. Breadboards can develop unreliable contacts with heavy use, frustrating what should have been a quick, successful test.

AB21.jpg
Every port has an external connection

Rushing a build can also lead to basic wiring mistakes and damage to expensive components. Some hobbyists do not even have a breadboard and must assemble everything on a general-purpose prototyping board. A tangle of wires and poor solder joints can be disastrous for a microcontroller—and costly for us. That is why we built this PIC 18F2550 trainer. Its purpose is not to teach the microcontroller itself, but to provide a straightforward circuit platform that we can adapt as new experiments come along.

Think of the many projects we have built on breadboards over the years: often, all we wanted was to test a snippet of code, an I²C device or a microcontroller’s ADC. Small projects can now use this trainer as their home base. It is not designed to support multiple microcontrollers, several power supplies or a choice of oscillator crystals. It is built around the PIC we always use, with the crystal we always use, and makes it easy to fit the display we normally use. This is not a claim to a major technological breakthrough—there are thousands of similar and more advanced designs online. The aim is simply to make our work tidier and deliver faster, more dependable results.

AB22.jpg
The developed printed circuit board

The PCB is single-sided, and you can use whichever material is easiest for you to work with. Since this board is intended for frequent use, our prototype is made on FR3 fiberglass, though the less expensive FR2 is also an option. Component placement leaves the analog and digital inputs and outputs of port A, along with the available connections on ports B and C, accessible when the display is installed.

The display uses six port B pins, leaving RB0 and RB1 free. Those two pins provide the I²C bus (SDA and SCL) and, like the display, have a dedicated connector identified in the copper-side silkscreen. Programming techniques can also let switches—such as a matrix keypad—share the port with the display. That is why the full port B remains available on a connector even when the display is mounted on the main board.

AB23.jpg
Top view of the assembled board

In most cases, the system needs no separate power supply. The 18F2550 and, if fitted, the display can draw 5 V from a USB port on a laptop or desktop computer. The board’s combined current consumption should not put the port’s operation at risk. For experiments away from a computer, power can come from any suitable source connected to mains power, a car’s cigarette lighter or another USB power outlet of the kind commonly used for charging batteries. If there is a USB connector, there is a way to power the trainer and get experimenting.

With a 20 MHz crystal, we can build applications that communicate easily with a computer over a USB connection. A voltmeter project published a few weeks earlier is one example of this approach. Since the trainer brings the essential components together on one board, connecting the 18F2550 to a computer is a straightforward and rewarding first USB project.

AB24.jpg
The trainer with the LCD installed and running a test program

The board offers plenty of connection options. Our prototype has four analog inputs on port A, each brought to a three-pin connector set perpendicular to the PIC. The pins provide ground, +5 V and the corresponding port A input. That makes it easy to connect, for instance, a potentiometer to AN0, an LDR to AN1 or an LM35-type thermometer to AN3. The +5 V pin at each connector can also power active devices that provide analog signals to the port A ADCs.

Use the ADCON1 register to select which port A pins operate as analog inputs and which operate digitally. Configure the latter as inputs or outputs with the TRIS instruction. This principle applies across programming languages.

C27D.jpg
Proposed circuit for the trainer board

Other available digital outputs include RC0, RC1 and RC2; RC2 is particularly useful for PWM. RC6 and RC7 go to a separate connector, allowing a direct connection to a TTL-to-RS232 or RS485 conversion module, or use as digital inputs or outputs. The board also includes an ICSP connector for programming the PIC without removing it, a RESET button and a jumper to switch the display backlight on or off. Turning off the backlight helps reduce power consumption when the trainer is USB-powered and data sources are connected to its inputs.

AB26.jpg
For testing, experimenting and learning—all with the 18F2550

This is a simple trainer, not a board intended to outshine or compete with anything else. The idea is not to imitate another design, but to keep the connections neatly arranged on a board that is always ready to use. In other words, we can leave the breadboard behind, try out modules that connect easily, and test PIC code or computer interfaces quickly, simply and safely.

We hope you build the trainer and explore the many capabilities of the PIC 18F2550 with the modules we will build and study in the installments to come. Stay tuned.

Download the printed circuit board PDF.