THE DESIGN CYCLE
■ BY FRED EADY
Basic Training for All
Programming languages are akin to political
parties. You believe in and support the
political party that you think can get the job
done to your liking. Likewise, you use a
programming language that is most intuitive
to you to manipulate a target microcontroller.
In the end, it does not matter if the
programming language is C, C++, or BASIC. If
you code in BASIC, you can still send a
message via a microcontroller’s UART just as
effectively as a C programmer can.
Trainer is a self-contained learning system that is based on
the time-tested PICBASIC PRO Compiler. As you can see
in Photo 1, the Trainer can also be used as a proof of
concept platform. Many of the PIC16F1xxx and
PIC18FxxKxx microcontrollers packaged in the familiar 40-
pin DIP package are pin compatible. So, once you get
familiar with the Trainer environment, you can replace its
incumbent PIC16F1937 with other compatible PIC
microcontrollers. If your favorite PIC isn’t packaged in 40-
pin DIP, you could also build up a custom jig and adapt
your target microcontroller via the header pads at the far
right of the M.E. Labs Trainer printed circuit board (PCB).
The Trainer’s version of a PICkit3 is shown in Photo 2.
The common denominator is not which program language you use. A solid knowledge of the
fundamentals of programming is the stuff that pulls your
application together. With that in mind, the folks at M.E.
Labs, Inc. (microEngineering Labs) developed their M.E.
Programming and debugging the PIC16F1937 is
accomplished with this PIC-LED group of components and
the MicroCode Studio IDE (integrated development
environment), which is also included in the M.E. Labs
Trainer package. The PIC18F25K50 based circuitry can
also be used as a USB to RS-232 portal. MicroCode
Studio has a built-in serial monitor that can be used to
visually check out the data passed on this USB portal.
M.E. Labs Trainer
You don’t need a PICkit3. You don’t need MPLAB X.
You don’t need an expensive compiler. The M.E. Labs
A very bright tri-color LED sits among three pots, eight
LEDs, four pushbuttons, five touch pads, a 2x16 LCD, and
a temperature sensor. All you have to do is dial up some
code to use them. The M.E. Labs Trainer comes with
plenty of example code and an excellent tutorial manual.
BASIC Glue Code
The idea behind this Trainer is to convey to the user
universal coding techniques that transcend language
boundaries. In that the Trainer’s buttons, LEDs, LCD, pots,
and temperature sensor are hardwired, the initial setup of
the PIC16F1937 is logically hardwired as well. To that end,
the 14-1_Init.pbp file must be included in every M.E. Labs
Trainer based project. Let’s take a look at the contents of
the always-present 14-1_Init.pbp include file:
■ PHOTO 1. The M.E. Labs Trainer is a complete self-contained embedded development platform. Just about
everything you would want to twiddle with via a
microcontroller can be found on this board.
‘‘**** Configure and initialize the device ****
DISABLE DEBUG ‘‘Disable ICD code for this
; set CONFIG1 for internal oscillator
__config _CONFIG1, _FOSC_INTOSC
; set CONFIG2 for int osc pll controlled by
;low-voltage programming on
__config _CONFIG2, _PLLEN_OFF & _LVP_ON
; see file PIC16F1937.INFO (in PBP
installation) for more options
50 April 2016