11. PIC16F Family 5 MIPS 8-bit Core 8b ALU 1 x 8b W Register 64 – 368 B Data Memory Memory Bus .5 - 14 KB Flash Memory 64 - 256 B EEPROM Peripheral Bus WDT & Pwr Mgmt. 18 - 64-pin Packages UART w/LIN SPI (2)8b/16b Timers INTRC 16Mhz Interrupt Control I 2 C™ (14ch)10b ADC Output Compare/PWM Input Capture (2) Comparators nanoWatt XLP
12.
13.
14. Nick controls Watering remotely using Internet TMR1 Input Output Light Detector PIC Water Valve Control 8 8
15. Nick controls Watering remotely using Internet TMR1 Input Output Light Detector PIC Water Valve Control 8 8
16. PIC18 Family 10 MIPS 8-bit Core 8-bit ALU Register File 16 bit 8 x 8 MPY Address Generation Barrel Shifter Memory Bus 4 - 128 KB Flash 0.25 - 4 KB RAM Peripheral Bus Interrupt Control PIC18F Core 40 - 64MHz 10 - 16 MIPS 8-bit ALU Register File 8 bit 8 x 8 MPY 2MB Address Space 0 - 1 KB EEPROM Peripheral Pin Select Real Time Clk Calendar Ethernet MAC/PHY CAN Charge Time Meas Unit USB 18 – 100 pin packages UART with LIN - 2 SPI / I 2 C TM - 2 Capture / Compare PWMs 8/16-bit Timers – 2/3 Watchdog Timer Comparators - 2 ADC, 10/12-bit, 16 ch. nanoWatt XLP Low Power Resources
17.
18.
19.
20.
21.
22.
23.
24.
25.
Notas do Editor
Welcome to the training module on 8-bit PIC ® Microcontrollers.
This training module will introduce Microchip’s 8-bit PIC microcontrollers.
To help you understand Microchip’s product line, let us use a very common application example. In this example we have Nick watering his garden every day. Every morning Nick wakes up and waters his garden for about 10 minutes. This he repeats every day.
Well the challenge Nick has is what if he were to go on a vacation or fell ill or was just lazy one morning. Wouldn’t it be nice if he could replace himself with an automated system which would do the same function every day? All he needs is a sun detector, a valve opener/closer to allow for water control and a timer to do the 10 minute watering.
If we replace Nick with a PIC MCU, then here is what it would look like. In this example a simple PIC MCU with one input for the light detector and one output for a water valve control is all that is needed as Input/Output. An internally timer is included inside the PIC to keep track of time. The light detector detects the sunrise, the valve is then opened for 10 minutes after which it is shut. This can be repeated every day with no intervention from Nick.
For this simple application the ideal part would be from the PIC10/12 product line. These PICs are 6 and 8 pin devices which have very small footprints are low cost, easy to program and have enough I/O, program and data memory to accomplish simple tasks. As shown in this block diagram they have ½ to 2 k bytes of flash program memory, up to 128 bytes of ram and 256 bytes of EEPROM. They all have 4 and/or 8 MHz internal oscillators and some have a 10-bit ADC on them along with Comparators, input capture and output compare PWM. These parts can be programmed using C.
These families offer low pin count and small form factor. Packaged in either a 2x3 DFN or 6-pin SOT-23, the families both provide a 4MHz & 8MHz internal oscillator in addition to an integrated analog comparator, 10-bit ADC, Input Capture and output PWM. 16 products are available with 2kbytes of flash, 128 bytes of ram and 256 bytes of EEPROM.
Coming back to our example of Nick and his garden watering system. Let us provide a new challenge to Nick. Nick’s wife wants to add summer crops to the garden. Nick now has to take care of new issues to the simple 10 minute water system that he initially built. Summer crops need different watering amounts and watering at different times of the day. One way he could solve this issue is to build many of his simple systems to take care of each summer crop. Alternatively he could re-design his system and build a programmable Unit which will take care of all the watering schemes need.
A typical programmable unit would need a keypad to do data entry. A LCD to view the data entry. It would still need a light detector and valve control unit like the simple system that Nick designed. It could include a serial interface connected to a computer, which would make programming the system easy.
In a bullet format he now needs an LCD display and keypad. Many more outputs and inputs to handle more external interfaces. He requires analog inputs to interface to light, humidity and other sensors and finally he need a serial interface like RS232 or USB. Obviously the PIC10/12 that Nick used previously will have to be upgraded to a bigger and large PIC.
Which brings us to the PIC16F family of parts. The blocks in red are the one which have new and/or improved capability from the PIC10/12 family of parts. Here we will notice larger flash, data and EEPROM memory, the core remains more or less the same but they have more serial interfaces like UARTs, I2C, SPI, larger package devices up to 64 pins and more timers and other peripherals. Some PIC16F family products can also drive LCD glass directly. Lastly interrupt control is now available on this family to allow for quick response to external events or actions.
This family is available in larger pin count devices up to 64 pins and more than 75 products running at speeds of 20 MHz. These MCUs offer more flash, RAM and EEPROM. More analog inputs include internal op amps, comparators and A/D converters. These devices also feature various serial interfaces like UART, SPI, I2C and USB, digital input/output controls like Capture, Compare and PWMs, direct LCD drivers. All PIC16F family parts can be programmed using C. With all these capabilities Nick can easily build a programmable waters system.
A latest addition to the PIC16F family of parts is the Enhanced PIC16F Product line. The improvements include 10 new products with larger pin count and running faster at 32 MHz. Larger flash and RAM for larger programs and programming using C. More peripherals like dual UARTs, dual SPI and dual I2C. With most new designs being written mainly in C the new enhanced PIC16F devices have been re-designed to meet the larger program needs and run faster. If for some reason Nick ran out of space for his programmable system he could easily move to the enhanced PIC16F family and get more flash, and RAM for his program. Please note the enhanced core Is identified by the 1XXX after the PIC16F.
Back to our application example with Nick’s water system. Let us now offer another challenge to Nick.
What if Nick wants to now connect his system to the internet and monitor his water system remotely when he is working. Well most of the other peripherals would remain the same that is the keypad, LCD, input and output sensors interfaces etc. Now he has to add internet connectivity to his system. Does he need to upgrade his system?
In order to meet the connectivity requirement, let us now introduce the PIC18 Family of products. Again the changes are all highlighted in red blocks. First connectivity to the internet is not trivial so more flash and data memory is now available to accommodate that requirement. The core itself has been improved to include a faster CPU running up to 16 MIPS for faster operation. Larger pin count up to 100 pins devices are available. Additional peripherals like USB, ethernet and CAN are now included in this family. A new module called the charge time measurement unit or CTMU has also been added. The CTMU is a Microchip patented peripheral which allows a designer to measure small changes in capacitance and time and also generate short pulses. Lastly a peripheral pin select peripheral has been added which allows a designer to re-configure digital peripherals to different pin on the device.
PIC18 has more than 165 products with large flash and RAM for bigger programs and larger applications written using C. These devices feature advanced peripherals like USB, Ethernet and Can, higher resolution ADC up to 12-bits, new Charge time measurement unit or CTMU, integrated LCD drivers to drive glass directly, peripherals pin select peripherals which can reconfigure digital input/output to different pins on the device. With such a device Nick can now build his programmable watering system and connect to the internet to monitor his watering system.
Now let us look at what hardware tools are available from microchip to help you accelerate your design. Depending on the complexity of your application you have a three tier solution for selecting a debugger. The top of the line debugger from Microchip is the MPLAB Real Ice. This is a high performance real time debugger with unlimited debugging capability and real time data monitoring features. The middle of the road solution is the MPLAB ICD3. This debugger offers limited debugging and real time data monitoring features. At the low end of the spectrum is the PICkit 3 debug express which is Microchip’s entry level debugger. For a simple application like Nick’s first watering system, Nick could very easily have used the Debug Express. For his next design where he built a programmable watering system he would be wise to choose the ICD3 and for his complex ethernet connectivity design he would have done well to choose the Real Ice debugger.
In order to jump start the hardware platform for your design, Microchip offer a whole list of starter kits. The most important feature offered in a starter kit is that a debugger is included as part of the starter kit. The starter kit is low cost and has some hardware and prototyping area for a customer to evaluate a PIC product. All starter kits are supported on MPLAB and most are bundled with a C compiler making it easy for the end user to program and evaluate the PIC device.
The first starter kit is the PICkit 2 starter kit. This comes with a PICkit 2 debugger a demo board for 8, 14 and 20 pin count PIC16F devices, 12 lessons to easily learn how to program the part provided which is a PIC16F690 device. A lite version of the Hi-tech C compiler and MPLAB IDE. This would be an ideal starter kit for Nick to begin development on his first simple watering system.
A slight upgrade to the PICkit2 starter kit is the PICkit 3 starter kit. Microchip’s PICkit 3 In-Circuit Debugger/Programmer uses in-circuit debugging logic incorporated into each chip with Flash memory to provide a low-cost hardware debugger and programmer. Again tutorials and lessons to program this part are provided along with a lite version of the C compiler. This would be a good starter kit for Nick to use in his programmable watering system.
Another starter kit which would help Nick design his programmable unit would be the PIC18F4xK20 starter kit. This demo board comes with a OLED display. Again it has the lessons and demos as well as the C compiler bundled with board.
For connectivity related application the PIC18 Starter Kit is a very good option. The debugger comes built on the board and is powered by the USB cable to the PC. A OLED display is available along with cap touch keys built on the demo board. Full demos on USB connectivity are available for this board and it shipped with a free C compiler. This would be ideal for Nick to design his programmable watering system with connectivity using USB.
In summary Microchip offers a wide range of 8-bit products from simple to very complex. Microchip offers easy and low cost hardware and software solutions in low cost starter kits and free c compilers for easy code and application development. Finally Microchip meets Nick’s needs as a one stop for his plant watering application.
Thank you for taking the time to view this presentation on “ 8-bit PIC ® Microcontrollers ” . If you would like to learn more or go on to purchase some of these devices, you may either click on the part list link, or simply call our sales hotline. For more technical information you may either visit the MICROCHIP site, or if you would prefer to speak to someone live, please call our hotline number, or even use our ‘live chat’ online facility. You may visit Element 14 e-community to post your questions.