90 likes | 209 Views
A Quick Start Guide to PIC16F877 microcontroller And Microchip Development Environment. De Silva C. R. eledscr@nus.edu.sg. About PIC 16F877 Microcontroller. A single 40 pin IC that include. A Microcontroller Unit (MCU) 8kB of Flash Memory (Program Memory)
E N D
A Quick Start Guide to PIC16F877 microcontroller And Microchip Development Environment De Silva C. R. eledscr@nus.edu.sg
About PIC 16F877 Microcontroller A single 40 pin IC that include • A Microcontroller Unit (MCU) • 8kB of Flash Memory (Program Memory) • 384 Bytes of RAM (Data Memory) • Several Pheripheral devices that include • Digital IO ports • Analog to Digital Coverters • Serial Communication Ports • Programable Timers • Interrupt Controller
A Simplified Block Diagram MCU Unit Data Memory PORT A PORT B PORT D PORT E Digital I/O Multiplexed via PORT A PORT E Analog I/O FLASH Program Memory Timer Comm. Complete product documentation available at http://www.microchip.com
Development Tools (software) • Microchip MPLAB • An IDE • Built in assembler MPASM • Support 3rd part tools • Available FOC at • http://www.microchip.com • HiTech Pic C Compilar • ANSI C Compatible • Run inside MPLAB • 60 day evaluation version available at • http://www.htsoft.com
Development Tools (Hardware) Programmer Your Design (PIC16F877) Debugger In Circuit Emulator
+5v Output GND Example Design …. • Tracking position of a Joystick PIC16F877
+5v Output GND Example Design …….. PortC_0 PortC_1 PortA_1 PortC_2 PortC_3 PIC16F877 PortC_4 PortC_5 PortC_6 PortC_7 GND
Program Flowchart …. Setup Ports/ AD converter Start Conversion Complete ? Convert ADC output to LED values Output LED values
Some Useful ideas ….. • Data RAM is a limited resource in MCU’s, use them only when needed. • Try incorporate most functionality into the resources available in the MCU reducing the component count • Wherever possible keep signals and values in digital form. • Do not overload outputs • Document your programs • Neat wiring and good component layout becomes helpful when debugging • Always read component datasheets before you use them