21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 11 PIC12F629PIC12F629 IntroductionIntroduction RNDr. Vojtěch KrmíčekRNDr. Vojtěch Krmíček vojtec@ics.muni.czvojtec@ics.muni.cz Ing. Zbyněk Bureš, Ph.D.Ing. Zbyněk Bureš, Ph.D. zbynek.bures@unob.czzbynek.bures@unob.cz 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 22 Basic dataBasic data High Performance RISC CPU: – Only 35 instructions to learn – All single cycle instructions except branches Operating speed: – DC - 20 MHz oscillator/clock input – DC - 200 ns instruction cycle Interrupt capability – 8-level deep hardware stack Direct, Indirect, and Relative Addressing modes 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 33 Basic dataBasic data Special Microcontroller Features: – Internal and external oscillator options – Precision Internal 4 MHz oscillator factory calibrated to ±1% – External Oscillator support for crystals and resonators – Power saving SLEEP mode – 5μs wake-up from SLEEP, 3.0V, typical – Wide operating voltage range - 2.0V to 5.5V 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 44 Basic dataBasic data Low Power Features: – Standby Current: – 1nA @ 2.0V, typical Operating Current: – 8.5μA @ 32 kHz, 2.0V, typical – 100μA @ 1 MHz, 2.0V, typical Watchdog Timer Current – 300 nA @ 2.0V, typical Timer1 oscillator current: – 4μA @ 32 kHz, 2.0V, typical 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 55 Basic dataBasic data Peripheral Features: – 6 I/O pins with individual direction control – High current sink/source for direct LED drive – Analog comparator module with: – One analog comparator – Programmable on-chip comparator voltage reference (CVREF) module – Programmable input multiplexing from device inputs – Comparator output is externally accessible 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 66 Basic dataBasic data Peripheral Features: – Analog-to-Digital Converter module (PIC12F675): – 10-bit resolution – Programmable 4-channel input – Voltage reference input 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 77 Basic dataBasic data Peripheral Features: – Timer0: 8-bit timer/counter with 8-bit programmable prescaler – Enhanced Timer1: 16-bit timer/counter with prescaler External Gate Input mode Option to use OSC1 and OSC2 in LP mode as Timer1 oscillator, if INTOSC mode selected – In-Circuit Serial ProgrammingTM (ICSPTM) via two pins 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 88 Basic dataBasic data PackagePackage 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 99 Block diagramBlock diagram 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 1010 Memory Map & StackMemory Map & Stack 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 1111 RegistersRegisters 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 1212 StatusStatus 21.2.201121.2.2011 PB171 Spring 2011PB171 Spring 2011 1313 Instruction setInstruction set