Special Features. Device Configuration bits Revision Device Configuration bits Revision On-chip Power-on Reset (POR) Revision On-chip Power-on Reset (POR)

Slides:



Advertisements
Similar presentations
Introduction to PIC Microcontrollers
Advertisements

م/محمد علي عطية حسين. Pin Diagram DescriptionPin Name Oscillator crystal input/external clock source input. OSC1/CLKIN Oscillator crystal output.OSC2/CLKOUT.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Introduction of Holtek HT-46 series MCU
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Microcontroller Architecture— PIC18F Family
External & internal Interrupts. Interrupt Sources There are 21 different interrupts and each one has its own vector located in a predefined location at.
The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – System Control Refer to Chapter 6 in the reference book “Stellaris® LM3S9B96 Microcontroller.
BLDC MOTOR SPEED CONTROL USING EMBEDDED PROCESSOR
NS Training Hardware. System Controller Module.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Lecture – 6 PIC18 Family Hardware Specifications 1.
3-1 System peripherals & Bus Structure Memory map of the LPC2300 device is one contiguous 32-bit address range. However, the device itself is made up of.
AVR Reset Sources When a reset event occurs.... -I/O registers set to initial values immediately -internal delay stretched to allow power to stabilize.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 Clock Generator.
System Clocks.
Parallel Ports, Power Supply and the Clock Oscillator Material to be covered  Parallel I/O ports  Interfacing external switches and LEDs  Clock Oscillator.
M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.
16F877A. Timer 0 The Timer0 module timer/counter has the following features: –8-bit timer/counter –Readable and writable –8-bit software programmable.
Timers The timers of the PIC16C7X microcontroller can be briefly described in only one sentence. There are three completely independent timers/counters.
Clock Options and Sleep Modes. Clock Sources Flash Fuse bits can be programmed to choose one of the following Clock sources: 1. External RC Osc. f = 1/(3RC).
Prepared by Eng. Musa Alyaman1 Chapter Seven Chapter Seven PIC16F87x.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an overview of the CPU architecture.
Lecture 11 Low Power Modes & Watchdog Timers
RX Voltage Detection Circuit (LVD) and Power-On Reset (POR)
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
1 General Purpose and Alternate Function I/O (GPIO and AFIO)
Timer Timer is a device, which counts the input at regular interval (δT) using clock pulses at its input. The counts increment on each pulse and store.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
Architecture and instruction set. Microcontroller Core Features:  Operating speed: DC - 20 MHz clock input DC ns instruction cycle Up to 8K x.
Saxion University of Applied Sciences Advanced Microcontrollers A practical approach.
ECE 447 Fall 2009 Lecture 7: MSP430 Polling and Interrupts.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
DsPIC30F4011 Fall DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
DsPIC30F4011.
I NTRODUCTION TO PIC PROGRAMMING By : S HERIF H ARHASH.
System Integration Module MTT Motoola SYSTEM INTEGRATION MODULE (SIM)
Device Overview 1.  The advantages of all PIC18Fxxxx microcontrollers:  High computational performance  High-endurance  Enhanced Flash program memory.
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
PIC16F887.
Microcontrollers session. What is Microcontroller? Microcontroller is composed of microprocessor,ram, flash memory,EEPROM and some modules like timers,
PIC12F629/675. “Wide variety” 8-84 pin RISC core, 12/14/16bit program word USART/AUSART, I 2 C, ADC, ICSP, ICD OTP/UV EPROM/FLASH/ROM Families: PIC12,
Components of a typical full-featured microcontroller.
NAM S.B MDLAB. Electronic Engineering, Kangwon National University 1.
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
I/O PORTS. General purpose I/O pins can be considered the simplest of peripherals. They allow the PICmicro™ to monitor and control other devices. To add.
TIMERS.
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
Timer modules in PIC 16F877.  The PIC 16F877 basically has three independent timer modules,  denoted by the symbols, TIMER-0, TIMER1,andTIMER2. . These.
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
16F877A.
Refer to Chapter 5 in the reference book
Microprocessors and Programming Department of Mechatronics Engineering
UNIT – Microcontroller.
Microprocessors Timers
Reset Sources and Watchdog Timer
Project Title EVM IN PIC Under the Guidance of Submitted by.
Pugazhendhi.M 11/12/2018 TIMERS 11/12/2018 CCET CCET.
전자의료시스템 및 실습 System Configuration/Interrupt
8051 Micro Controller.
Microprocessors and Programming Department of Mechatronics Engineering
Presentation transcript:

Special Features

Device Configuration bits Revision Device Configuration bits Revision On-chip Power-on Reset (POR) Revision On-chip Power-on Reset (POR) Revision Brown-out Reset (BOR) logic Revision Brown-out Reset (BOR) logic Revision Watchdog Timer Revision Watchdog Timer Revision Low power mode (Sleep) Revision Low power mode (Sleep) Revision Internal RC device oscillator Internal RC device oscillator

Device Configuration Bits

The device configuration bits allow each user to customize certain aspects of the device to the needs of the application. When the device powers up, the state of these bits determines the modes that the device uses. Device Configuration Bits These bits are mapped in program memory location 2007h.

bit 13 CP: Flash Program Memory Code Protection bit Protection bit 1 = Code protection off 0 = All program memory code-protected bit 11 bit 11 DEBUG: In-Circuit Debugger Mode bit 1 = In-Circuit Debugger disabled, RB6 and RB7 1 = In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins are general purpose I/O pins 0 = In-Circuit Debugger enabled, RB6 and RB7 0 = In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger are dedicated to the debugger

bit 10-9 WRT1:WRT0 Flash Program Memory Write Enable bits Write Enable bits 11 = Write protection off; all program memory may be written to by EECON control 10 = 0000h to 00FFh write-protected; 0100h to 1FFFh may be written to by EECON control 01 = 0000h to 07FFh write-protected; 0800h to 1FFFh may be written to by EECON control 00 = 0000h to 0FFFh write-protected; 1000h to 1FFFh may be written to by EECON control

bit 8 bit 8 CPD: Data EEPROM Memory Code Protection bit 1 = Data EEPROM code protection off 0 = Data EEPROM code-protected bit 7 LVP: Low-Voltage (Single-Supply) In- Circuit Serial Programming Enable bit Circuit Serial Programming Enable bit 1 = RB3/PGM pin has PGM function; low- voltage programming enabled 0 = RB3 is digital I/O, HV on MCLR must be used for programming

bit 6 BODEN: Brown-out Reset Enable bit 1 = BOR enabled 0 = BOR disabled bit 3 PWRTEN: Power-up Timer Enable bit 1 = PWRT disabled 0 = PWRT enabled bit 2 WDTEN: Watchdog Timer 1 = WDT enabled 0 = WDT disabled

bit 1-0 FOSC1:FOSC0: Oscillator Selection bits 11 = RC oscillator 10 = HS (High speed) oscillator 01 = XT oscillator 00 = LP (Low Power) oscillator

; list directive to define processor list p=16f877a ; list directive to define processor ; processor specific variable definitions #include ; processor specific variable definitions __CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _XT_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF & _DEBUG_ON MPASM’s CONFIG Directive

Reset The PIC16F87XA differentiates of Reset: Power-on Reset (POR) Power-on Reset (POR) MCLR Reset during normal MCLR Reset during normal MCLR Reset during Sleep MCLR Reset during Sleep WDT Reset (during normal WDT Reset (during normal WDT Wake-up (during Sleep) WDT Wake-up (during Sleep) Brown-out Reset (BOR) Brown-out Reset (BOR)

Power-on Reset (POR) A Power-on Reset pulse is generated on-chip when VDD rise is detected (in the range of 1.2V-1.7V). Power-up Timer (PWRT) The Power-up Timer provides a fixed 72 ms nominal time-out on power-up only from the POR. Oscillator Start-up Timer (OST) The Oscillator Start-up Timer (OST) provides a delay of 1024 oscillator cycles (from OSC1 input) after the PWRT delay is over (if PWRT is enabled).

Brown-out Reset (BOR) If VDD falls below VBOR (parameter D005, about 4V) for longer than TBOR (parameter #35, about 100 μS), the brown- out situation will reset the device. If VDD falls below VBOR for less than TBOR, a Reset may not occur.

SIMPLIFIED BLOCK DIAGRAM OF ON-CHIP RESET CIRCUIT

PCON Register _____ PORBOR bit 1 bit 1 POR: Power-on Reset Status bit 1 = No Power-on Reset occurred 0 = A Power-on Reset occurred (must be set in software after a Power-on Reset occurs) bit 0 bit 0 BOR: Brown-out Reset Status bit 1 = No Brown-out Reset occurred 0 = A Brown-out Reset occurred (must be set in software after a Brown-out Reset occurs)

STATUS BITS AND THEIR SIGNIFICANCE PORBORTOPDCONDITION 0X11 Power-on Reset 1011 Brown-out Reset 1101 WDT Reset 1100 WDT Wake-up 11UU MCLR Reset during normal operation 1110 MCLR Reset during Sleep or Interrupt Wake-up from Sleep

Watchdog Timer & Sleep Mode

Watchdog Timer The Watchdog Timer (WDT) is a free running on-chip RC oscillator which does not require any external components. During normal operation, a WDT time-out generates a During normal operation, a WDT time-out generates a device RESET. device RESET. In SLEEP mode, a WDT time-out causes the device to In SLEEP mode, a WDT time-out causes the device to wake-up and continue with normal operation. wake-up and continue with normal operation.

Watchdog Timer Block Diagram Watchdog Timer WDT Enable Bit POSTSCALER 8 PSA PSA PS2:PS0 From TMR0 To TMR0 To WDT Time Out

OPTION_REG Register (Address 81h,181h) PSAPS2PS1PS0 bit 3 PSA: Prescaler Assignment bit 1 = Prescaler is assigned to the WDT 0 = Prescaler is assigned to the Timer0 module bit 2:0 PS2:PS0: TMR0 Prescaler/WDT Postscaler Rate Select bits

T0CST0ES PSAPS2PS1PS0 bit 5 T0CS: TMR0 Clock Source Select bit 1 = Transition on T0CKI pin 1 = Transition on T0CKI pin 0 = Internal instruction cycle clock (CLKOUT) 0 = Internal instruction cycle clock (CLKOUT) bit 4 T0SE: TMR0 Source Edge Select bit 1 = Increment on high-to-low transition on T0CKI 1 = Increment on high-to-low transition on T0CKI pin pin 0 = Increment on low-to-high transition on T0CKI 0 = Increment on low-to-high transition on T0CKI pin pin

RBPUINTEDG T0CST0ESPSAPS2PS1 bit 6 bit 6 INTEDG: Interrupt Edge Select bit 1 = Interrupt on rising edge of INT pin 1 = Interrupt on rising edge of INT pin 0 = Interrupt on falling edge of INT pin 0 = Interrupt on falling edge of INT pin bit 7 RBPU : Weak Pull-up Enable bit 1 = Weak pull-ups are disabled 1 = Weak pull-ups are disabled 0 = Weak pull-ups are enabled by individual 0 = Weak pull-ups are enabled by individual port latch values port latch values PS0

Watchdog Timer WDT Enable Bit POSTSCALER 8 PSA From TMR0 To TMR0 To WDT Time Out PSA RBPUINTEDGT0CST0ESPSAPS2PS1PS0 OptionRegister X X X X

RBPUINTEDGT0CST0ESPSAPS2PS1PS0 OptionRegister X X X X Watchdog Timer WDT Enable Bit POSTSCALER 8 PSA From TMR0 To TMR0 To WDT Time Out PSA

WDT Period The WDT has a nominal time-out period of 18 ms 18 ms WDT Rate Time-out period WDT Rate Time-out period 1:2 36ms 1:2 36ms 1:3 54ms 1:3 54ms : : : : 1: sec 1: sec

Sleep Mode Sleep (Power-down) mode is a mode where the device is placed in it’s lowest current consumption state. Watchdog Timer will be cleared but keeps running Watchdog Timer will be cleared but keeps running PD bit in the STATUS register is cleared TO bit is set TO bit is set Oscillator driver is turned off Oscillator driver is turned off The I/O ports maintain the status they had, The I/O ports maintain the status they had, before the SLEEP instruction was executed before the SLEEP instruction was executed

The device can wake-up from SLEEP through one of the following events: 1. Any device reset. 2. Watchdog Timer Wake-up (if WDT was enabled). 3. Any peripheral module which can set its interrupt flag while in sleep, such as: while in sleep, such as: - External INT pin - Change on port pin - Comparators - A/D - Timer1 - LCD - SSP - Capture

Wake-up Using Interrupts When interrupts are globally disabled (GIE cleared) and any interrupt source has both its interrupt enable bit and interrupt flag set, one of the following events will occur: If the interrupt occurs before the execution of a SLEEP instruction, the SLEEP instruction will complete as an NOP. Therefore, the WDT and WDT postscaler will not be cleared, the TO bit will not be set and PD bit will not be cleared. If the interrupt occurs during or after the execution of a SLEEP instruction, the device will immediately wake-up from sleep. The SLEEP instruction will be completely executed before the wake-up. Therefore, the WDT and WDT postscaler will be cleared, the TO bit will be set and the PD bit will be cleared.