CENG-336 Introduction to Embedded Systems Development. Timers

Size: px
Start display at page:

Download "CENG-336 Introduction to Embedded Systems Development. Timers"

Transcription

1 CENG-336 Introduction to Embedded Systems Development Timers

2 Definitions A counter counts (possibly asynchronous) input pulses from an external signal A timer counts pulses of a fixed, known frequency usually the system clock for the processor A timer is basically a counter operated by the processor clock. It can count down a fixed number of clock cycles. Almost all microcontrollers have built in timers. CENG-336 Introduction to Embedded Systems Development 2

3 Definitions... Physically, PIC Timer is a register whose value is continually increasing to 255, and then it starts all over again: 0, 1, 2, 3, , 0, 1, 2, 3, 4... etc. CENG-336 Introduction to Embedded Systems Development 3

4 Definitions... This incrementing is done in the background of everything a microcontroller does. It is up to programmer to think up a way how (s)he will take advantage of this characteristic for his needs. One of the ways is increasing some variable on each timer overflow. If we know how much time a timer needs to make one complete round, then multiplying the value of a variable by that time will yield the total amount of elapsed time. CENG-336 Introduction to Embedded Systems Development 4

5 Timers / Event Counters Uses of Programmable Timers and Event Counters 1. Generate real-time interrupts 2. Output precisely timed signals 3. Programmable baud rate generator 4. Measure time between events 5. Count external events 6. Generate event caused interrupts CENG-336 Introduction to Embedded Systems Development 5 III-65

6 Timers / Event Counters... Timer applications Frequency measurement Waveform generation (e.g. sound) time base (multi task system, sampling system,...) CENG-336 Introduction to Embedded Systems Development 6

7 Timer (8253 used in PC) Three identical timer elements Actually they are counters of the clock Inputs are clock and gate Output Changes or pulses when counting cycle is complete Modes Interrupt on countdown One-shot Pulse rate generator Square-wave generator Software-triggered strobe Hardware-triggered strobe Timer 0 Timer 1 Timer 2 Registers 0 - Counter Counter Counter Control for all clock gate output clock gate output clock gate output CENG-336 Introduction to Embedded Systems Development 7

8 Common Timer Applications Combinations of connection and mode Examples Internal speaker periodic interrupt using countdown from system clock and square-wave mode counter input controls frequency 18HZ interrupt 4.77 MHz clock counted down by 12, then by 64K pulse-rate generator mode Clk constant rate Gate - event Out to IRQ Time interval measurement Event counter Clk - event Gate - on Out - ignored Clk constant rate Gate - on Out to IRQ Delay or periodic interrupt CENG-336 Introduction to Embedded Systems Development 8

9 Available in all PICs PIC Timers May generate interrupts on timer overflow Some 8 bits, some 16 bits, some have prescalers Some can connect to external clock, some to the processor clock, some to either. Read/write a number as the current count is possible for some. CENG-336 Introduction to Embedded Systems Development 9

10 PIC Timers Can use external pin as clock in / clock out (i.e. for counting events) Warning: Some Peripherals shares timer resources. CENG-336 Introduction to Embedded Systems Development 10

11 PIC Timers The device has three readable and writeable hardware timers that can increment automatically each instruction cycle (if no prescaler is used). All timers can cause an interrupt on overflow, and then restart from zero. CENG-336 Introduction to Embedded Systems Development 11

12 PIC Timers Timer 0 Timer 1 timer/counter with prescale timer/counter with prescale Timer 2 timer only with prescale and postscale Watch Dog Timer (to be discussed later) CENG-336 Introduction to Embedded Systems Development 12

13 Timers TIMER0 is an 8-bit timer with an eight bit prescaler, which can make the timer run 2 to 256 times slower than normal TIMER1 is a 16-bit timer (two 8-bit registers) with a 1:1 to 1:8 prescaler and some other features. Used by given C code to generate soft timer and sound TIMER2 is an 8-bit timer with 1:1 to 1:16 prescaler and a 1:1 to 1:16 postscaler It also has a period register.used by given C code for PWM motor control CENG-336 Introduction to Embedded Systems Development 13

14 PIC Timers / Timer0 8 bit timer/counter with prescaler Readable and writeable 8-bit software programmable prescaler Internal or external clock set Interrupt on overflow from 0xFF to 0x00 Edge Select for external clock CENG-336 Introduction to Embedded Systems Development 14

15 Pre-Scaler Prescaler is a name for the part of a microcontroller which divides oscillator clock before it will reach logic that increases timer status. The number which divides a clock is defined through lowest-order order three bits in OPTION register. The highest divisor value is 256. This actually means that only at every 256th clock, timer value would increase by one. This provides us with the ability to measure longer time periods. CENG-336 Introduction to Embedded Systems Development 15

16 Input clock with frequency: f Pre-Scaler... f f/2 f/4 f/8 f/16 f/32 f/64 f/ f/256 Input 0 Input 7 8 input to 1 output multiplexer Selects one of the inputs to connect to output Prescaler output PS2, PS1, PS0 : PreScaler select inputs: Binary number on these 3 bits determine which input (0..7) to be selected Note: if prescaler is disabled, input (f) is directly connected to the counter CENG-336 Introduction to Embedded Systems Development 16

17 Pre-Scaler... CENG-336 Introduction to Embedded Systems Development 17

18 Timers... After each count up to 255, timer resets its value to zero and starts with a new cycle of counting to 255. During each transition from 255 to zero, T0IF bit in INTCON register is set. If interrupts are allowed to occur, this can be taken advantage of in generating interrupts and in processing interrupt routine. It is up to programmer to reset T0IF bit in interrupt routine, so that new interrupt, or new overflow could be detected. CENG-336 Introduction to Embedded Systems Development 18

19 CENG-336 Introduction to Embedded Systems Development 19

20 Controlling Timers The timer is controlled by a number of bits in the Option Register. All processors are nothing more than a collection of gates. While this may be hard to tell in a very complex processor like a Pentium, the PIC is a very simple processor, and sometimes this actual simplicity makes itself obvious. The timer is one of those cases. CENG-336 Introduction to Embedded Systems Development 20

21 Option Register The option register is used to control a number of processor features. The least significant six bits of the option register control the timer logic. The OPTION_REG register is a readable and writable register which contains various control bits to configure the TMR0/WDT prescaler, the External INT Interrupt, TMR0, and the weak pull-ups on PORTB. CENG-336 Introduction to Embedded Systems Development 21

22 Selecting Parameters In order to set up the timer, it is necessary to first decide the time interval needed. The basic timer rate is one microsecond (with a 4 MHz crystal). This one microsecond clock is divided by the prescaler, which can be set to divide by 2, 4, 8, 16, 1 32, 64, 128 or 256. The timer register itself has 8 bits, so it can count to 256. Thus, it is necessary to service the timer with software at least every 256*256 microseconds, or micro croseconds (assuming a 4 MHz clock). CENG-336 Introduction to Embedded Systems Development 22

23 Alternative Usage... Alternative to the internal oscillator clock, timer status can also be increased by the external clock on RA4/TOCKI pin. Choosing one of these two options is done in OPTION register through T0CS bit. If this option of external clock was selected, it would be possible to define the edge of a signal (rising or falling), on which timer would increase its value. CENG-336 Introduction to Embedded Systems Development 23

24 Example In practice, one of the typical example that is solved via external clock and a timer is counting full turns of an axis of some production machine, like transformer winder for instance. Let's wind four metal screws on the axis of a winder. These four screws will represent metal convexity. Let's place now the inductive sensor at a distance of 5mm from the head of a screw. CENG-336 Introduction to Embedded Systems Development 24

25 Example... Inductive sensor will generate the falling signal every time the head of the screw is parallel with sensor head. Each signal will represent one fourth of a full turn, and the sum of all full turns will be found in TMR0 timer. Program can easily read this data from the timer through a data bus. CENG-336 Introduction to Embedded Systems Development 25

26 Example... CENG-336 Introduction to Embedded Systems Development 26

27 Initializing the Timer CENG-336 Introduction to Embedded Systems Development 27

28 Initializing the Timer... Prescaler can be assigned either timer TMR0 or a watchdog. Watchdog is a mechanism which microcontroller uses to defend itself against programs getting stuck. Prescaler is accorded to timer TMR0, or to watchdog timer trough PSA bit in OPTION register. By clearing PSA bit, prescaler will be accorded to timer TMR0. When prescaler is accorded to timer TMR0, all instructions of writing to TMR0 register (CLRF TMR0, MOVWF TMR0, BSF TMR0,...) will clear prescaler. Prescaler change is completely under programmer's control, and can be changed while program is running. CENG-336 Introduction to Embedded Systems Development 28

29 Option Register... CENG-336 Introduction to Embedded Systems Development 29

30 All of the acronyms along the bottom of the diagram refer to bits in the option register, except for T0IF (Timer0 interrupt flag), which is a bit in the INTCON register. Starting at the left, the processor clock is divided by four and fed into a gate. This division by four results in a single cycle per instruction execution. In the case of a 4MHz processor crystal, this conveniently results in a 1 MHz clock. CENG-336 Introduction to Embedded Systems Development 30

31 When bit T0CS (Timer0 clock select) is false, the clock is fed into a prescaler. The prescaler ratio is set by bits PS2, PS1 and PS0. *Wrong* If the PSA bit is false, the output of the prescaler is then routed to the TMR0 register, after synching with other internal clocks. This causes a 2 cycle delay, which is only apparent if we load the TMR0 register with a value. CENG-336 Introduction to Embedded Systems Development 31

32 Every cycle of the prescaler output increments TMR0 by one. We can read as well as write the contents of TMR0. Whenever TMR0 overflows, the T0IF bit in the INTCON register is set. If the INTCON bit T0IE (Timer 0 interrupt enable) is set, this transition of the T0IF bit causes an interrupt, so we will always take care to clear T0IE. CENG-336 Introduction to Embedded Systems Development 32

33 CENG-336 Introduction to Embedded Systems Development 33

34 PIC Timers / Timer1 16-bit timer/counter with pre-scaler Readable and writeable 1, 2, 4, 8 programmable pre-scaler Internal or external clock select External clock can be syn. or asyn. Interrupt on overflow Second crystal permitted CENG-336 Introduction to Embedded Systems Development 34

35 PIC Timers / Timer2 8-bit timer/counter with pre-scaler and post-scaler scaler Readable and writeable 1, 4 or 16 programmable pre-scaler 4-bit programmable post-scaler scaler Interrupt on overflow Output to port pin CENG-336 Introduction to Embedded Systems Development 35

36 Selecting Parameters In order to set up the timer, it is necessary to first decide the time interval needed. The basic timer rate is one microsecond (with a 4 MHz crystal). This one microsecond clock is divided by the prescaler, which can be set to divide by 2, 4, 8, 16, 1 32, 64, 128 or 256. The timer register itself has 8 bits, so it can count to 256. Thus, it is necessary to service the timer with software at least every 256*256 microseconds, or milliseconds (assuming a 4 MHz clock). CENG-336 Introduction to Embedded Systems Development 36

37 Selecting Parameters... The timer register itself can be used to divide by any arbitrary number by simply reloading it whenever the register overflows, and; additional software counters can be updated based on the timer, so it is possible to arrange any desired time. The catch is that, the higher the resolution needed, the more frequently software must service its counters. CENG-336 Introduction to Embedded Systems Development 37

