| Electronic Components Datasheet Search |
|
SPMCK16Z4MPV20 Datasheet(PDF) 474 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
SPMCK16Z4MPV20 Datasheet(HTML) 474 Page - Freescale Semiconductor, Inc |
|
474 / 500 page ![]() INITIALIZATION AND PROGRAMMING EXAMPLES M68HC16 Z SERIES E-22 USER’S MANUAL LDAB SCCNT,Z JSR HEXTOASC ;convert hex number to ASCII and print LINE_FD: ;output a linefeed LDAB #$0A ;load ASCII number for line feed JSR SEND_CH ;send character to terminal CARRIAGE: ;output a carriage return LDAB #$0D ;ASCII number for carriage return JSR SEND_CH ;send character to terminal RTS ;done with display routine ***** Hexadecimal to ASCII conversion ***** HEXTOASC: ;the following code takes a number or ;character stored in register D, assumes ;it's in its hexadecimal form and converts ;it to an ASCII equivalent. It also sends ;that character to the screen. STD TEMP,Z ;store the hex number temporarily into “TEMP” JSR PRTMSB LDD TEMP,Z ;reload value of hex number into D register ANDB #$0F ;get rid of upper 4 bits in hex number BRA PRTLSB PRTMSB: LSRB ;shift high 4 bits down to low 4 bits position LSRB LSRB LSRB PRTLSB: ;the actual conversion process: ADDB #$30 ;add $30 to the hex number CMPB #$39 ;check for digithood BLS NOTAF ;go print now if it's a digit 0-9 ADDB #$07 ;it's a letter A-F, so add $07 before printing NOTAF: JSR SEND_CH ;send the character to the SCI RTS ;done with hex to ascii conversion ***** Autovector Routine ***** AUTOV: ;when IRQ6 is low, this autovector routine starts LDAB #$55 ;These four lines reset the watchdog and keep it STAB SWSR ;from causing a system reset by writing to the SWSR LDAB #$AA ;By writing a #$55 and a #$AA to the SWSR before ;the end STAB SWSR ;of every time-out period, the watchdog will be reset. LDX #AUTOV_STRING JSR SEND_STRING RTI ;return to the main loop ***** Other exception/interrupts ***** BDM: BGND ;all other exception vectors point here ;and put the user into background mode Freescale Semiconductor, Inc. For More Information On This Product, Go to: www.freescale.com |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |