4-16.1 SLEEP1 HT66F50.

Slides:



Advertisements
Similar presentations
Autumn 2012C.-S. Shieh, EC, KUAS, Taiwan1 The 8051 Family Microcontroller Chin-Shiuh Shieh Department of Electronic Engineering.
Advertisements

Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
kashanu.ac.ir Microprocessors 6-1 I/O Devices Switches, LED, LCD Lec note 6.
1 4.3 單顆七段. 2 共陰極七段顯示器 C ommon Cathod (abcdefg) 七段接腳 gf(com)ab ed(com)cp HT46R23 接腳 VDD(20) RES(19) OSC1(21) OSC2(22) VSS(11) PA0-PA7(6,5,4,3,26,25,24,23)
1 4.4 指撥開關與單顆七段 當 DIP 為 ON 輸入接腳為 LOW 當 DIP 為 OFF 輸入接腳為 HIGH.
Introduction of Holtek HT-46 series MCU
68HC11 Polling and Interrupts
Mark Neil - Microprocessor Course 1 Timers and Interrupts.
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
1 Timer 位元上數計數器 Up Counter 以 TMRC 暫存器設定 TMRC (TM1 TM0 – TON TE PSC2 PSC1 PSC0) 三種工作模式 (TM1 TM0 控制 ) 溢位時 TF(INT0.5) 位元設為 1.
1 Speaker. 2 喇叭發聲原理 利用喇叭上的線圈通上電流造成薄膜振動 振動推動空氣產生聲音.
1 Timer with PFD. 2 PFD 可程式除頻器 PAC.3=1 則 PA.3 被規劃為輸入模式 PAC.3=0 則 PA.3 被規劃為輸出模式 PA.3=1 即開始輸出 PFD 信號 產生的頻率為計時計數器溢位頻率之半 PA.3=0 即停止輸出 PFD 信號.
1 4.2 LED 查表. 2 HT46R23 程式記憶體 4096 個位址 (0000-FFFFh) 256 個位置為單一程式頁 TBLP 暫存器只有 8 個位元 TABRDC [m] 指令 依據 TBLP 所示位址將目前程 式頁之內容讀出 將低 8 位元存入資料記憶體 [m] 中 其餘位元存入.
ADC. 2 ADC 數位類比轉換器 解析度 10 bit 準確度 9 bit 類比輸入 PB 轉換結果 D9-D0 存放在 ADRH,ADRL.
Lab 6 :Digital Display Decoder: 7 Segment LED display Slide #2 Slide #3 Slide #4 Slide #5 Slide #6 Slide #7 Display Decoder Fundamentals LT Control Input.
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.
Block Diagram of 4518 Dual BCD Counter The 4518 Dual BCD Counter has two BCD counters. Each counter is similar to the other. Each counter has a master.
Dr. Hoganson CSIS Segment Display and Count by 16 This is our third lab using the 68HC11 microcontroller. We will write a program that counts by.
1 Chapter 4 Timer Operation (I. Scott MacKenzie).
1LAKSHMI.B.E.. Full step -clock 2LAKSHMI.B.E. Full step –anti clock 3LAKSHMI.B.E.
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
Introduction to Holtek ASM Programming
1 GCC Inline Assembly (asm) Example 1 : assignment System oriented Programming, B. Hirsbrunner, diuf.unifr.ch/pai/spSession 14 – 26 May 2015 Ref: B. Hirsbrunner:
The 8051 Assembly Language Branching & Subroutines
8279 KEYBOARD AND DISPLAY INTERFACING
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
4-12 外部中斷 HT66F50.
Projects 8051.
1 68HC11 Timer HC11 or HC12: Chapter HC11 Timer Subsystem  Several timing functions: Basic timing Basic timing Real time interrupts Real time.
8279 KEYBOARD AND DISPLAY INTERFACING
ECE Lecture 1 1 L15 –I/O Part II Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
1 4-8 IO_speaker 利用 HT66F50 中 PC4 腳位輸出特 性 控制 speaker 發聲.
HALT HT66F50. HALT 指令 進入省電模式 1. 關閉系統時脈, 若啟用 WDT 將繼續 WDT 時脈 (LXT, LIRC) 2. 內部資料 RAM 不變 3. 清除 WDT, 並重新開始計數 4. 所有 I/O 維持原來狀態 ( 若要省電周邊元件要關閉 ) 5. 清除.
x4 鍵盤 每按一次鍵盤 控制七段顯示器. 2 ;PROGRAM : 4-7.ASM (4-7.PRJ) 2002.DEC.30. ;FUNCTION: 4X4 MATRIX KEYPAD DEMO PROGRAM BY STEVEN #INCLUDEHT46R23.INC.CHIPHT46R23.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
kashanu.ac.ir Microprocessors Interrupts Lec note 8.
CS-280 Dr. Mark L. Hornick 1 Sequential Execution Normally, CPU sequentially executes instructions in a program Subroutine calls are synchronous to the.
I/O Devices Switches, LED, LCD
KEYBOARD/DISPLAY CONTROLLER - INTEL Features of 8279 The important features of 8279 are, Simultaneous keyboard and display operations. Scanned keyboard.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Microprocessors A practical approach..
Application Case Study Christmas Lights Controller
80C51 Block Diagram ECE Overview.
Format of Assembly language
TI ARM I/O Programming Chapter 2
LCD and Keyboard Interfacing
COMP2121: Microprocessors and Interfacing
Arduino.
Keyboard/Display Controller INTEL 8279
UNIT 5 TIMRERS/COUNTERS
ATmega103 Timer0 and Interrupts
STM Arm I/O Programming
LCD and Keyboard Interfacing
8051 Single Board Computer (SBC) Version 1.0
LCD and Keyboard Interfacing
Timer.
I/O Ports in AVR Sepehr Naimi
Source: Motor Source:
Microprocessor Lab CSL1543 0:0:2
Programmable Peripheral Interface
LCD and Keyboard Interfacing
Table Construction.
I/O Ports in AVR Sepehr Naimi
4-14 類比中斷 HT66F50.
Interrupt.
8051 Micro Controller.
LCD and Keyboard Interfacing
Switching Theory and Logic Design Chapter 5:
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
By Nasser Halasa Assembly Language.
Presentation transcript:

4-16.1 SLEEP1 HT66F50

4-16.1 SLEEP1 ;PROGRAM:4-161.ASM (4-15.PJT) 2009.1102 ;FUNCTION:HALT DEMO PROGRAM By Steven ; NOTE :SLEEP 1 MODE ; PB0: RESET PIN, USE IC RESET PIN AS RESB #INCLUDE HT66F50.INC ;========================================================= MY_DATA .SECTION 'DATA‘ ;==DATA SECTION== DEL1 DB ? ;DELAY LOOP COUNT1 DEL2 DB ? ;DELAY LOOP COUNT2 DEL3 DB ? ;DELAY LOOP COUNT3 COUNT DB ? SLP_COUNT DB ? ;============================================================ MY_CODE .SECTION AT 0 'CODE’ ;==PROGRAM SECTION== ORG 00H ;HT66FX0 RESET VECTOR JMP INIT ORG 04H ;EXT0. INTERRUPT JMP ISR_EXTINT0

INIT: CLR ACERL ;Digital I/O Pin is assigned as a I/O MOV A,00001000B MOV CP0C,A ;Disable Comparator 0 Function MOV CP1C,A ;Disable Comparator 1 Function CLR SEG_PORTC ;CONFIG LED_PORT AS OUTPUT SET PB_PORTC ;PB port as input SET PB_PULL ;PB as pull up SET PB_WAKE ;Enable PB port wake up SET PAC.3 ;EXT0 as input SET PAPU.3 ;EXT0 pull up MOV A,00000010B MOV INTEG,A CLR IDLEN ;IDLEN=0,執行HALT,進入SLEEP MOV A,01110101B MOV WDTC,A ;enable WDT, 32768/fs SET EMI

SNZ PDF ;RESET from DOWN JMP MAIN ;NO SZ TO ;yes, WDT time out CALL WDT_WAKEUP ;yes CLR WDT ;no, CLEAR PDF/TO JMP LOOP ;display last digit MAIN: MOV A, OFFSET TAB_7_SEG MOV TBLP,A MOV A,10 MOV COUNT,A LOOP: TABRDL SEG_PORT MOV A, 50 ;50*01=5 sec MOV SLP_COUNT,A ;initial sleep count

WAIT_KEY: MOV A,10 ;delay 0. 1 sec CALL DELAY SNZ PB_PORT ;key pressed WAIT_KEY: MOV A,10 ;delay 0.1 sec CALL DELAY SNZ PB_PORT ;key pressed? JMP LOOP_1 ;yes, jmp to loop_1 SDZ SLP_COUNT ;SLP_COUNT over?(25*0.4=10sec) JMP WAIT_KEY ;NO CLR SEG_PORT CLR INT0F ;disable EXT0 INT SET INT0E ;enable external int 0 HALT ;GO SLEEP CLR INT0E ;disable external int 0

LOOP_1: INC TBLP SDZ COUNT JMP LOOP JMP MAIN ;RESTART WDT_WAKEUP: ; 控制七段閃爍5次 MOV A,10 MOV SLP_COUNT, A MOV A,25 CALL DELAY CPL SEG_PORT SDZ SLP_COUNT JMP $-4 RET

ISR_EXTINT0: SET SEG_PORT.0 ;turn SEG_PORT.0 LED ON SHIFT: MOV A,40 CALL DELAY RL SEG_PORT SNZ SEG_PORT.6 ; SEG_PORT.6=1? JMP SHIFT ;NO SHIFT again CLR INT0F ;avoid bouncing RETI ;yes return

DELAY PROC MOV DEL1,A ;SET DELAY FACTOR DEL_1: MOV A,30 MOV DEL2,A ;SET DEL2 COUNTER DEL_2: MOV A,110 MOV DEL3,A ;SET DEL3 COUNTER DEL_3: SDZ DEL3 ;DEL3 DOWN COUNT JMP DEL_3 SDZ DEL2 ;DEL2 DOWN COUNT JMP DEL_2 SDZ DEL1 ;DEL1 DOWN COUNT JMP DEL_1 CLR WDT ;MASK THIS LINE TO SEE DIFFERENCE RET DELAY ENDP ORG LASTPAGE TAB_7_SEG: DC 03Fh,006h,05Bh,04Fh,066h ;7 SEG CODE FOR COMMOM CATHOD LED DC 06Dh,07Dh,007h,07Fh,067h ;CONNECT BIT 0-7 FOR SEGMENT A-H END