38 Selecting Parameters... Consider for a moment an application that requires a 10-millisecond timer. If the prescaler is set to divide by 64, the timer register can count to milliseconds. If the timer register is preloaded with 100, then the timer will expire in milliseconds. ( )/256 = 9.984/ (Check?) CENG-336 Introduction to Embedded Systems Development 38

39 Selecting Parameters... If one were to use a prescaler division of 16, it is possible to get a delay of exactly 10 milliseconds, however, it would require servicing the timer in software every two milliseconds and maintaining a counter in software. The programmer needs to consider how good is good enough,, balanced against the complexity and the potential that time could be taken from other tasks to watch the clock. Real-time Systems? CENG-336 Introduction to Embedded Systems Development 39

40 Setting up the Timer To set up the timer, one must first disable interrupts so that an interrupt doesn t occur when the timer expires. Then, enable the timer and assign the prescaler to the timer. Establish the prescaler value, and finally, load the timer register. CENG-336 Introduction to Embedded Systems Development 40

41 Setting up the Timer... The bits for enabling the timer, Assigning the prescaler to the timer, The bits that set the prescaler division ratio are all in the same register. Thus, these values may be set bit by bit, or by simply loading the Option register with a value (assuming it is possible to determine benign values for the other bits). CENG-336 Introduction to Embedded Systems Development 41

42 Setting up the Timer... Whenever the timer expires, the T0IF bit in the INTCON register will be set. We must clear this bit, reload the timer register, and then execute the code that is to be done at this time. CENG-336 Introduction to Embedded Systems Development 42

43 Setting up the Timer... CENG-336 Introduction to Embedded Systems Development 43

44 Setting up the Timer... In code, the setup portion might look something like: banksel INTCON bcf INTCON,T0IE banksel OPTION_REG bcf OPTION_REG,T0CS bcf OPTION_REG,PSA bcf OPTION_REG,PS2 ; \ bsf OPTION_REG,PS1 bsf OPTION_REG,PS0 ; / movlw D 100 movwf TMR0 ; Mask timer interrupt ; Enable timer ; Prescaler to timer ; >- 1:16 prescale ; Timer will count ; 156 ( ) counts CENG-336 Introduction to Embedded Systems Development 44

45 Setting up the Timer... Clearly, the individual bits in the option register could all be set with a single store. If we didn t care about the RB0 interrupt, the weak pull-ups, or the transition of RA4, then instead of five bit manipulations we could have said: movlw B movwf OPTION_REG ; Set up prescaler and ; timer CENG-336 Introduction to Embedded Systems Development 45

46 Setting up the Timer... The execution loop might look something like: main btfss INTCON,T0IF ; Did timer overflow? goto main ; No, hang around some more movlw D 100 ; Timer will count movwf TMR0 ; 156 ( ) counts bcf INTCON,T0IF ; reset overflow flag call DoCode ; Execute main code goto main ; Go back and wait CENG-336 Introduction to Embedded Systems Development 46

47 Operation Timer mode is selected by clearing the T0CS bit (OPTION<5>). In timer mode, the Timer0 module will increment every instruction cycle (without prescaler). If the TMR0 register is written, the increment is inhibited for the following two instruction cycles. The user can work around this by writing an adjusted value to the TMR0 register. CENG-336 Introduction to Embedded Systems Development 47

48 Operation... Counter mode is selected by setting the T0CS bit (OPTION<5>). In counter mode, Timer0 will increment either on every rising or falling edge of the T0CKI pin. The incrementing edge is determined by the Timer0 Source Edge Select the T0SE bit (OPTION<4>). Clearing the T0SE bit selects the rising edge. CENG-336 Introduction to Embedded Systems Development 48

49 TMR0 Interrupt TMR0 interrupt is generated when the TMR0 register overflows from FFh to 00h. This overflow sets bit T0IF (INTCON<2>). Interrupt can be masked by clearing bit T0IE (INTCON<5>). Bit T0IF must be cleared in software by the Timer0 module interrupt service routine before re-enabling enabling this interrupt. TMR0 interrupt cannot awaken the processor from SLEEP since the timer is shut-off during SLEEP. CENG-336 Introduction to Embedded Systems Development 49

50 Timer0 & External Clock When an external clock input is used for TMR0, it must meet certain requirements These requirements ensure the external clock can be synchronized with the internal phase clock (TOSC). Also, there is a delay in the actual incrementing of TMR0 after synchronization. CENG-336 Introduction to Embedded Systems Development 50

51 TMR0 PreScaler An 8-bit 8 counter is available as a pre-scaler for the Timer0 module, or as a post-scaler scaler for the Watchdog Timer. For simplicity, this counter is being referred to as prescaler in the Timer0 description. Thus, a prescaler assignment for the Timer0 module means that there is no postscaler for the Watchdog Timer, and vice-versa. versa. CENG-336 Introduction to Embedded Systems Development 51

52 TMR0/WDT PreScaler... The PSA and PS2:PS0 bits (OPTION<3:0>) determine the prescaler assignment and prescale ratio. When assigned to the Timer0 module, all instructions writing to the TMR0 register (e.g., CLRF TMR0, MOVWF TMR0, BSF TMR0,x...etc.) will clear the prescaler. When assigned to WDT, a CLRWDT instruction will clear the prescaler along with the Watchdog Timer. The prescaler is not readable or writable. CENG-336 Introduction to Embedded Systems Development 52

