ECE/CS-352: Embedded Microcontroller Systems The Silicon Laboratories C8051F020 Enhanced 8051 Part 4 Timer3, Temperature Sensor, AD0WINT.

Slides:



Advertisements
Similar presentations
ECE/CS-352: Embedded Microcontroller Systems The Silicon Laboratories C8051F020 Enhanced 8051 Part 5 Other Subsystems.
Advertisements

The 8051 Microcontroller and Embedded Systems
Chung-Ta King National Tsing Hua University
Analog/Digital Subsystem
Lecture 12 Analog to Digital Converters. 2  What is an ADC?  Output vs. input  Input range  Single-ended vs. differential inputs  Output coding:
Introduction of Holtek HT-46 series MCU
1 Analog-to-Digital Converter (ADC). 2 ADC Features (1/3) ADC conversion rate 1 MHz and 12-bit resolution – 1µs conversion time at 56 MHz – 1.17µs conversion.
Interfacing ADC to 8051.
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
Embedded Systems UNIT 3. Pin Details of 8051 Pins 1-8: Port 1 Each of these pins can be configured as an input or an output. Pin 9: The positive voltage.
1.  8051 Timers “count up,” incrementing the Timer’s respective “count register” each time there is a triggering clock pulse. 2  When the “count register”
External & internal Interrupts. Interrupt Sources There are 21 different interrupts and each one has its own vector located in a predefined location at.
Lecture 9 Timer Operations and Programming. 2  Introduction  Summary of timers  Timer programming sequence  Summary of timer SFRs  Timer 0: 8-bit.
ECE/CS-352: Embedded Microcontroller Systems Embedded Microcontroller Systems.
CHAPTER TIMER PROGRAMMING Timers The 8051 has two timers/counters, they can be used as ◦ Timers to generate a time delay ◦ Event counters.
8051 timer/counter.
1 Chapter 4 Timer Operation (I. Scott MacKenzie).
Chapter 4 TIMER OPERATION
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
Lecture Set 9 MCS-51 Serial Port.
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
ELE2MIC Lecture 21 The AVR Sleep Modes ATMEGA128’s Analog to Digital Converter –Features –Block Diagram –Clock Source –Input Sources –Interrupts –BandGap.
RS232 #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7
Microchip PIC Networks Amrit Bandy, Ben Funk Neil Goldsman.
Serial Communication Lec note 9.
SIGMA-DELTA ADC SD16_A Sigma-Delta ADC Shruthi Sujendra.
Interrupt.
Timers /Counters Programming  The 8051 has 2 timers/counters: ○ timer/counter 0 ○ timer/counter 1 They can be used as 1. The timer is used as a time.
1. Registers Used in Timer/Counter  TH0, TL0, TH1, TL1  TMOD (Timer mode register)  TCON (Timer control register) 2.
The 8051 Assembly Language Branching & Subroutines
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.
Renesas Electronics Corporation © 2010 Renesas Electronics America Inc. All rights reserved. RX 12 Bit Analog-to-Digital Converter A Rev /1/10.
8051 Timer/Counter Lec note 7.
8051 Micro controller. Architecture of 8051 Features of 8051.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
The Silicon Laboratories C8051F020
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
The Silicon Laboratories C8051F020
Lab 3: ADC.
Analog to Digital Converter (ADC)
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
Lecture 3 CSE 341 – Microprocessors Lecture 3 Md. Omar Faruqe UB 1228
kashanu.ac.ir Microprocessors Interrupts Lec note 8.
Timer Programming in Assembly and C Prepared By:
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 AD converter.
FOR MORE CLASSES VISIT   ECET 340 Week 1 HomeWork 1  ECET 340 Week 1 iLab 1  ECET 340 Week 2 HomeWork 2  ECET 340 Week 2 iLab.
Automatic Room Lightening By: Piyush Garg- UE94048 Prince Dhadwal- UE94053 Sahil Arora- UE94062 Sonam Rigzin-UE940.
Serial I/O Port.
Embedded Microcontroller Systems
Application Case Study Security Camera Controller
Embedded Microcontroller Systems
8051 Timers Timers are the peripherals of the 8051 Microcontroller.
Prof. Chung-Ta King Department of Computer Science
Timer Source: under
Interrupt Source: under
Introduction to Micro Controllers & Embedded System Design Interrupt
EMT 348: Microcontroller Timer/counter
Introduction to Micro Controllers & Embedded System Design Timer Operation Department of Electrical & Computer Engineering Missouri University of Science.
8051 Single Board Computer (SBC) Version 1.0
Timer.
8051 Timers / Counters It has two timers Timer 0 and Timer 1.
PIC18F458 Analog-to-Digital
Timer Source: under
Interrupt.
MSP432™ MCUs Training Part 6: Analog Peripherals
Interrupt Source: under
CSCI1600: Embedded and Real Time Software
Timer Source: under
Presentation transcript:

ECE/CS-352: Embedded Microcontroller Systems The Silicon Laboratories C8051F020 Enhanced 8051 Part 4 Timer3, Temperature Sensor, AD0WINT

ECE/CS-352: Embedded Microcontroller Systems The “Other” Timers Timer 3 Timer 3 – auto-reload feature – more clock sources

ECE/CS-352: Embedded Microcontroller Systems Timer 3 Clock sources: –External oscillator  8 (allows for real-time clock input for timed applications) –Sysclk or Sysclk  12 (like all other timers) Always 16-bit, auto-reload. –Write “reload” value to TMR3RLH : TMR3RLL –Defines the time between overflows Can be used to start ADC conversion Can be used for SMBbus timing

ECE/CS-352: Embedded Microcontroller Systems Auto-reload Example Suppose we want to sample the ADC every 1ms. How many counts for 1ms with: –The internal oscillator (2 MHz)?

ECE/CS-352: Embedded Microcontroller Systems Two More Useful Analog Subsystems Analog Programmable Window Detector Temperature Sensor

ECE/CS-352: Embedded Microcontroller Systems ADC0 Programmable Window Limit Registers ADC0GTH | ADC0GTL ADC0LTH | ADC0LTL ADC0GTH | ADC0GTL ADC0LTH | ADC0LTL AD0WInt = 1

ECE/CS-352: Embedded Microcontroller Systems Programmable Window Detector EXAMPLE

ECE/CS-352: Embedded Microcontroller Systems ADC0CN AD0WINT: ADC0 Window Compare Interrupt Flag This flag must be cleared by software. 0: ADC0 Window Comparison Data match has not occurred since this flag was last cleared. 1: ADC0 Window Comparison Data match has occurred.

ECE/CS-352: Embedded Microcontroller Systems Example – Detect Darkness Using light sensor setup, with “dark” corresponding to.25 * VREF, turn the LED on When it becomes light enough, corresponding to 0.5*VREF, turn the LED off What are the values in the GT and LT registers? How is the interrupt enabled? ADC0GTH: ADC0GTL ADC0LTH: ADC0lTL AD0WInt = 1

ECE/CS-352: Embedded Microcontroller Systems Example – Detect Darkness

ECE/CS-352: Embedded Microcontroller Systems Example – Detect Darkness cseg at 043h; set the interrupt vector ljmp adw_int …. adw_int: clr AD0WINT ; Clear interrupt flag (ADC0CN is bit addressable) mov a, ADC0H; check MSB of ADC to see which condition it is clr C subb a, #04; Is it less than 04? jnc off_light; if not, must be time to turn light off setb LED; if so, turn on light and return sjmp over off_light: clr LED over: reti

ECE/CS-352: Embedded Microcontroller Systems Temperature Sensor Selected with the AMX0SL register Otherwise treated the same as other ADC inputs Using above equation, and ADC0 settings and conversion equation, we can convert temperature to digital value.