This page provide information and handouts of Mechatronics lab for the course EGME361 Robot Actuators and Sensors and EGME362 Introduction to Mechatronics. Please note that all the documents are written in Thai language.
A hardware set is developed to give students hand-on experience in programming and interfacing with various actuators and sensors. The hardware set consists of:
The PIC16F877 Bootloader board is designed to use with Tiny PIC Boot Loader, which allows the PIC to be programmed through serial port. This configuration eliminates the need of a PIC programmer and allows a user to use serial port for both programming the PIC and serial communication (e.g. with HyperTerminal) without modifying the hardware.
Before using the board, PIC16F877 must be programmed with Tiny PIC Boot Loader firmware (file: tinybld_16F876A_20MHz.HEX). Of course, a PIC programmer is only needed at the first time to program the firmware. And after this, we will no longer need the programmer. Tiny Bootloader software is used to program the PIC through serial port.
Schematic diagram for PIC16F877 Board
Eagle files: Schematic (.sch) and PCB layout (.brd) (I use Eagle version 4.13)
You can also make your own circuit from scratch. I find this way is harder to learn, but students learn a lot more. Often, programming via Boot Loader can get buggy too.
ET-EXP4 I/O Board is developed by ETT company. It contains many input/output modules that is often used in mechatronic systems such as LEDs, 7-segment, dot-matrix LED, LCD display, matrix switches, stepper and dc motor, relay, speaker, and DAC. The PIC16F877 Board is designed to conveniently connect with ET-EXP I/O Board through 14-pin IDC connectors.
There are many languages can be used to program PIC microcontroller such as assembly, C, Basic. I chose C language from Hi-Tech and CCS for my class. In this case you will need following software.
MPLAB IDE is the developing environment, which you can use to write program and build the source code for PIC microcontroller. Assembly language compiler is built-in with the MPLAB IDE. It can be download for free from Microchip website.
Compiler (You need only one compiler. The source codes are provided for all)
Hi-Tech PICC compiler from Hi-Tech is a compiler that can be added on to the MPLAB IDE program. Hi-Tech PICC is not a freeware, but an evaluation software is available on the Hi-Tech website.
CCS C compiler from Custom Computer Service, Inc. Compare with Hi-Tech and other C compilers for PIC, this compiler is most user friendly. User doesn't have to know any special function registers (SFR) in the microcontroller. The program provides adequate special function to setup the registers for most tasks. The buttom line is if you want to setup a quick project, go with CCS, but if you want to learn microcontroller, go with Hi-Tech
PicBasic Pro compiler from microEngineering Labs. Like most compiler, PicBasic Pro is not a freeware, but a demo software is available on the microEngineering Labs website. I recommend to use this compiler with MicroCode Studio IDE (free) from Mecanique website.
Tiny PIC Bootloader software (just file: tinybldWin.exe) is required to program the PIC through serial port.