| 数据搜索系统,热门电子元器件搜索 |
|
MPXM2202GS 数据表(PDF) 118 Page - Motorola, Inc |
|
|
|||||||||||||||||||||||||||||
MPXM2202GS 数据表(HTML) 118 Page - Motorola, Inc |
|
118 / 670 page ![]() AN1612 2–82 Motorola Sensor Device Data www.motorola.com/semiconductors SOFTWARE SOURCE/ASSEMBLY PROGRAM CODE ****************************************************************************** * * * Pager Shock & Mute Detection Version 1.0 * * * * The following code is written for MC68HC705B16 using MMDS05 software * * Version 1.01 * * CASM05 – Command line assembler Version 3.04 * * P & E Microcomputer Systems, Inc. * * * * Written by : C.S. Chua * * 9th January 1997 * * * * Software Description * * * * J1 ON – Sound mode * * Buzzer will turn off if the accelerometer is tapped or switch S2 is * * depressed. * * * * J1 OFF – Silence mode * * LED will turn off if and only if S2 is depressed * * * ****************************************************************************** ****************************************** * * * I/O Declaration * * * ****************************************** PORTB EQU $01 ; Port B PLMA EQU $0A ; D/A to control buzzer TCONTROL EQU $12 ; Timer control register TSTATUS EQU $13 ; Timer Status Register OCMPHI1 EQU $16 ; Output Compare Register 1 High Byte OCMPLO1 EQU $17 ; Output Compare Register 1 Low Byte TCNTHI EQU $18 ; Timer Count Register High Byte TCNTLO EQU $19 ; Timer Count Register Low Byte OCMPHI2 EQU $1E ; Output Compare Register 2 High Byte OCMPLO2 EQU $1F ; Output Compare Register 2 Low Byte ****************************************** * * * RAM Area ($0050 – $0100) * * * ****************************************** ORG $50 STACK RMB 4 ; Stack segment TEMPTCNTLO RMB 1 ; Temp. storage of timer result (LSB) TEMPTCNTHI RMB 1 ; Temp. storage of timer result (MSB) ****************************************** * * * ROM Area ($0300 – $3DFD) * * * ****************************************** ORG $300 ****************************************** * * * Program starts here upon hard reset * * * ****************************************** RESET CLR PORTB ; Initialise Ports LDA #%01001000 ; Configure Port B STA $05 LDA TSTATUS ; Dummy read the timer status register so as to clear the OCF CLR OCMPHI2 CLR OCMPHI1 LDA OCMPLO2 JSR COMPRGT LDA #$40 ; Enable the output compare interrupt STA TCONTROL LDA #10 ; Idle for a while before ”beeping” IDLE JSR DLY20 DECA BNE IDLE CLI ; Interrupt begins here BRSET 1,PORTB,SILENCE ; Branch if J1 is off BSET 6,PORTB ; Turn on accelerometer JSR DLY20 ; Wait till the supply is stable TEST BRSET 5,PORTB,MUTE ; Sample shock sensor for tapping BRCLR 7,PORTB,MUTE ; Sample switch S2 for muting JMP TEST MUTE BCLR 6,PORTB ; Turn off accelerometer SEI CLR PLMA ; Turn off buzzer Freescale Semiconductor, Inc. For More Information On This Product, Go to: www.freescale.com |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |