The world of electronics is ever progressing and exciting, changing the way we live our life in all ways possible. In the fast changing world of electronic, only by catching the latest trend and technology will we be able to stay ahead. While the technology for analog devices and discrete logic circuits slowly reaches saturation point, programmable flash microcontroller and other programmable logic devices offer a whole new door to better design and implementation of digital circuits.
Welcome to the Microcontroller Workshop 2005, this workshop is aimed toward introducing participants to the exciting world of flash microcontroller. Along with the workshop all participants will get their own sort copy of PIC datasheet, notes on PIC Microcontroller, PIC programmer - L4128D (10 sets), PIC16F877A (10 sets), along with all the software to assemble and program the device. More importantly, a set of fully documented projects will be introduced to give some basic concepts and ideas for starters… So there is no reason why you cannot start using microcontroller in your academic and hobby projects. While this workshop is aimed toward explaining the operation of the microcontroller in the simplest way possible, the complexity and full potential of the microcontroller we leave it to the participants to explore.
Though our main focus is to provide an easy explanation for starters to encourage them in building their first project, we will still try to cover as much detail on the microcontroller. We hope that participants will get extra information from other sources like the Internet or the follow-up workshop on advance microcontroller programming (Hopefully coming soon). It is hoped that this workshop will give a starting push for participants to understand basics of microcontroller and open a new path for future development in this field.
So let the journey begin…
Basically, microcontroller is a small and compact chip which can reads input, process and produce output to control other electronic devices. There are so many brands of microcontroller available in the market today, such as PIC, Motorola, Philip, Hitachi and Atmel. Each one excel in their own way, this workshop may last forever to cover each one of them. But the similarities between different microcontrollers enable us to concentrate on one and apply our knowledge to other platforms. We will be emphasizing on the PIC® family in this workshop. PIC microcontroller is designed by Microchip which has more than 100 types of PIC MCU, dsPIC, EEPROMs, battery charger and radio component. It provides total solution in term of hardware, software and tools. The development tools include: MPLAB IDE, Programmer, C compiler, Debugger, Application Notes and many more. Please remember while the PIC® microcontroller enables you to learn about microcontrollers, you should always consider the vast array of different microcontroller available when coming to serious applications.
Why PIC® Microcontrollers? PIC® microcontrollers are easy to acquire, inexpensive, have low cost development tools and powerful. Other advantages such as easy to load program, large program memory space make it suitable for students or hobbyists.
Major nationwide distributors like Farnell carry full line of PIC® microcontrollers. With large purchases the price can be fairly cheap, even single purchase will be only around RM15 to RM60. It also has variety of packing like PDIP for developer and PLCC for manufacturer. Besides this, most development software for PIC® is distributed as freeware (example MPLAB IDE and ICPROG). As for the hardware development tools like low cost programmer, Bootloader and Startup Kit are also available at Cytron Enterprises. So you can have the whole set of development tools in less than RM150. This is fairly cheap compared to the commercial programmers, which may cost up RM300.
Other than that, there are a lot of standard/special features in low and mid range PIC® microcontrollers like WDT (watchdog timer), multiple interrupt vectors, and EEPROM which can be very useful in programming complex codes. Another extra advantage is the comprehensive online support by Microchip Inc. at www.microchip.com, which offers up-to-date information and technical support (personally rated top for online resource and support). Besides this, Microchip Inc. also provides gives free sample for prototyping purposes and will soon have the online purchasing service coverage in Malaysia. There are also plenty of free project and sources code you can found from Internet. All these advantages come in without short-changing in performance. With the executing speed of 5 MIPS (mega instruction per second), there is virtually nothing you cannot do with the PIC®. For this workshop we will emphasize and introduce more details in PIC16F877A as the chip can be easily use and obtain at a cheap price (about RM40).
2.1 PIC Architecture
Before we getting to know about PIC Architecture, let’s take a look on other microcontroller Architecture. Normally there are Von-Neuman Architecture which used in: 80X86 (PCs), 8051, 68HC11, etc. There are only one bus between CPU and memory that only allow RAM and program memory to share the same bus, thus they must have the same bit width. The bottleneck happens when you getting instructions interfere with accessing RAM. Generally, with Von-Neuman Architecture, longer instruction set and more cycles are required to perform a instruction.
How about PIC? The PIC microcontroller architecture is based on a modified Harvard RISC instruction set that provides an easy migration path from 6 to 80 pins and from 384 bytes to 128K bytes of program memory. By combining the RISC features with a modified Harvard dual-bus architecture, Microchip's fast and flexible 10 MIPS PIC18F core is the most popular architecture for new microcontroller designs. The advantage of having separate program bus and data bus is the program and data can be different widths. For Instance, PICs use Data memory (RAM)in a small number of 8bit registers and Program memory (ROM) in 12bit, 14bit or 16bit wide (in EPROM, FLASH, or ROM)