| 数据搜索系统,热门电子元器件搜索 |
|
MPXM2010D 数据表(PDF) 11 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
MPXM2010D 数据表(HTML) 11 Page - Freescale Semiconductor, Inc |
|
11 / 24 page ![]() AN1950 Sensors Freescale Semiconductor 11 validcal: ldhx #N2 jsr wrflash ;burn N2 into flash ldhx #msg05 ;and display new current cal values from flash jsr lcdstro lda N1 ;0mm value jsr lcdbyto lda #'/' jsr lcdchro lda N2 ;160mm value jsr lcdbyto jsr del1s jsr del1s jmp nocalib ;done! ;__________________________________________________________ ;__________________________________________________________ LEVEL: lda #$01 ;===LEVEL=== main routine: displays level, flow & graphics jsr lcdcmdo ;clear screen lda #$0C jsr lcdcmdo ;cursor off lda #$88 ;position cursor at LCD graphics portion jsr lcdcmdo ;(2nd half of first line) clra ;and write ascii $00 through $07 fillgfx: jsr lcdchro ;which contain the graphics related to inca ;40 different readings cmp #$08 ;do all 8 bne fillgfx LVL: ldhx #ramfree ;point to 40 pressure readings lda #$28 ;count down from 40 purge: clr 0,x ;clear all those locations incx ;next (H cannot change: we are in page0 RAM) dbnza purge jsr adcbyta ;get averaged A/D reading (i.e. NX) jsr LfNx ;convert to level and sta Lgfx ;store in "Level graphics" LVLwarm: bset 4,porta bset 5,porta ;LEDs on during this cycle ldhx #ramfree ;point to 40 pressure readings mov #$27,RA ;count down from 39 shiftgfx: lda 1,x ;take location+1 sta 0,x ;and move to location+0, i.e. shift graphics left incx ;next X (once again: we are in page 0, no need to worry about H) dbnz RA,shiftgfx ;do this 39x jsr adcbyta ;get averaged A/D reading (i.e. NX) jsr LfNx ;LX:=(NX-N1)*ConversionValue/(N2-N1) mov RA,OA ;store result in OA clr RB ;RB will contain graphic pixels (default=$00) cmp UnitEmpt ;if <UnitEmpty (preset value = empty or almost) bcs Lzero ;then "empty" (no pixels) cmp UnitFull ;if >=UnitFull (preset value = full or almost) bcc Lsat ;then "full" (pixel $80=bit 7) clrh ;otherwise determine one of 8 graphic values ldx UnitDiv ;UnitDiv is roughly full range/8 div ;in order to give 8 values mov #$01,RB ;but now value has to be converted to pixel |
|
|
链接网址 |
| 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 |