| поискавой системы для электроныых деталей |
|
MPXM2102AS датащи(PDF) 440 Page - Motorola, Inc |
|
|
|||||||||||||||||||||||||||||
MPXM2102AS датащи(HTML) 440 Page - Motorola, Inc |
|
440 / 670 page ![]() AN1326 3–294 Motorola Sensor Device Data www.motorola.com/semiconductors ORG $C000 * DESIGNATES START OF MEMORY MAP FOR USER CODE LDX #REGBASE * Location of base register for indirect adr BSR SPI_CNFG * Set–up SPI Module for data X–mit to LCD BSR SET_UP * Power–Up A/D, initialize constants CONVERT BSR ADCONV * Calls subroutine to make an A/D conversion BSR DELAY * Delay routine to prevent LCD flickering BSR IN_HG * Converts hex format to in of Hg * The value of FLAG passed from IN_HG is used to determine * If a range error has occurred. The following logical * statements are used to either allow further conversion or jump * to a routine to display a range error message. LDAB FLAG * Determines if an range Error has ocurred CMPB #$80 * If No Error detected (FLAG=$80) then BEQ INRANGE * system will continue conversion process BSR ERROR * If error occurs (FLAG<>80), branch to ERROR BRA OUTPUT * Branches to output ERROR code to display * No Error Detected, Conversion Process Continues INRANGE JSR BCDCONV * Converts Hex Result to BCD JSR LOOKUP * Uses Look–Up Table for BCD–Decimal OUTPUT JSR SPI2LCD * Output transmission to LCD BRA CONVERT * Continually converts using Branch Always * Subroutine SPI_CNFG * Purpose is to initialize SPI for transmission * and clear the display before conversion. SPI_CNFG BSET PORTD,X #$20 * Set SPI SS Line High to prevent glitch LDAA #$38 * Initializing Data Direction for Port D STAA DDRD,X * Selecting SS, MOSI, SCK as outputs only LDAA #$5D * Initialize SPI–Control Register STAA SPCR,X * selecting SPE,MSTR,CPOL,CPHA,CPRO LDAA #$5 * sets counter to X–mit 5 blank bytes STAA COUNTER LDAA SPSR,X * Must read SPSR to clear SPIF Flag CLRA * Transmission of Blank Bytes to LCD ERASELCD JSR TRANSFER * Calls subroutine to transmit DEC COUNTER BNE ERASELCD RTS * Subroutine SET_UP * Purpose is to initialize constants and to power–up A/D * and to initialize POFFSET used in conversion purposes. SET_UP LDAA #$90 * selects ADPU bit in OPTION register STAA ADOPT,X * Power–Up of A/D complete LDD #$0131+$001A * Initialize POFFSET STD POFFSET * POFFSET = 305 – 25 in hex LDAA #$00 * or Pmax + offset voltage (5 V) RTS * Subroutine DELAY * Purpose is to delay the conversion process * to minimize LCD flickering. DELAY LDA #$FF * Loop for delay of display OUTLOOP LDB #$FF * Delay = clk/255*255 INLOOP DECB BNE INLOOP DECA BNE OUTLOOP RTS * Subroutine ADCONV * Purpose is to read the A/D input, store the conversion into * SENSOUT. For conversion purposes later. ADCONV LDX #REGBASE * loads base register for indirect addressing LDAA #$25 STAA ADCTL,X * initializes A/D cont. register SCAN=1,MULT=0 Freescale Semiconductor, Inc. For More Information On This Product, Go to: www.freescale.com |
|
ссылки 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 |