1 4.3 單顆七段. 2 共陰極七段顯示器 C ommon Cathod 00111111(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)

Slides:



Advertisements
Similar presentations
The 8051 Microcontroller and Embedded Systems
Advertisements

Autumn 2012C.-S. Shieh, EC, KUAS, Taiwan1 The 8051 Family Microcontroller Chin-Shiuh Shieh Department of Electronic Engineering.
Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
7-Segment Displays Lecture L6.1 Section 6.3. Turning on an LED.
A Design Example An Exact Calculator. Exact Calculator Manipulating Large Integer Values Operations: – +, -, *, /, %, And, Or, Xor, Not, Power Functions.
Seven Segment Display. What's A 7-Segment Display? A 7-segment display is a package with 7 bar-shaped LEDs arranged to allow the display of many useful.
Chapter Addressing Modes
S04: MSP430 Microarchitecture
1 4.4 指撥開關與單顆七段 當 DIP 為 ON 輸入接腳為 LOW 當 DIP 為 OFF 輸入接腳為 HIGH.
ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
Introduction of Holtek HT-46 series MCU
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.
Flip-Flops Module M10.2 Section 7.1. D Latch Q !Q CLK D !S !R S R X 0 Q 0 !Q 0 D CLK Q !Q Note that Q follows D when the clock in high, and.
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 信號.
7-Segment Displays Module M7.2 Section 6.5. Turning on an LED Common Anode.
1 4.2 LED 查表. 2 HT46R23 程式記憶體 4096 個位址 (0000-FFFFh) 256 個位置為單一程式頁 TBLP 暫存器只有 8 個位元 TABRDC [m] 指令 依據 TBLP 所示位址將目前程 式頁之內容讀出 將低 8 位元存入資料記憶體 [m] 中 其餘位元存入.
8051 ASSEMBLY LANGUAGE PROGRAMMING
Timer/Event. 2 利用 Timer/Event Counter 之中斷 及 PFD 控制喇叭 4.9 之 Timer 以 Poling 詢問方式檢查 TF 旗標 是否溢位.
8.4 Instruction Execution Times TOBIN PROC FAR SUB AX,AX MOV DX,AX MOV CX,4 NEXTD: PUSH CX SUB BP,BP MOV CX,4 GETNUM: RCL BX,1 RCL BP,1 LOOP GETNUM.
ADC. 2 ADC 數位類比轉換器 解析度 10 bit 準確度 9 bit 類比輸入 PB 轉換結果 D9-D0 存放在 ADRH,ADRL.
Assembler When a source program is a assembly language and the target program is a numerical machine language then the translator is called as a assembler.
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).
NATIONAL TAIWAN OCEAN UNIVERSITY 國立台灣海洋大學 2002/4/8 Microcomputers and Microprocessors Chapter 5 Addressing Modes.
1LAKSHMI.B.E.. Full step -clock 2LAKSHMI.B.E. Full step –anti clock 3LAKSHMI.B.E.
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
ELEC4601 Microprocessor systems Lab 3 Tutorial
Input/Output Interface Circuits and LSI Peripheral Devices
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
Introduction to Holtek ASM Programming
The 8051 Assembly Language Branching & Subroutines
Lecture 14 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
8086/8088 Hardware System. Typical Microprocessor Memory System CPU Memory Control Address Data.
Reaction Timer Project
4-12 外部中斷 HT66F50.
ELE22MIC Lecture 8 ASll Examples –16 Bit Counters –Buffalo Jump Table Interrupt processing (IRQ/RTI) Stack Frame & Base Pointer Wired OR.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
Lecture Set 4 Programming the 8051.
Projects 8051.
In Class Program Write, assemble and test a program: –Use the DB directive to define the following list of numbers and name it array: 31h, 32h, 33h, 34h.
1 4-8 IO_speaker 利用 HT66F50 中 PC4 腳位輸出特 性 控制 speaker 發聲.
Review Yuanqing Cheng. Outline Part I: Introduction of X86 based computing system Part II: Assembly programing Part III: Interfacing circuit design.
ECE291 Computer Engineering II Lecture 16 Josh Potts University of Illinois at Urbana- Champaign.
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.
Department of Electronic & Electrical Engineering Lecture 4. ➢ Loops ➢ Delays ➢ Conditional instructions ➢ Simple clock example.
Tutorial 9 Module 8 – 8.1,8.2,8.3. Question 1 Distinguish between vectored and non-vectored interrupts with an example Build a hardware circuit that can.
ASSEMBLY CODE EEE 365 [FALL 2014] LECTURE 24 ATANU K SAHA BRAC UNIVERSITY.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
Assembly language programming
Format of Assembly language
Calculator in assembly language
Data Processing Instructions
LHO 15 C with assembly language
Source: Motor Source:
8086 Registers Module M14.2 Sections 9.2, 10.1.
Introduction to Micro Controllers & Embedded System Design Addressing Mode Department of Electrical & Computer Engineering Missouri University of Science.
Microprocessor Lab CSL1543 0:0:2
Subroutines and the Stack
Tim Sumner, Imperial College, Rm: 1009, x47552
Table Construction.
4-14 類比中斷 HT66F50.
Computer Architecture and Assembly Language
SLEEP1 HT66F50.
By Nasser Halasa Assembly Language.
Addressing Modes in 8051 MC S. Lourduraj Asst. Prof. of Physics
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Location Counter (LC) = 0 while line of code <> END if ORG
Presentation transcript:

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)

3 #INCLUDE HT46R23.INC.CHIP HT46R23 MY_DATA.SECTION ‘DATA’ DEL1 DB ? ;DELAY1 DEL2 DB ? ;DELAY2 DEL3 DB ? ;DELAY3 COUNT DB ? SEG_PORT EQU PA ;PORT A is OUTPUT SEG_PORTC EQU PAC ;CONTROL REGISTER MY_CODE.SECTION AT 0 ‘CODE’ ;PROGRAM SECTION ORG 00H ;RESET VECTOR CLR SEG_PORTC ;PA is OUTPUT MAIN: MOV A,OFFSET TAB_7_SEG MOV TBLP,A ;INITIAL POINTER ATART ADDRESS

4 MOV A,10 MOV COUNT,A ;SET DATA COUNT OF TAB_7_SEG(0-9) LOOP: TABRDL SEG_PORT ;TBLP POINT TO LASTPAGE ;DATA TO SEG_PORT ;TBLH TIME CONSTANT MOV A,TBLH MOV DEL1,A ;DELAY FACTOR CALL DELAY ;DELAY TBLH*10mS INCTBLP;UPDATE TABLE POINTER SDZCOUNT;COUNT DOWN BY 1 JMPLOOP ;JUMP IF NOT TABLE END JMPMAIN;RESTART

5 DELAY PROC 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 DELAY RET DELAYENDP ORGLASTPAGE TAB_7_SEG: DC SHL 8;7 SEG CODE FOR COMMOM CATHOD LED DC SHL 8 ;CONNECT BIT 0~7 FOR SEGMENT A~H DC SHL 8 ;LOW-BYTE FOR 7 SEG DISPLAY CODE DC SHL 8 ;HIGH 7 BITs FOR DELAY FACTOR DC SHL 8 DC SHL 8 DC SHL 8 DC SHL 8 DC SHL 8 DC SHL 8 END

6 SHL SHL (TBLP 顯示 0 至 9) = (after SHL Bit 14-8 放置 TBLH 作為 DELAY)