Microchip Mechatronics Demo Board
Microchip, Chandler, AZ
Cost: $150
The demo kit includes:
-
Mechatronics Demo board (comes with two motors)
-
Quick-Start Guide (paper)
-
MPLAB IDE CD-ROM v7.20 (V7.40 available as a download)
-
PICDEM Mechatronics CD-ROM
-
Screwdriver and jumpers
-
Sample PIC processors: 16F690 (20 pin) and 12F509 (8 pin)
NOTE: If you plan to program the 16F917 microcontroller chip, you will need either a PICkit 2 Microcontroller Programmer ($50) or an MPLAB ICD 2 In-Circuit Debugger Programmer ($160).
The demo board arrived with two motors - a brushed dc motor and a stepper motor -already mounted and ready to connect. And the board included potentiometers, push buttons, LEDs, an LCD, a temperature sensor, and a light sensor. The processor, a 40-pin Microchip PIC 16F917, came preprogrammed with a motor-control demonstration program. The MCU furnishes 36 I/O pins and makes 14 uncommitted lines available for experimentation. The remaining pins control on-board peripherals and their descriptions on the PCB appear in small boxes outlined in white. Unless told otherwise, DO NOT connect anything to these pins.
The PICDEM Mechatronics CD-ROM contains information that includes the Demo Board User's Guide, chip data sheets, and application notes. You can easily browse through the disk contents and find information you need.
The two-page Quick-Start Guide lists several steps that prepare the board to run a demo program with the dc motor. Although the kit comes with a small screwdriver, use a #1 Phillips-head screwdriver to handle the screws that connect the motor wires to the board. The Microchip screwdriver works better with the onboard potentiometers. Caution: The board designers placed a power screw close to the LCD, so a slip of the screwdriver could destroy the display.
Before you can run the motor demo software, instructions tell users to make three jumper connections. The first goes from a potentiometer (POT1) to a header pin described as RA0/AN0 in the instructions. But, the board diagram and legends show this jumper connected to a different pin labeled C1. I located the board schematic on the PICDEM CD-ROM and discovered the PCB layout connects in parallel two pins on each side of a column of pins for MCU signals. So, the C1 pin and the RA0/AN0 pins are one and the same. Another instruction refers to a pin labeled N2, but it refers to the wrong header, which should be J2. This type of error may cause users to question the accuracy of documents.
The board can draw power from a 9-V battery, a 5-V power supply, or a power supply that provides from 9 to 12V dc. I had a 9-V “wall-wart” supply available with a standard barrel-type plug on the end. Unfortunately, the documentation doesn't indicate whether the center conductor requires +9V or ground. I used a trusted 0-30V dc bench supply and ran power to screw terminals on the board.
After applying power, I tried the test program, which worked well. Varying the potentiometer changed the speed of the brushed dc motor and I could see the potentiometer “value” displayed on the LCD as two hexadecimal digits from 00 to FF.
The Mechatronics Demo Board User's Guide (64 pages) includes two other experiments that rely on the preloaded demo software. I used the on-board light sensor to change the motor's speed. Another experiment with the on-board temperature sensor failed because the sensor output hardly changed, even when placed directly under a 60-W light bulb.
The Demonstration Board User's Guide provides information about eight other “projects” users can work on with the board. The project files come on the PICDEM Mechatronics CD-ROM. Click the large green arrow, near the “Install Project Files” legend to place them in a directory on your C: drive.
As mentioned earlier, you need a programmer module to download new code from a host PC to the PIC MCU on the demo board. Microchip sent me a PICkit 2 Starter Kit, so I used it. Here's where the going gets rough, because documentation scatters instructions here and there and it takes work to keep everything in order. So, yes, the rough might get going, but people with even a moderate tolerance for pain may give up.
The PICkit 2 Starter Kit includes a small programming module and an MCU on a board with a pushbutton, potentiometer, and four LEDs. The kit serves as a way for people to get a quick introduction to microcontrollers. The kit's CD-ROM includes a Quick Start page that explains how to load Microchip's MPLAB software, plug in the small PICkit 2 demo board, and run a simple test. I loaded the MPLAB software (v7.20) and plugged in the module as instructed, but nothing happened.
When trying to determine what caused the test to fail, I opened the MPLAB IDE and looked for the PICkit 2 choice under Programmer options, only to find it was grayed out. So, the MPLAB software could not directly “connect” with my PICkit 2 programmer module. Perhaps the PICkit 2 module has its own chip-programming software.
It would help to have Microchip explain the flow of code through its tools before developers jump in and follow any quick-start instructions for software. Programming tools for the PICkit 2 come in two parts, which the instructions do not explain well. First, Microchip's MPLAB integrated development environment (IDE) lets developers write and compile assembly-language programs. Second, after the MPLAB produces a hexadecimal file, developers use an external hardware programmer, in this case the PICkit 2 Microcontroller Programmer module, to load the hex code into a target PIC MCU chip. That module has its own program and user interface, and it accepts the compiler's hex file.
OK, back to the manual. Chapter 1 of the PICkit 2 Microcontroller Programmer's User's Guide told me where to find the programming software and how to start it. The software does not exist in that location, though.Chapter 1 also explained what the software does and it gives developers the impression they are set to go. After all, they have gone through three pages of detailed menu and option-selection information. Chapter 1 put the cart before the horse, though. Chapter 2, “Getting Started,” finally explained how to load and start the MCU-programming software.
Even after I loaded the PICkit 2 Microcontroller Programmer software and started it, the small demo board still would not light its LEDs. Instead, the PICkit 2's software only displayed the message, “PICkit 2 not found. Check connections.” Well, the kit was darn well connected and I had followed the directions.
Software goes through updates, so I decided to check the Microchip site for a newer version of the PICkit 2 programmer software and found version 1.21, which I downloaded and installed. (I had previously installed version 1.00.) Now, the LEDs would flash-sometimes. But, for every operation I tried, the programmer software displayed an error message, “Vdd and Vpp voltage level errors detected. Check target & Retry operation.”
At this point I noticed a small message in the PICkit 2 programmer's interface display that told me to update the programmer's operating system. The User's Guide buried that update information in Chapter 4. I followed the instructions to update the operating system and the programmer and the LED-flashing demo board seem to work well.Now-finally-I could try an experiment or project on the Mechatronics demo board.
Microchip can alleviate frustrations by including a meaningful Quick-Start Check List that explains how to load software, where to check for updates, how to ensure users have the latest updates, how to install and start updated software, and so on. Only after users go through those steps should Microchip explain in detail what the software does and have users run a sample program. Also, instructions on how to use software should come after instructions on how to load and initialize it.
The first hardware/software project for the Mechatronics Demo Board will let a pushbutton control an LED. The project's software “debounces” the pushbutton and turns an LED on or off. Instructions show how to connect two jumpers and then refer me to “PICkit 1 Flash Starter Kit User's Guide (DS40051): Exercise 2.”(Microchip introduced the earlier PICkit 1 some time ago.) Thankfully, the PICDEM Mechatronics CD-ROM includes the needed user's guides, application notes, and data sheets. But, the project should refer users to Lesson 1 in the PICkit 1 manual, not to Exercise 2.
Unfortunately, Microchip provides incomplete descriptions of how to compile, load, and run the project code. The pushbutton/LED project, for example, explains where to find the code and how to load it into the IDE. OK, I loaded the appropriate project file, now what? The information in the PICkit 1 manual describes three different programs. But you can't load software you don't know how to find. After spending time with software updates and tracking down documentation, I had neither time nor energy to try even the simple LED project.
Microchip has put together a powerful mechatronics demonstration board, but the documentation and project instructions present a mish mash of information that will defy all but the most resolute developer. It's sad to see all the interesting peripherals on the demo board go to waste for the want of clear step-by-step instructions that would help developers understand not only how the peripheral devices work with software, but how to get the most out of the powerful Microchip tools.