| поискавой системы для электроныых деталей |
|
MPXM2010D датащи(PDF) 20 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
MPXM2010D датащи(HTML) 20 Page - Freescale Semiconductor, Inc |
|
20 / 24 page ![]() AN1950 Sensors 20 Freescale Semiconductor ; delmain: main delay routine; generates delay equal to H:X x 20us ; ------- delmain: mov #$36,tsc ;stop TIM & / 64 sthx tmodh ;count H:X x 20us bclr 5,tsc ;start clock delwait: brclr 7,tsc,delwait ;wait for end of countdown pulx pulh rts ;this RTS serves for all delay routines! ;-------- A/D Routines ---------------------------------------------- ; adcbyti: gets single A/D reading from PTA0 and returns it in A ; ------- adcbyti: mov #$00,adscr ;ADC set to PTA0 brclr 7,adscr,* ;wait for ADC reading lda adr ;result in adr rts ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; adcbyta: gets averaged A/D reading from PTA0 and returns it in A ; ------- adcbyta: clr CNT ;average 256 readings clr RB ;will be addint them up clr RA ;in RB:RA do256a: bsr adcbyti add RA sta RA lda RB adc #$00 sta RB ;16-bit add into RB:RA dbnz CNT,do256a ;do all 256 lsl RA ;if RA<$80 bcc nochga ;then RB result is correctly rounded inc RB ;otherwise round off to next value nochga: lda RB rts ;-------- LCD Routines ---------------------------------------------- ; lcdinit: initializes LCD ; ------- lcdinit: lda #$3C ;set 8-bit interface, 1/16 duty, 5x10 dots bsr lcdcmdo lda #$0C ;display on, cursor off, blink off bsr lcdcmdo lda #$06 ;increment cursor position, no display shift bsr lcdcmdo lda #$01 ;clear display bsr lcdcmdo rts ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; lcdcmdo: sends a command to LCD ; ------- lcdcmdo: bsr shiftA bclr 4,porta ;RS=0 for command bset 3,porta bclr 3,porta ;toggle E bsr del5ms ;some commands require 2ms for LCD to execute rts ;so let's play it safe ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; lcdchro: sends a character (data) to LCD ; ------- lcdchro: bsr shiftA bset 4,porta ;RS=1 for data |
|
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |