| поискавой системы для электроныых деталей |
|
MPXM2102AS датащи(PDF) 442 Page - Motorola, Inc |
|
|
|||||||||||||||||||||||||||||
MPXM2102AS датащи(HTML) 442 Page - Motorola, Inc |
|
442 / 670 page ![]() AN1326 3–296 Motorola Sensor Device Data www.motorola.com/semiconductors * Purpose is to implement a Look–Up conversion * The BCD is used to index off of TABLE * where the appropriate hex code to display * that decimal digit is contained. * DIGIT4,3,2 are converted only. LOOKUP LDX #DIGIT1+4 * Counter starts at 5 TABLOOP DEX * Start with Digit4 LDY #TABLE * Loads table base into Y–pointer LDAB 0,X * Loads current digit into B ABY * Adds to base to index off TABLE LDAA 0,Y * Stores HEX segment result in A STAA 0,X CPX #DIGIT2 * Loop condition complete, DIGIT2 Converted BNE TABLOOP RTS * Subroutine SPI2LCD * Purpose is to output digits to LCD via SPI * The format for this is to send a start byte, * four digits, and a stop byte. This system * will have 3 significant digits: blank digit * and three decimal digits. * Sending LCD Start Byte SPI2LCD LDX #REGBASE LDAA SPSR,X * Reads to clear SPIF flag LDAA #$02 * Byte, no colon, start bit BSR TRANSFER * Transmit byte * Initializing decimal point & blank digit LDAA DIGIT3 * Sets MSB for decimal pt. ORA #$80 * after digit 3 STAA DIGIT3 LDAA #$00 * Set 1st digit as blank STAA DIGIT1 * Sending four decimal digits LDY #DIGIT1 * Pointer set to send 4 bytes DLOOP LDAA 0,Y * Loads digit to be x–mitted BSR TRANSFER * Transmit byte INY * Branch until both bytes sent CPY #DIGIT4+1 BNE DLOOP * Sending LCD Stop Byte LDAA #$00 * end byte requires all 0’s BSR TRANSFER * Transmit byte RTS * Subroutine TRANSFER * Purpose is to send data bits to SPI * and wait for conversion complete flag bit to be set. TRANSFER LDX #REGBASE BCLR PORTD,X #$20 * Assert SS Line to start X–misssion STAA SPDR,X * Load Data into Data Reg.,X–mit XMIT BRCLR SPSR,X #$80 XMIT * Wait for flag BSET PORTD,X #$20 * DISASSERT SS Line LDAB SPSR,X * Read to Clear SPI Flag RTS * Location for FCB memory for look–up table * There are 11 possible digits: blank, 0–9 TABLE FCB $7E,$30,$6D,$79,$33,$5B,$5F,$70,$7F,$73,$00 END 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 |