53 Timer0 Initialization CLRF TMR0 CLRF INTCON BSF STATUS, RP0 MOVLW 0xC3 MOVWF OPTION_REG (Internal Clock Source) BCF STATUS, RP0 ; Bank0 ;** BSF INTCON, T0IE ; Enable TMR0 interrupt ;** BSF INTCON, GIE ; Enable all interrupts ; ; The TMR0 interrupt is disabled, do polling on the overflow bit ; T0_OVFL_WAIT BTFSS INTCON, T0IF GOTO T0_OVFL_WAIT ; Timer has overflowed ; Clear Timer0 register ; Disable interrupts and clear T0IF ; Bank1 ; PortB pull-ups are disabled, ; Interrupt on rising edge of RB0 ; Timer0 increment from internal clock ; with a prescaler of 1:16. CENG-336 Introduction to Embedded Systems Development 53

54 Watchdog Timers Watchdog timers are used to guard a system against lock-up due to software errors or soft failures in hardware. Often included in CPU supervisor circuits. Retriggering usually done in the main program loop. CENG-336 Introduction to Embedded Systems Development 54

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics: M 11 Section 11. HIGHLIGHTS This section of the manual contains the following major topics: 11.1 Introduction...11-2 11.2 Control Register...11-3 11.3 Operation...11-4 11.4 TMR0 Interrupt...11-5 11.5 Using

More information

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch.

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch. Introduction to microprocessors Feisal Mohammed 3rd January 2001 Additional features 1 Input/Output Ports One of the features that differentiates a microcontroller from a microprocessor is the presence

More information

Section 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics:

Section 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics: Section 13. Timer0 HIGHLIGHTS This section of the manual contains the following major topics: 13.1 Introduction... 13-2 13.2 Control Register... 13-3 13.3 Operation... 13-4 13.4 Timer0 Interrupt... 13-5

More information

EE6008-Microcontroller Based System Design Department Of EEE/ DCE

EE6008-Microcontroller Based System Design Department Of EEE/ DCE UNIT- II INTERRUPTS AND TIMERS PART A 1. What are the interrupts available in PIC? (Jan 14) Interrupt Source Enabled by Completion Status External interrupt from INT INTE = 1 INTF = 1 TMR0 interrupt T0IE

More information

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory 0907334 6 Experiment 6:Timers Objectives To become familiar with hardware timing

More information

Hardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed

Hardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 18th February 2002 CLR Part V Hardware Interfacing There are several features of computers/microcontrollers which have not

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 Semester 2 Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J2 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

PIC Discussion By Eng. Tamar Jomaa

PIC Discussion By Eng. Tamar Jomaa PIC Discussion By Eng. Tamar Jomaa 1 Write assembly language instructions to clear the general purpose registers of PIC16F84A microcontroller (don t write the whole program) 2 Islamic university Electrical

More information

Embedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept.

Embedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept. Embedded Systems Design (630470) Lecture 4 Memory Organization Prof. Kasim M. Al-Aubidy Computer Eng. Dept. Memory Organization: PIC16F84 has two separate memory blocks, for data and for program. EEPROM

More information

Section 14. Timer1 HIGHLIGHTS. Timer1. This section of the manual contains the following major topics:

Section 14. Timer1 HIGHLIGHTS. Timer1. This section of the manual contains the following major topics: Section 14. Timer1 HIGHLIGHTS This section of the manual contains the following major topics: 14.1 Introduction... 14-2 14.2 Control Register... 14-4 14.3 Timer1 Operation in Timer Mode... 14-5 14.4 Timer1

More information

Chapter 11: Interrupt On Change

Chapter 11: Interrupt On Change Chapter 11: Interrupt On Change The last two chapters included examples that used the external interrupt on Port C, pin 1 to determine when a button had been pressed. This approach works very well on most

More information

Performance & Applications

Performance & Applications EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 15th March 2002 CLR Part VI Performance & Applications It is possible to predict the execution time of code, on the basis

More information

M PIC16F84A. 18-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller. High Performance RISC CPU Features: Pin Diagrams. Peripheral Features:

M PIC16F84A. 18-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller. High Performance RISC CPU Features: Pin Diagrams. Peripheral Features: M PIC6F84A 8-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller High Performance RISC CPU Features: Pin Diagrams Only 35 single word instructions to learn All instructions single-cycle except for program branches

More information

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!!

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!! THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF APRIL MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: MidTerm Date and Time: Thursday April 14th 2005 8AM Duration:

More information

Embedded System Design

Embedded System Design ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design : Microcontroller 1. Introduction to PIC microcontroller 2. PIC16F84 3. PIC16F877

More information

Using Timers of Microchip PIC18F Microcontrollers

Using Timers of Microchip PIC18F Microcontrollers Using Timers of Microchip PIC18F Microcontrollers ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it L.A.P.

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J1 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

Micro-Controller: PIC16C74 < Part 5: Interrupt >

Micro-Controller: PIC16C74 < Part 5: Interrupt > Micro-Controller: PIC16C74 < Part 5: Interrupt > I. Overview Introduction PIC16c74 can have many sources of interrupt. These sources generally include one interrupt source for each peripheral module, though

More information

PIC16C84. 8-bit CMOS EEPROM Microcontroller PIC16C84. Pin Diagram. High Performance RISC CPU Features: CMOS Technology: Peripheral Features:

PIC16C84. 8-bit CMOS EEPROM Microcontroller PIC16C84. Pin Diagram. High Performance RISC CPU Features: CMOS Technology: Peripheral Features: 8-bit CMOS EEPROM Microcontroller High Performance RISC CPU Features: Only 35 single word instructions to learn All instructions single cycle (400 ns @ 10 MHz) except for program branches which are two-cycle

More information

ME 6405 Introduction to Mechatronics

ME 6405 Introduction to Mechatronics ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Microchip PIC Manufacturer Information: Company: Website: http://www.microchip.com Reasons for success: Became the hobbyist's

More information

Section 16. Basic Sychronous Serial Port (BSSP)

Section 16. Basic Sychronous Serial Port (BSSP) M 16 Section 16. Basic Sychronous Serial Port (BSSP) BSSP HIGHLIGHTS This section of the manual contains the following major topics: 16.1 Introduction...16-2 16.2 Control Registers...16-3 16.3 SPI Mode...16-6

More information

/* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */

/* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */ /* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */ CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _HS_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF ;***** VARIABLE DEFINITIONS COUNT_L EQU 0x01 ;**********************************************************************

More information

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL NH-67, TRICHY MAIN ROAD, PULIYUR, C.F. 639 114, KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL Subject Name : Embedded System Class/Sem : BE (ECE) / VII Subject Code

More information

Microprocessors B (17.384) Spring Lecture Outline

Microprocessors B (17.384) Spring Lecture Outline Microprocessors B (17.384) Spring 2013 Lecture Outline Class # 04 February 12, 2013 Dohn Bowden 1 Today s Lecture Administrative Microcontroller Hardware and/or Interface Programming/Software Lab Homework

More information

Assembly Language Instructions

Assembly Language Instructions Assembly Language Instructions Content: Assembly language instructions of PIC16F887. Programming by assembly language. Prepared By- Mohammed Abdul kader Assistant Professor, EEE, IIUC Assembly Language

More information

The University of Texas at Arlington Lecture 21_Review

The University of Texas at Arlington Lecture 21_Review The University of Texas at Arlington Lecture 21_Review CSE 5442/3442 Agenda Tuesday December 1st Hand back Homework 7,8 and 9. Go over questions and answers Exam 3 Review Note: There will be a take home

More information

These 3 registers contain enable, priority,

These 3 registers contain enable, priority, 8.3.2) Registers Related to Interrupts These registers enable/disable the interrupts, set the priority of the interrupts, and record the status of each interrupt source. RCON INTCON, INTCON2, and INTCON3

More information

PIC Microcontroller Introduction

PIC Microcontroller Introduction PIC Microcontroller Introduction The real name of this microcontroller is PICmicro (Peripheral Interface Controller), but it is better known as PIC. Its first ancestor was designed in 1975 by General Instruments.

More information

8254 is a programmable interval timer. Which is widely used in clock driven digital circuits. with out timer there will not be proper synchronization

8254 is a programmable interval timer. Which is widely used in clock driven digital circuits. with out timer there will not be proper synchronization 8254 is a programmable interval timer. Which is widely used in clock driven digital circuits. with out timer there will not be proper synchronization between two devices. So it is very useful chip. The

More information

PIC 16F84A programming (II)

PIC 16F84A programming (II) Lecture (05) PIC 16F84A programming (II) Dr. Ahmed M. ElShafee ١ Introduction to 16F84 ٣ PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture. Program memory (FLASH) EEPROM RAM PORTA

More information

Lecture (04) PIC16F84A (3)

Lecture (04) PIC16F84A (3) Lecture (04) PIC16F84A (3) By: Dr. Ahmed ElShafee ١ Central Processing Unit Central processing unit (CPU) is the brain of a microcontroller responsible for finding and fetching the right instruction which

More information

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan Interrupts and Resets Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.twcgu Interrupts An event that will cause the CPU to stop the normal program execution

More information

Learning Objectives:

Learning Objectives: Topic 5.2.1 PIC microcontrollers Learning Objectives: At the end of this topic you will be able to; Recall the architecture of a PIC microcontroller, consisting of CPU, clock, data memory, program memory

More information

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Philadelphia University Faculty of Engineering Course Title: Embedded Systems (630414) Instructor: Eng. Anis Nazer Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Student Name: Student

More information

EEE111A/B Microprocessors

EEE111A/B Microprocessors EEE111A/B Microprocessors Revision Notes Lecture 1: What s it all About? Covers the basic principles of digital signals. The intelligence of virtually all communications, control and electronic devices

More information

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features:

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features: M PIC6F84A 8-pin Enhanced Flash/EEPROM 8-Bit Microcontroller Devices Included in this Data Sheet: PIC6F84A Extended voltage range device available (PIC6LF84A) High Performance RISC CPU Features: Only 35

More information

Chapter 2. Overview of Architecture and Microcontroller-Resources

Chapter 2. Overview of Architecture and Microcontroller-Resources Chapter 2 Overview of Architecture and Microcontroller-Resources Lesson 4 Timers, Real Time Clock Interrupts and Watchdog Timer 2 Microcontroller-resources Port P1 Port P0 Port P2 PWM Timers Internal Program

More information

DERTS Design Requirements (1): Microcontroller Architecture & Programming

DERTS Design Requirements (1): Microcontroller Architecture & Programming Lecture (5) DERTS Design Requirements (1): Microcontroller Architecture & Programming Prof. Kasim M. Al-Aubidy Philadelphia University 1 Lecture Outline: Features of microcomputers and microcontrollers.

More information

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester Embedded Systems PIC16F84A Internal Architecture Eng. Anis Nazer First Semester 2017-2018 Review Computer system basic components? CPU? Memory? I/O? buses? Instruction? Program? Instruction set? CISC,

More information

PIC16C432 OTP 8-Bit CMOS MCU with LIN bus Transceiver

PIC16C432 OTP 8-Bit CMOS MCU with LIN bus Transceiver OTP 8-Bit CMOS MCU with LIN bus Transceiver Devices included in this Data Sheet: High Performance RISC CPU: Only 35 instructions to learn All single cycle instructions (200 ns), except for program branches

More information

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester Embedded Systems PIC16F84A Sample Programs Eng. Anis Nazer First Semester 2017-2018 Development cycle (1) Write code (2) Assemble / compile (3) Simulate (4) Download to MCU (5) Test Inputs / Outputs PIC16F84A

More information

Lecture-55 System Interface:

Lecture-55 System Interface: Lecture-55 System Interface: To interface 8253 with 8085A processor, CS signal is to be generated. Whenever CS =0, chip is selected and depending upon A 1 and A 0 one of the internal registers is selected

More information

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers 18-pin Flash/EEPROM 8-Bit Microcontrollers Devices Included in this Data Sheet: PIC16F83 PIC16F84 PIC16CR83 PIC16CR84 Extended voltage range devices available (PIC16LF8X, PIC16LCR8X) High Performance RISC

More information

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Lesson 14 Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Name and affiliation of the author: N W K Jayatissa Department of Physics,

More information

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application...

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application... Overview of the PIC 16F648A Processor: Part 1 EE 361L Lab 2.1 Last update: August 19, 2011 Abstract: This report is the first of a three part series that discusses the features of the PIC 16F684A processor,

More information

PIC16F8X. 8-Bit CMOS Flash/EEPROM Microcontrollers PIC16F8X PIC16CR8X. Pin Diagram. Devices Included in this Data Sheet:

PIC16F8X. 8-Bit CMOS Flash/EEPROM Microcontrollers PIC16F8X PIC16CR8X. Pin Diagram. Devices Included in this Data Sheet: This document was created with FrameMaker 404 PIC16F8X 8-Bit CMOS Flash/EEPROM Microcontrollers Devices Included in this Data Sheet: PIC16F83 PIC16CR83 PIC16F84 PIC16CR84 Extended voltage range devices

More information

Week1. EEE305 Microcontroller Key Points

Week1. EEE305 Microcontroller Key Points Week1 Harvard Architecture Fig. 3.2 Separate Program store and Data (File) stores with separate Data and Address buses. Program store Has a 14-bit Data bus and 13-bit Address bus. Thus up to 2 13 (8K)

More information

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work LAB WORK 1 We are studying with PIC16F84A Microcontroller. We are responsible for writing assembly codes for the microcontroller. For the code, we are using MPLAB IDE software. After opening the software,

More information

Introduction to PIC Programming

Introduction to PIC Programming Introduction to PIC Programming Baseline Architecture and Assembly Language by David Meiklejohn, Gooligum Electronics Lesson 5: Using Timer0 The lessons until now have covered the essentials of baseline

More information

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,

More information

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4 Overview of the PIC 16F648A Processor: Part 1 EE 361L Lab 2.1 Last update: August 1, 2016 Abstract: This report is the first of a three part series that discusses the features of the PIC 16F648A processor,

More information

Section 9. Watchdog Timer (WDT) and Power-Saving Modes

Section 9. Watchdog Timer (WDT) and Power-Saving Modes Section 9. Watchdog Timer (WDT) and Power-Saving Modes HIGHLIGHTS This section of the manual contains the following topics: 9.1 Introduction... 9-2 9.2 Power-Saving Modes... 9-2 9.3 Watchdog Timer (WDT)...

More information

Timers and Counters. LISHA/UFSC Prof. Dr. Antônio Augusto Fröhlich Fauze Valério Polpeta Lucas Francisco Wanner.

Timers and Counters. LISHA/UFSC Prof. Dr. Antônio Augusto Fröhlich Fauze Valério Polpeta Lucas Francisco Wanner. Timers and Counters LISHA/UFSC Prof. Dr. Antônio Augusto Fröhlich Fauze Valério Polpeta Lucas Francisco Wanner http://www.lisha.ufsc.br/~guto March 2009 March 2009 http://www.lisha.ufsc.br/ 103 Timers

More information

To Interface The 8085 Microprocessor

To Interface The 8085 Microprocessor To Interface The 8085 Microprocessor A microprocessor has to be interfaced with various peripherals to perform various functions. Let's discuss about the Interfacing techniques in detail. Introduction

More information

ME 515 Mechatronics. A microprocessor

ME 515 Mechatronics. A microprocessor ME 515 Mechatronics Microcontroller Based Control of Mechanical Systems Asanga Ratnaweera Department of Faculty of Engineering University of Peradeniya Tel: 081239 (3627) Email: asangar@pdn.ac.lk A microprocessor

More information

PIC Discussion By Eng. Tamar Jomaa

PIC Discussion By Eng. Tamar Jomaa PIC Discussion By Eng. Tamar Jomaa Outlines 2.6 TMR0 2.7 EEPROM 2.8 Look up table 2.9 Macro 2.6 TMR0 Example#1 Write an assembly program to make a counter using TMR0, the count should increment it s value

More information

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, CISC and RISC processors etc. Knows the architecture and

More information

Course Introduction. 2009, Renesas Technology America, Inc., All Rights Reserved

Course Introduction. 2009, Renesas Technology America, Inc., All Rights Reserved Course Introduction Purpose This course provides an introduction to the peripheral functions built into R8C Tiny series microcontrollers (MCUs). Objective Learn about the features and operation of the

More information

UNIT - II PERIPHERAL INTERFACING WITH 8085

UNIT - II PERIPHERAL INTERFACING WITH 8085 UNIT - II PERIPHERAL INTERFACING WITH 8085 Peripheral Interfacing is considered to be a main part of Microprocessor, as it is the only way to interact with the external world. The interfacing happens with

More information

Figure 1: Pushbutton without Pull-up.

Figure 1: Pushbutton without Pull-up. Chapter 7: Using the I/O pins as Inputs. In addition to working as outputs and being able to turn the I/O pins on and off, these same pins can be used as inputs. In this mode the PIC is able to determine

More information

Timer2 Interrupts. NDSU Timer2 Interrupts September 20, Background:

Timer2 Interrupts. NDSU Timer2 Interrupts September 20, Background: Background: Timer2 Interrupts The execution time for routines sometimes needs to be set. This chapter loops at several ways to set the sampling rate. Example: Write a routine which increments an 8-bit

More information

Introduction. Embedded system functionality aspects. Processing. Storage. Communication. Transformation of data Implemented using processors

Introduction. Embedded system functionality aspects. Processing. Storage. Communication. Transformation of data Implemented using processors Input/Output 1 Introduction Embedded system functionality aspects Processing Transformation of data Implemented using processors Storage Retention of data Implemented using memory Communication Transfer

More information

Topics. Interfacing chips

Topics. Interfacing chips 8086 Interfacing ICs 2 Topics Interfacing chips Programmable Communication Interface PCI (8251) Programmable Interval Timer (8253) Programmable Peripheral Interfacing - PPI (8255) Programmable DMA controller

More information

Interrupts, timers and counters

Interrupts, timers and counters Interrupts, timers and counters Posted on May 10, 2008, by Ibrahim KAMAL, in Micro-controllers, tagged Most microcontrollers come with a set of ADD-ONs called peripherals, to enhance the functioning of

More information

Introduction to Embedded Systems

Introduction to Embedded Systems Stefan Kowalewski, 4. November 25 Introduction to Embedded Systems Part 2: Microcontrollers. Basics 2. Structure/elements 3. Digital I/O 4. Interrupts 5. Timers/Counters Introduction to Embedded Systems

More information

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction. AVR XMEGA TM Product Introduction 32-bit AVR UC3 AVR Flash Microcontrollers The highest performance AVR in the world 8/16-bit AVR XMEGA Peripheral Performance 8-bit megaavr The world s most successful

More information

Explanation of PIC 16F84A processor data sheet Part 2: More on the PIC

Explanation of PIC 16F84A processor data sheet Part 2: More on the PIC Explanation of PIC 16F84A processor data sheet Part 2: More on the PIC This is the second of the three part overview of the PIC processor. We will first discuss the timer module and prescalar. We will

More information

MPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine

MPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine MPLAB SIM MPLAB IDE Software Simulation Engine 2004 Microchip Technology Incorporated MPLAB SIM Software Simulation Engine Slide 1 Welcome to this web seminar on MPLAB SIM, the software simulator that

More information

These three counters can be programmed for either binary or BCD count.

These three counters can be programmed for either binary or BCD count. S5 KTU 1 PROGRAMMABLE TIMER 8254/8253 The Intel 8253 and 8254 are Programmable Interval Timers (PTIs) designed for microprocessors to perform timing and counting functions using three 16-bit registers.

More information

ECE 354 Introduction to Lab 2. February 23 rd, 2003

ECE 354 Introduction to Lab 2. February 23 rd, 2003 ECE 354 Introduction to Lab 2 February 23 rd, 2003 Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system supervisors

More information

PIC16F8X PIC16F8X. 18-pin Flash/EEPROM 8-Bit Microcontrollers

PIC16F8X PIC16F8X. 18-pin Flash/EEPROM 8-Bit Microcontrollers Devices Included in this Data Sheet: PIC6F83 PIC6F84 PIC6CR83 PIC6CR84 Extended voltage range devices available (PIC6LF8X, PIC6LCR8X) High Performance RISC CPU Features: Only 35 single word instrucs to

More information

Section 28. WDT and SLEEP Mode

Section 28. WDT and SLEEP Mode Section 28. WDT and SLEEP Mode HIGHLIGHTS This section of the manual contains the following major topics: 28 28.1 Introduction... 28-2 28.2 Control Register... 28-3 28.3 Watchdog Timer (WDT) Operation...

More information

Explanation of PIC 16F84A processor data sheet Part 1: overview of the basics

Explanation of PIC 16F84A processor data sheet Part 1: overview of the basics Explanation of PIC 16F84A processor data sheet Part 1: overview of the basics This report is the first of a three part series that discusses the features of the PIC 16F94A processor. The reports will refer

More information

General Purpose Programmable Peripheral Devices. Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

General Purpose Programmable Peripheral Devices. Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar Chapter 15 General Purpose Programmable Peripheral Devices by Rahul Patel, Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar Microprocessor & Interfacing (140701) Rahul Patel 1

More information

PCI bit Digital Input/ Output Card for PCI Bus. User s Manual

PCI bit Digital Input/ Output Card for PCI Bus. User s Manual PCI-1751 48-bit Digital Input/ Output Card for PCI Bus User s Manual Copyright This documentation and the software included with this product are copyrighted 1998 by Advantech Co., Ltd. All rights are

More information

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware:

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware: HCMIU - DEE Subject: ERTS RISC MCU Architecture PIC16F877 Hardware 1 Outline Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware: Program Memory Data memory organization: banks,

More information

MICROPROCESSOR TECHNOLOGY

MICROPROCESSOR TECHNOLOGY MICROPROCESSOR TECHNOLOGY Assis. Prof. Hossam El-Din Moustafa Lecture 14 Ch.6 The 80186, 80188, and 80286 Microprocessors 21-Apr-15 1 Timers The 80186/80188 contain three fully programmable 16-bit timers

More information

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller. UNIT V -8051 MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS 1. What is micro controller? Micro controller is a microprocessor with limited number of RAM, ROM, I/O ports and timer on a single chip

More information

Embedded systems. Exercise session 3. Microcontroller Programming Lab Preparation

Embedded systems. Exercise session 3. Microcontroller Programming Lab Preparation Embedded systems Exercise session 3 Microcontroller Programming Lab Preparation Communications Contact Mail : michael.fonder@ulg.ac.be Office : 1.82a, Montefiore Website for the exercise sessions and the

More information

Introduction to PIC Programming

Introduction to PIC Programming Introduction to PIC Programming Programming Baseline PICs in C by David Meiklejohn, Gooligum Electronics Lesson 3: Using Timer 0 As demonstrated in the previous lessons, C can be a viable choice for programming

More information

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2006 Recitation 01 21.02.2006 CEng336 1 OUTLINE LAB & Recitation Program PIC Architecture Overview PIC Instruction Set PIC Assembly Code Structure 21.02.2006

More information

D:\PICstuff\PartCounter\PartCounter.asm

D:\PICstuff\PartCounter\PartCounter.asm 1 ;********************************************************************** 2 ; This file is a basic code template for assembly code generation * 3 ; on the PICmicro PIC16F84A. This file contains the basic

More information

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller Maxim > App Notes > 1-Wire DEVICES BATTERY MANAGEMENT Keywords: 1-wire, PICmicro, Microchip PIC, 1-Wire communication, PIC microcontroller, PICmicro microcontroller, 1 wire communication, PICs, micros,

More information

Department of EIE / Pondicherry Engineering College. Timer/Counters. Department of EIE / Pondicherry Engineering College 1

Department of EIE / Pondicherry Engineering College. Timer/Counters. Department of EIE / Pondicherry Engineering College 1 Timer/Counters Department of EIE / Pondicherry Engineering College 1 The 8051 has two internal sixteen bit hardware Timer/Counters. Each Timer/Counter can be configured in various modes, typically based

More information

Section 4. Architecture

Section 4. Architecture M Section 4. Architecture HIGHLIGHTS This section of the manual contains the following major topics: 4. Introduction...4-2 4.2 Clocking Scheme/Instruction Cycle...4-5 4.3 Instruction Flow/Pipelining...4-6

More information

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses ECE 354 Computer Systems Lab II Interrupts, Strings, and Busses Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system

More information

PIC10F200/202/204/206 Data Sheet

PIC10F200/202/204/206 Data Sheet Data Sheet 6-Pin, 8-Bit Flash Microcontrollers DS4239A 6-Pin, 8-Bit Flash Microcontrollers Devices Included In ThisData Sheet: PIC0F200 PIC0F202 PIC0F204 PIC0F206 High-Performance RISC CPU: Only 33 single-word

More information

Chapter Operation Pinout Operation 35

Chapter Operation Pinout Operation 35 68000 Operation 35 Chapter 6 68000 Operation 6-1. 68000 Pinout We will do no construction in this chapter; instead, we will take a detailed look at the individual pins of the 68000 and what they do. Fig.

More information

PIC Discussion. By Eng. Tamar Jomaa

PIC Discussion. By Eng. Tamar Jomaa PIC Discussion By Eng. Tamar Jomaa Chapter#2 Programming Microcontroller Using Assembly Language Quiz#1 : Time: 10 minutes Marks: 10 Fill in spaces: 1) PIC is abbreviation for 2) Microcontroller with..architecture

More information

Section 10. Watchdog Timer and Power Saving Modes

Section 10. Watchdog Timer and Power Saving Modes Section 10. Watchdog Timer and Power Saving Modes HIGHLIGHTS This section of the manual contains the following topics: 10.1 Introduction... 10-2 10.2 Power Saving Modes... 10-2 10.3 Sleep Mode...10-2 10.4

More information

INTERFACING INTERFACING. Richa Upadhyay Prabhu. NMIMS s MPSTME February 25, 2016

INTERFACING INTERFACING. Richa Upadhyay Prabhu. NMIMS s MPSTME February 25, 2016 INTERFACING Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu February 25, 2016 8255: Programmable Peripheral Interface or Programmable Input output Device Introduction METHODS OF DATA TRANSFER

More information

Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh

Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh Work Completed: Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh Last week started with the goal to complete writing the overall program for the game.

More information

Registers Format. 4.1 I/O Port Address

Registers Format. 4.1 I/O Port Address 4 Registers Format The detailed descriptions of the register format and structure of the ACL- 8112 are specified in this chapter. This information is quite useful for the programmer who wish to handle

More information

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers 8051 Peripherals On-Chip Memory Timers Serial Port Interrupts Computer Engineering 2 2-1 8051 Timers 8051 Timers The 8051 has 2 internal 16-bit timers named Timer 0 and Timer 1 Each timer is a 16-bit counter

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text In this lecture the detailed architecture of 8051 controller, register bank,

More information

Interrupts on PIC18F252 Part 2

Interrupts on PIC18F252 Part 2 Interrupts on PIC18F252 Part 2 Following pages list Special Function Registers (SFRs) involved in interrupt configuration and operation on PIC18F252 microcontroller. (Copied from Microchip s PIC18Fxx2

More information

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE AVR 8-bit Microcontrollers AVR134: Real Time Clock (RTC) Using the Asynchronous Timer APPLICATION NOTE Features Real Time Clock with Very Low Power Consumption (10µA @ 3.3V) Very Low Cost Solution Adjustable

More information

Microcontroller Overview

Microcontroller Overview Microcontroller Overview Microprocessors/Microcontrollers/DSP Microcontroller components Bus Memory CPU Peripherals Programming Microcontrollers vs. µproc. and DSP Microprocessors High-speed information

More information

DRPIC166X IP Core. High Performance 8-bit RISC Microcontroller v. 2.17

DRPIC166X IP Core. High Performance 8-bit RISC Microcontroller v. 2.17 2017 DRPIC166X IP Core High Performance 8-bit RISC Microcontroller v. 2.17 C O M P A N Y O V E R V I E W Digital Core Design is a leading IP Core provider and a System-on-Chip design house. The company

More information

Micro II and Embedded Systems

Micro II and Embedded Systems 16.480/552 Micro II and Embedded Systems Introduction to PIC Microcontroller Revised based on slides from WPI ECE2801 Moving Towards Embedded Hardware Typical components of a PC: x86 family microprocessor

More information