Freescale Semiconductor, Inc. MC68HC05CxRG/ AD REV 1 Freescale Semiconductor, Inc... ' MC68HC05C4,C 8,C9 MC68HC705C8 MC68HC805C4 MC68HCL05C4, C8 MC68HSC05C4,C 8 PROGRAMMING REFERENCE GUIDE ® MOIOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. The MC68HC05 Family of HCMOS devices covered in this reference guide are as follows: MC68HC05C4 MC68HC05C8 Freescale Semiconductor, Inc... MC68HC05C9 MC68HC705C8 MC68HC805C4 MC68HCL05C4 MC68HCL05C8 MC68HSC05C4 MC68HSC05C8 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. BLOCK DIAGRAMS MEMORY MAPS Freescale Semiconductor, Inc... REGISTER/CONTROL BIT ASSIGNMENTS INSTRUCTIONS ADDRESSING MODES EXECUTION TIMES MECHANICAL DATA HEX/DEC CONVERSION ASCII CHART For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. BLOCK DIAGRAMS MEMORY MAPS Freescale Semiconductor, Inc... REGISTER/CONTROL BIT ASSIGNMENTS INSTRUCTIONS ADDRESSING MODES EXECUTION TIMES MECHANICAL DATA HEX/DEC CONVERSION ASCII CHART For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc... TCMP OSC1 OSC2 INTERN - --- ------ TCAP - - TIMER SYSTEM -- CLOCK a;ctLLATORAND DIVIDEBY2 - : ,. INTERNAL PROCE~R CLOCK RESET Freescale Semiconductor, Inc. For More Information On This Product, IRQ ', ' PAO ~- - IC IC - - PCO m ::. ~ ~ ~ r-sss: ~ : :_ I PA1 ACClNULATOR PC1 PA2 ~ ::: ~~ CPU ~IC ~~ .- - - I PORT A l/0 PA.1 LNES PM ~ ~ ~ :::: ::: ::. Si IC C I§ ffl - INDEX REGISTER CONTROL - cw 9:c., C, ~ 0 ~ ~ ~ ::. PC2 PORTCLO :::: PC3 ::::: I PC4 I LNES oo en nonen en PAS :: PM -:::: Ii: Cm: ~ ~IC Ii: ~ ::: PC5 I ~ OIGO 00 ~ - - i C CONDITION ! i -- -- ~ - PC7 - IPC6 C ::C ::C ::C _ en o o Go to: www.freescale.com PA7 CODE REGISTER CPU )> O or- PBO - - IC ~ STACK ·-·- PORT D .- PD7 ~(~ii G)OOu, PORT B 110 P82 ~ LNES PB1 P83 ~ P84 ~ -:::: :::: ::: :::: :::: :::: ;~ ICIQ m ~~ Z5 Si .... PONTER PROGRAM COUNTER HIGH ALU ·- SCI SPI .- :2 ~ -- .I - .. ~ :::: ,so, i.".i OSI PD3 :x, U'1 ~ 0 l> 0 .a:=i. .a:=i. s .a:=i. P85 :: P86 ~ ~ - Ii: Cm: ~ PROGRAM - SCK( SS(P05) ) P87 - :::: - i C COUNTER LOW BAUD- I RATE T T GENERATOR 415618 ROM 24018 17618 STATIC RAM NTE~AL t SELF.CHECK ROM PROCESSOR CLOCK Freescale Semiconductor, Inc... TCMP ~1 ~2 INTERNAL --------~ TCAP - TMER -- CLOCK OSCILLATOR AND -- INTERNAL PROCESSOR CLOCK - SYSTEM DIVIDE BY2 - RESET + IRQ Freescale Semiconductor, Inc. , t , t - - For More Information On This Product, PNJ ~ :: a: a: - :::- PCO ~ w ~ J= a: ~ S Ss ~ PA1 ~ ACClMULATOR PA2 ~ ::::: ~a: ta - -::::. pe PC1 .... ~~ CPU PC2 PORT C 1.0 a: ~~ .... :: PORT A l/0 PA3 ~ fa CONTROL (!) w ~ 3 LNES PM ~ :: :::: i5 fa INDEX g;a a: :::: :::::- ::::. PC4 LNES 0 ('") ('") ('") PAS PM - ~ - - Ii: :::: ~ ~ C Or-o C) 0 0 u, :a u, ~ ('") LNES PB3 ~ :::. w a: COUNTER HIGH I.,_ ~ )> ('") 00 00 PB4 ~ :::. CD i5fa n Ih :: ~ PONTER P81 PORTBIIO P82 ~ ~ :: .... SCI ~ PROGRAM .... TDO(PD,!t C)~ LNES PB3 ~ PB4 ~ ::- m ..., ' COUNTER HIGH ALU SPI Ri~~i ::c n P85 ~ ~ ::: Ii: ~a: PROGRAM SCl((~04) )> co PB6 ~ P87 - . i ~ ~ COUNTER LOW I BAUD- RATE SS(P05) s T T GENERATOR 176x8 15936 X8 (15760 X 8) (352 X8) STATIC RAM NTE"'11AL t RO.. PROCESSOR CLOCK 239BYTES SELF-cHECK ROM Freescale Semiconductor, Inc... T+P INTERNAL , 1 os♦ 2 t PROCESSOR CLOCK - COPCLOCK I TCAP - - TIMER SYSTEM -- OSCILLATOR AND DIVIDEBY2 - - I MONTOR I ,- RESET IRO ·+ Freescale Semiconductor, Inc. 1 I 1 - For More Information On This Product, PAO - -:.._ a: a: - PCO ~ ~ w ~ ~ a, PA1 ~ ~ ~ ACClMULATOR ~a: ~ - ~ PC1 PA2 ~ ~~ fa a:SQ CPU 6w c., :: ~ PC2 PORT C 1.0 r- 3: - ~ PORT Al/0 PA3 ~ LNES PM ~ PA5 ~ !'.'. ~ a: C ~ 83. INDEX REGISTER CONTROL - wt; g;a ow w a: 0 ~ ~ :'.'" PC3 ~ PC4 PC5 LNES On n en PM ::: : Ii: i-,JI:! ~a: Ii: ~ ~ PC6 2 ~ CONDITION ~ 2 - - ~ ~ ~ PA7 CODE REGISTER - - PC7 00 "C :::C CPU -- -n Go to: www.freescale.com PBO ~- ~ a: ~ STACK PORT D - PD7 )> -.J I ~~ ~ ~ POfflER PB1 ::: PORT Bl/0 PB2 ~ PB3 ~ ~ :.._ w a:SQ I- PROGRAM SCI ----- DI (POO) -- .I DO (PDt) G) 0 :a u, LNES ~ -~ ISO~PD2) J> n ~ PB4 ~ PB5 ~ ~ ~ a: m Z5fa ~a: COUNTER HIGH ALU SPI -~ ~ OSI PD3) ,. SCK ( 04) 3: 00 - - ~ :: PROGRAM SS(P05) PB6 ~ ~ ~ COUNTER LOW BAUD- PB7 I RATE -, - 1 I I GENERATOR 176 X 8 7744x8 (7600 X 8) I+ PROGRAM REGISTER (304 X 8) PROM STATIC NTEPHAL RAM PROCESSOR CLOCK 240x8 BOOTSTRAP ROM Freescale Semiconductor, Inc... TCMP ~1 OSC2 . ···----·· - . TNER --CLOCK OSCILLATOR AND R•-_ -1 IRQ REGISTE • 0 TCAP - - SYSTEM DIVIDE BY2 - -- Freescale Semiconductor, Inc. ...1BRK REGISTER: ,: : :ESET,MATCH For More Information On This Product, 1t 1~ H PAO - - a: ~ : a: ~ -::: PC1 PCO CD ~ I ~ PA1 ACCLUULATOR :: i=a: ~a: : 0nn3: " PA2 PORT A 110 PA3 - ::::: fa ~~ CPU CONTROL u~ ~ ~ ::: PC2 PORT C 1,0 PM -' ;;. a: I- INDEX .... ~ 00 ::::- ~ I- PORT D PB1 - ~ PONTER ~ - ·] C) 0 -- :: ~<~l, :: i=a: ,- SCI ; l5fa ~ PORT B 110 PB2 - ~~ :a u, LNES PB3 PB4 - PBS ::::: ::::: ::: : m ~ ~ - Ca: PROGRAM COUNTER HIGH PROGRAM ALU ,- SPI ISO~PD2) ::: •'i OSI PD3) ;;;_ - SS(PD6) SCI( ( 04) l> n 3: ~ PB6 J ~ :: ~ 0 COUNTER LOW PB7 - - BAUD- _I 1 I -I RATE GENERATOR 4156x 8 PROGRAM 176 X 8 EEPRCJA ~ REGISTER STATIC NTEtAL 240x8 RAM PROCE$0R CLOCK BOOTSTRAP ROM Freescale Semiconductor, Inc. MC68HC05C4 MC68HCL05C4 MC68HSC05C4 MEMORY MAP $0000 0000 - - - - - PORT A DATA REGISTER soo 1/D 32 BYTES PORT B DATA REGISTER SOl $001F 0031 PORT C DATA REGISTER $02 $0020 USER 00327 PORT D FIXED INPUT REGISTER S03 ROM I 48 BYT~S I PORT A DATA DIRECTION REGISTER S04 $004F QIJ79 I $0050 0080 I PORT B DATA DIRECTION REGISTER S05 I RAM I PORT C DATA DIRECTION REGISTER Freescale Semiconductor, Inc... S06 176 BYTES I I UNUSED $07 SOOBF 0191 I sooco ----i-64s;~~:s 0192 \ UNUSED $08 $DOFF 0255 I UNUSED $09 $0100 0256 \ USER SERIAL PERIPHERAL CONTROL REGISTER SOA I ROM I 1 SERIAL PERIPHERAL STATUS REGISTER SOB 2096 BYTES SlOff 2303 \ S1100 SERIAL PERIPHERAL DATA 1/0 REGISTER soc 2304 I UNUSED I SERIAL COMMUNICATIONS BAUD RATE REGISTER SOD 3584 BYTES I SlEFF 7935 I SERIAL COMMUNICATIONS CONTROL REGISTER 1 SOE SlfOO 7936 \ SERIAL COMMUNICATIONS CONTROL REGISTER 2 SOF SELF-CHECK I I SERIAl COMMUNICATIONS STATUS REGISTER SlO I $1FDF SlFEO ---------- SELF-CHECK I I I SERIAL COMMUNICATIONS DATA REGISTER Sll VECTORS TIMER CONTROL REGISTER S12 SlFEF 8175 256 SlFFO 8176 BYTES TIMER STATUS REGISTER S13 UNUSED Slff3 4 BYTES 8179 \I INPUT CAPTURE HIGH REGISTER S14 S1FF4 8180 USER VECTORS \I INPUT CAPTURE LOW REGISTER S15 12 BYTES I OUTPUT COMPARE HIGH REGISTER S16 SlFff 8191 I I OUTPUT COMPARE LOW REGISTER S17 \I COUNTER HIGH REGISTER $18 I COUNTER LOW REGISTER S19 I I ALTERNATE COUNTER HIGH REGISTER SlA I I ALTERNATE COUNTER LOW REGISTER SlB I I UNUSED SlC I I UNUSED SID I I UNUSED SlE UNUSED SlF For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. MC68HC05C8 MC68HCL05C8 MC68HSC05C8 MEMORY MAP $0000 0000 - - - - - PORT A DATA REGISTER $00 1/0 $01 PORT B DATA REGISTER 32 BYTES $001F 0031 PORT C DATA REGISTER $02 $0020 USER 0032' PORT D FIXED INPUT REGISTER $03 ROM \I PORT A DATA DIRECTION REGISTER $04 $004F 48 BYTES 0079 I $0050 PORT B DATA DIRECTION REGISTER $05 0080 \ I PORT C DATA DIRECTION REGISTER $06 Freescale Semiconductor, Inc... RAM 176 BYTES I I ----·r UNUSED $07 SOOBF 0191 I sooco STACK 0192 \ UNUSED $08 $DOFF 64 BYTES 0255 I UNUSED S09 $0100 0256 \ USER SERIAL PERIPHERAL CONTROL REGISTER SOA I ROM I SOB I SERIAL PERIPHERAL STATUS REGISTER 7680 BYTES $JEFF 7935 \ SERIAL PERIPHERAL DATA 1/0 REGISTER soc SlFOO 7936 I I SERIAL COMMUNICATIONS BAUD RATE REGISTER SOD SELF-CHECK I I SERIAL COMMUNICATIONS CONTROL REGISTER 1 SOE $1FDF I $1FEO i------------ SELF-CHECK I I SERIAL COMMUNICATIONS CONTROL REGISTER 2 SOF SlFEF VECTORS 8175 256 SERIAL COMMUNICATIONS STATUS REGISTER SlO SlFFO 8176 BYTES UNUSED SERIAL COMMUNICATIONS DATA REGISTER $11 $1FF3 4 BYTES 8179 \ S12 TIMER CONTROL REGISTER S1FF4 USER 8180 I I TIMER STATUS REGISTER $13 VECTORS $1FFF 12 BYTES 8191 \I INPUT CAPTURE HIGH REGISTER $14 \I INPUT CAPTURE LOW REGISTER S15 $16 OUTPUT COMPARE HIGH REGISTER I I OUTPUT COMPARE LOW REGISTER $17 I \I COUNTER HIGH REGISTER $18 I COUNTER LOW REGISTER $19 I SlA I ALTERNATE COUNTER HIGH REGISTER I $18 I ALTERNATE COUNTER LOW REGISTER I SlC I UNUSED I I UNUSED SlD I I UNUSED SlE I I f UNUSED SlF For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. MC68HC05C9 MEMOR Y MAP $0000 00000 - - - - - - PORT A DATA REGISTER $00 l/0 32 BYTES PORT B DATA REGISTER $01 $001F 00031 PORT C DATA REGISTER $02 $0020 PAGE ZERO 00032' PORT D DATA REGISTER $93 ROM OR RAM I I PORT A DATA DIRECTION REGISTER 48 BYTES $04 $004F 00079 \ $0050 00080 I PORT B DATA DIRECTION REGISTER $05 I Freescale Semiconductor, Inc... RAM PORT C DATA DIRECTION REGISTER $06 I 176 BYTES I 00191 I PORT D DATA DIRECTION REGISTER $07 00192 \ UNUSED $08 ----f-64s;~~~s $00FF 00255 \ UNUSED $09 $0100 00256 I ROM OR RAM I SERIAL PERIPHERAL CONTROL RfGISTER SOA 128 BYTES I $017F 00383 I SERIAL PERIPHERAL STATUS REGISTER SOB $0180 00384 \ MAIN MEMORY ROM I SERIAL PERIPHERAL DATA 1/0 REGISTER soc 15744·BYTES I SERIAL COMMUNICATIONS BAUD RATE REGISTER SOD $3EFF 16127 I $3FOO SELF-CHECK ROM 16349 \ SERIAl COMMUNICATIONS CONTROL REGISTER 1 SOE $3FDE 223 BYTES 16571 I SERIAk COMMUNICATIONS CONTROL REGISTER 2 $OF I $3FDF OPTION REGISTER 16572 I SERIAL COMMUNICATIONS STATUS REGISTER $10 S3FEO 16573 I SELF-CHECK I SERIAL COMMUNICATIONS DATA REGISTER $11 VECTORS I I TIMER CONTROL REGISTER S3FE F 16 BYTES I S12 16588 $3FFO I TIMER STATUS REGISTER USER 16589 I S13 VECTORS I I INPUT CAPTURE HIGH REGISTER $14 $3FF F 16 BYTES I 16604 INPUT CAPTURE LOW REGISTER $15 I I I OUTPUT COMPARE HIGH REGISTER $16 I I OUTPUT COMPARE LOW REGISTER $17 I . I COUNTER HIGH REGISTER $18 I I COUNTER LOW REGISTER . $19 I I ALTERNATE COUNTER HIGH REGISTER $1A I I ALTERNATE COUNTER LOW REGISTER $1B I I UNUSED $1C I I COP RESET REGISTER SlD I I COP CONTROL REGISTER $1E I I UNUSED $1F I For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. MC68HC705C8 MEMORY MAP $0000 0000 - - - PORT A DATA REGISTER $00 1/0 $01 PORT B DATA REGISTER 32 BYTES 0031 PORT C DATA REGISTER $02 $001F $0020 USER 00321 PORT D FIXED INPUT REGISTER $03 1 * { $0030 ~------- - ......RAM OR PROM I I PORT A DATA DIRECTION REGISTER $04 $004F 48 BYTES PORT B DATA DIRECTION REGISTER $05 0079 \ $0050 0080 I PORT C DATA DIRECTION REGISTER $06 Freescale Semiconductor, Inc... I RAM I UNUSED $07 176 BYTES I SOOBF 0191 \ UNUSED $08 $00CO $DOFF ----1~:~f:~ 0192 0255 I \ UNUSED $09 {: ;~~ ---------- 0256 I SERIAL PERIPHERAL CONTROL REGISTER $QA RAM OR PROM I SERIAL PERIPHERAL STATUS REGISTER $OB I 2* USER RAM I SERIAL PERIPHERAL DATA 1/0 REGISTER $DC OR ROM I I $OD $1EFF 7680 BYTES 7935 I SERIAL COMMUNICATIONS BAUD RATE REGISTER $1FOO BOOTSTRAP 7936 \ SERIAL COMMUNICATIONS CONTROL REGISTER 1 $0[ ROM I I SERIAL COMMUNICATIONS CONTROL REGISTER 2 $Of 223 BYTES I $1FDE ---------- 8158 I SERIAL COMMUNICATIONS STATUS REGISTER $10 $1FDF OPTION REG. 8159 I $11 SERIAL COMMUNICATIONS DATA RE~ISTER $1FEO ---------- 8160 \ i BOOTSTRAP ! TIMER CONTROL REGISTER $12 ROM 256 $13 TIMER STATUS REGISTER VECTORS BYTE s INPUT CAPTURE HIGH REGISTER $14 $1FEF 16 BYTES 8175 I $1FFO 8176 $15 $1FF3 UNUSED 4 BYTES 8179 \I INPUT CAPTURE LOW REGISTER OUTPUT COMPARE HIGH REGISTER $16 $1FF4 8180 I USER PROM I $17 OUTPUT COMPARE LOW REGISTER VECTORS I $1 FFF 12 BYTES 8191 \I COUNTER HIGH REGISTER $18 I COUNTER LOW REGISTER $19 I $1A I ALTERNATE COUNTER HIGH REGISTER I $1B I ALTERNATE COUNTER LOW REGISTER I $1C I PROGRAM REGISTER I I COP RESET REGISTER $10 I I COP CONTROL REGISTER $1( UNUSED $1F (Option Register $1FDF RAM1 =0 and RAM0=0) (POR or Master Reset) *The nature of this memory block (RAM or PROM) is controlled by bits RAMO and RAM1 of the Option Register ($1 FDF). 1 RAMO 0 - 48 Bytes User PROM RAMO 1 - 32 Bytes RAM with 16 Bytes Unused 2. RAM1 0 - 7680 Bytes User PROM RAM 1 1 - 7584 Bytes User PROM and 96 Bytes of RAM For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. MC68HC805C4 MEMORY MAP $0000 0000 - - - - - - PORT A DATA REGISTER $00 1/D 32 BYTES PORT B DATA REGISTER $01 $001F 0031 PORT C DATA REGISTER $02 $0020 USER iiii3i\ PORT D FIXED INPUT REGISTER $03 EEPRDM I 48 BYTES PORT A DATA DIRECTION REGISTER $04 $004F 0079 \ $0050 0080 \ PORT B DATA DIRECTION REGISTER $05 RAM I Freescale Semiconductor, Inc... PORT C DATA DIRECTION REGISTER $06 176 BYTES I I UNUSED $07 SOOBF 0191 I SOOCO ----l~4s;~~~s 0192 \ UNUSED $08 SOOFF 0255 I UNUSED $09 $0100 0256 \ USER SERIAL PERIPHERAL CONTROL REGISTER $0A I EEPROM I 4096 BYTES I SERIAL PERIPHERAL STATUS REGISTER $08 $10FF 4351 I $1100 4352 \ SERIAL PERIPHERAL DATA 1/0 REGISTER soc UNUSED I SERIAL COMMUNICATIONS BAUD RATE REGISTER SOD 3584 BYTES I $1EFF 7935 I SERIAL COMMUNICATIONS CONTROL REGISTER 1 $OE $!FOO 7936 I BOOTSTRAP I SERIAL COMMUNICATIONS CONTROL REGISTER 2 $OF $1FDE ROM I I SERIAL COMMUNICATIONS STATUS REGISTER $10 $1FDF I IRQ OPTION REG. I SERIAL COMMUNICATIONS DATA REGISTER $11 ---------- BOOTSTRAP I I TIMER CONTROL REGISTER $12 VECTORS I 256 TIMER STATUS REGISTER $13 $1FEF (ROM) 8175 BYTES SlFFO UNUSED 8176 INPUT CAPTURE HIGH REGISTER $14 I S1FF3 $1FF4 4 BYTES 8179 8180 \I INPUT CAPTURE LOW REGISTER $15 USER VECTORS OUTPUT COMPARE HIGH REGISTER $16 I EEPROM I 12 BYTES I OUTPUT COMPARE LOW REGISTER $17 $1FFF 8191 \I COUNTER HIGH REGISTER $18 I COUNTER LOW REGISTER $19 I I ALTERNATE COUNTER HIGH REGISTER $1A I I ALTERNATE COUNTER LOW REGISTER $16 I I PROGRAM REGISTER SlC I I BREAKPOINT ADDRESS LOW $10 I I BREAKPOINT ADDRESS HIGH $1E I UNUSED SlF For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. PROGRAMMING MODEL INTERRUPT STACKING ORDER PROGRAMMING MODEL 7 0 A I ACCUMULATOR 7 0 X I 1NOEX REGISTER Freescale Semiconductor, Inc... 12 0 PC I PROGRAM COUNTER 12 7 0 llllllll 0 0 0 0 0 1 1 SP I STACK POINTER CCR H I N Z C CONDITION CODE REGISTER CARRY/BORROW --ZERO ---NEGATIVE - - - - · INTERRUPT MASK - - - - - H A L F CARRY INTERRUPT STACKING ORDER STACK 7 0 1 l 1 l1I CONDITION CODE REGISTER I N R T E ACCUMULATOR E T R u INDEX REGISTER R R N I a oI oI PCH u p T PCL UNSTACK NOTE: Since the Stack Pointer decrements during pushes, the PCL is Forfollowed stacked first, More by Information PCH, etc. On Thisfrom Pulling the stack is in Product, the reverse order. Go to: www.freescale.com Freescale Semiconductor, Inc. REGISTER AND CONTROL BIT SUMMARY BIT BIT 7 6 5 4 3 2 0 $00 PA7 PA6 PA5 PA4 PA3 PA2 PAl PAO PORTA $01 PB7 PB6 PB5 PB4 PB3 PB2 PBl PBO PORTS $02 PC7 PC6 PC5 PC4 PC3 PC2 PCl PCO PORT C $03 PD7/* PD5/* PD4/* PD3/* PD2/* PDl/* POD/* PORTO $04 DDA7 DDA6 DDA5 DDA4 DDA3 DDA2 DDAl DDAO DORA $05 DDB7 DDB6 DDB5 DDB4 DDB3 DDB2 DD Bl DDBO DDRB Freescale Semiconductor, Inc... $06 DDC7 DDC6 DDC5 DDC4 DDC3 DDC2 DD Cl DDCO DDRC $07 0007 0005 0004 0003 0002 0001 ODDO DDRDt $08 UNUSED $09 UNUSED $QA SPIE SPE DWOMi' MSTR CPOL CPHA SPRl SPRO SPCR $OB SPIF WCOL MODF SPSR $QC SPD7 SPD6 SPD5 SPD4 SPD3 SPD2 SPDl SPDO SPDR $00 SCPl SCPO SCR2 SCRl SCRO BAUD $OE RB TB M WAKE SCCRl $OF TIE TCIE RIE ILIE TE RE RWU SBK SCCR2 $10 TORE TC RDRF IDLE OR NF FE SCSR $11 SCD7 SCD6 SCD5 SCD4 SCD3 SCD2 SCDl SCDO SCDAT $12 ICIE OCIE TOIE 0 0 0 IEDG OLVL TCR $13 ICF OCF TOF 0 0 0 0 0 TSR $14 ICH7 ICH6 ICH5 ICH4 ICH3 ICH2 ICHl ICHO ICHR $15 ICL7 ICL6 ICL5 ICL4 ICL3 ICL2 ICLl ICLO ICLR $16 OCH7 OCH6 OCH5 OCH4 OCH3 OCH2 OCHl OCHO OCHR $17 OCL7 OCL6 OCL5 OCL4 OCL3 OCL2 OCLl OCLO OCLR $18 CH7- /CH6 CH5 CH4 CH3 CH2 CHl CHO CHR $19 CL7 CL6 CL5 CL4 CL3 CL2 Cll CLO CLR $1A ACH7 ACH6 ACH5 ACH4 ACH3 ACH2 ACHl ACHO ACHR $1B ACL7 ACL6 ACL5 ACL4 ACL3 ACL2 ACLl ACLO ACLR $1C UNUSED $10 UNUSED $1E UNUSED $1F UNUSED *Denotes fixed input port, see following page. fMC68HC05C9 Foronly More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. REGISTER AND CONTROL BIT SUMMARY BIT BIT 7 6 5 4 3 2 0 PD7 PD5 PD4 PD3 PD2 PDl PDO S03 PORTO ss SCK MOSI MISO TOO ROI (POAT D FIXED INPUT REGISTER) BIT BIT Freescale Semiconductor, Inc... 7 6 5 4 3 2 1 0 so1j 0001 j I 00051 00041 000310002 0001 I I I DODO SlD CR7 CR6 CR5 CR4 CR3 CR2 CRl CRO COPRR SlE R7 R6 R5 COPF CME COPE CMl CMO COPCR S3FDF RAMO RAMl IRQ OPTREG (MC68HC05C9 ONLY) BIT BIT 7 6 5 4 3 2 0 SlC 0 0 0 0 0 LAT 0 PGM PR ·---- $10 CR7 CR6 CR5 CR4 CR3 CR2 CRl CRO COPRR SlE 0 0 0 COPF CME COPE CMl CMO COPCR SlF UNUSED IRQ I I O 1RQOR (MC68HC705C8 ONLY) , BIT BIT 7 6 5 4 3 2 0 SlC 0 CPEN 0 0 ERASE LATA LATB EEPGM PR SlD A7 A6 A5 A4 A3 A2 Al AO ARL SlE 0 0 MATCH A12 Al 1 AlO A9 A8 ARH SlF UNUSED SlF□ FI 0 IRQ O I IRQOR For More Information On This Product, Go (MC68HC805C4 ONLY) to: www.freescale.com Freescale Semiconductor, Inc. ACHR Alternate Counter High Register (ACHR) $1A 7 6 5 4 3 2 1 0 I I I I I I I I 1 ACH7 ACH6 ACH5 ACH4 ACH3 ACH2 ACHl ACHO · RESET 0 ACLR Alternate Counter Low Register (ACLR) $1 B 7 6 5 4 3 2 1 0 I I I I I I I I I Freescale Semiconductor, Inc... ACL7 ACL6 ACL5 ACL4 ACL3 ACL2 ACL 1 ACLO RESET 0 ARH (MC68HC805C4 ONL V) Hardware Breakpoint Register High (ARH) $1 E 7 6 5 4 3 2 0 I a -I I I 0 MATCH A12 Al 1 AlO A9 A8 RESET 0 0 0 0 0 0 0 0 MATCH - An instruction with the same address as that in the breakpoint register was fetched. 1 = Breakpoint enabled 0 = Breakpoint disabled A 12-AS - Breaklpoint address bits A 12-AS ARL (MC68HC805C4 ONLV) Hardware Breakpoint Register Low (ARL) $1 D 7 6 5 4 3 2 0 I A7 A6 A5 A4 A3 A2 Al AO RESET 0 0 0 0 0 0 0 0 For More Information On This Product, ARL Go to: www.freescale.com Freescale Semiconductor, Inc. BAUD Baud Rate Register (BAUD) $0D The baud rate register is used to select the SCI transm itter and receiver baud rate. SCPO and SCP1 prescaler bits are used in conjun ction with the SCR2-SCRO baud rates to pro- vide multipl e baud rate combin ations for a given crystal fre- quency. Bits 3, 6, and 7 always read zero. 7 6 5 4 3 2 0 SCPl SCPO I I I I SCR2 SCRl SCRO RESET 0 0 u u u Freescale Semiconductor, Inc... SCPO - SCI Prescaler Bit 0 SCP1 - SCI Prescaler Bit 1 Two prescaler bits are used to increase the range of standa rd baud rates control led by the SCR2-SCRO bits. Prescaler interna l proces sor clock division versus bits levels are listed in Table 1. SCRO - SCI Baud Rate Bit 0 SCR1 - SCI Baud Rate Bit 1 SCR2 - SCI Baud Rate Bit 2 Three baud rate bits are used to select the baud rates of the SCI transm itter and SCI receiver. Baud rates versus bit levels are listed in Table 2. Tables 1 and 2 tabulat e the divide chain used to obtain the baud rate clock (transm it clock). The actual divider chain is control led by the combin ed SCP1-SCPO and SCR2-SCRO bits in the baud rate register. All divided frequen cies shown in Table 1 represent the final baud rate resultin g from the in- ternal proces sor clock division shown in the divided by col- umn only (prescaler division only). Table 2 lists the prescaler output divide d by the action of the SCI select bits (SCR2-SCRO). For example, assume that a 9600 Hz baud rate is require d with a 2.4576 MHz external crystal. In this case, the prescaler bits (SCP1-SCPO) could be configu red as a divided -by-two . Using the same crystal, the 9600 baud rate can be obaine d with a prescaler divided -by-one and the SCR2-SCRO bits configu red for a divide- by-eigh t. For More Information On This Product, Go to: www.freescale.com BAUD Freescale Semiconductor, Inc... m Table 1. Prescaler Highest Baud Rate Frequency Output aJ l> SCP Bit Clock* Crystal Frequency MHz l> C C 1 0 Divided By 8.0 4.194304 4.0 2.4576 2.0 1.8432 C 0 0 1 250.00 kHz 131.072 kHz C 125.000 kHz 76.80 kHz 62.60 kHz 57.60 kHz 0 1 3 83.332 kHz 43.691 kHz 41.666 kHz 25.60 kHz 20.833 kHz 19.20 kHz Freescale Semiconductor, Inc. 1 0 4 62.500 kHz 32.768 kHz 31.250 kHz 19.20 kHz 15.625 kHz 14.40 kHz For More Information On This Product, 1 1 13 19.200 kHz 10.082 kHz 9600 Hz 5.907 kHz 4800 Hz 4430 Hz '' Refers to the internal processor clock. NOTE: The divided frequencies shown in Table 1 represent baud rates which are the highest transmit baud rate (Tx) that can be obtained by a specific crystal frequency and only using the prescaler division. Lower baud rates may be obtained by providing the SCI rate select bits as shown below for some representative prescaler outputs. a further division using Table 2. Transmi t Baud Rate Output for a Given Prescaler Output Go to: www.freescale.com SCR Bits Divided Representative Highest Prescaler Baud Rate Output 2 1 0 By 131.072 kHz 32.768 kHz 76.80 kHz 19.20 kHz 9600 Hz 0 0 0 1 131.072 kHz 32.768 kHz 76.80 kHz 19.20 kHz 0 0 1 2 9600 Hz 65.536 kHz 16.384 kHz 38.40 kHz 9600 Hz 4800 Hz 0 1 0 4 32.768 kHz 8.192 kHz 1S.2Q kHz 4800 Hz 0 1 1 8 2400 Hz 16.384 kHz 4.096 kHz 9'600Hz 2400 Hz 1200 'Hz 1 0 0 16 8.192 kHz 2.048 kHz 4800 Hz 1200 Hz 1 0 1 32 600 Hz 4.096 kHz 1.024 kHz 2400 Hz 600 Hz 300 Hz 1 1 0 64 2.048 kHz 512 Hz 1200 Hz 300 Hz 1 1 1 128 150 Hz 1.024 kHz 256 Hz 600 Hz 150 Hz 75 Hz NOTE: Table 2 illustrates how the SCI select bits can be used to provide ·rower transmitter baud rate by further dividing the prescaler output frequency. The five examples are only representative samples. In all cases, the baud rates show.ff it:fe transmit baud rates !transmit clock) and the receive clock is 16 times higher in frequency than the actual baud rate. Freescale Semiconductor, Inc. CHR Counter High Register (CHR) $18 7 6 5 4 3 2 1 0 I I CH7 b CH6 ] CH5 CH4 CH3 I I CHl I CH2 !. CHO RESET CLR Counter Low Register (CLR) $19 7 6 5 4 3 2 0 Freescale Semiconductor, Inc... =- CL7 CL6 CL5 CL4 CL3 CL2 CLl CLO RESET 0 For More Information On This Product, Go to: www.freescale.com CLR Freescale Semiconductor, Inc. COPCR (MC68HC705C8 ONLV) COP Control Register (COPCR) $1 E The COPCR shown below is used to control the COP watch- dog timer and clock monitor functions. 7 6 5 4 3 2 0 0 0 0 I I I I COPF CME COPE CMl GMO RESET 0 0 0 0 0 0 0 0 COPF-Computer Operating Properly 1 = COP or clock monitor reset has occurred 0= No COP or clock monitor reset has occurred Freescale Semiconductor, Inc... CME - Clock Monitor Enable 1 = Clock monitor enabled 0 = Clock monitor disabled COPE - Computer Operating Properly Enable 1 = COP timeout enabled 0 = COP timeout disabled CM1 - Computer Operating Properly Mode 1 Used in conjunction with CMO0 to establish the COP timeout period. CM1 can be read and set anytime, but is cleared only by reset. See Table 3. CM0 - Computer Operating Properly Mode 0 Used in conjunction with CM1 to establish the COP timeout period. CM0 can be read and set anytime, but is cleared only by reset. See Table 3. Bits 7-5 - Not used* Always read zero *In the MC68HC05C9, these bits (R7-R5) are reserved factory test bits. For More Information On This Product, Go to: www.freescale.com COPCR Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. For More Information On This Product, Table 3. COP Timeout Period E/215 XTAL = 4.0 MHz, XTAL= 3.5795 MHz, XTAL = 2.0 MHz, XTAL= 1.0 MHz, CM1 CM0 E= 1.0 MHz E=0.5 MHz Divided By E=2.0 MHz E = 1.7897 MHz 0 0 1 16.38 ms 18.31 ms 32.77 ms 65.54 ms Go to: www.freescale.com 0 1 4 65.54 ms 73.24 ms 131.07ms 262.14ms 1 0 16 262.95 ms 292.95 ms 524.29 ms 1.048 s 1 l 64 1.048 s 1.172 s 2.097 s 4.194 s (MC68HC705C8 AND MC68HC05C9 ONL V) n n .,, 0 .,, 0 n n :x, :x, Freescale Semiconductor, Inc. COPRA COP Reset Register (COPRR) $10 The COPRR shown below is used to control the COP watch- dog timer and clock monitor functions. 7 6 5 4 3 2 0 RESET 0 0 0 0 0 0 0 0 The sequence required to reset the COP timer is as follows: Write $55 to the COP reset register. Write $AA to the COP reset register. Both write operations must occur in the order listed, but any number of instructions may be executed between the Freescale Semiconductor, Inc... two write operations. The elapsed time between software resets must not be greater than the COP timeout period. Reading the COP reset register does not return valid data and does not affect the watchdog timer. (MC68HC705C8 AND MC68HC06C9 ONLY) COP Reset Register (COPRR) $1D The COPRR shown below is used to control the COP watch- dog timer and clock monitor functions. 7 6 5 4 3 2 0 RESET 0 0 0 0 0 0 0 0 The sequence required to reset the COP time is as follows: Write $55 to the COP reset register. Write $AA to the COP reset register. Both write operations must occur in the order listed, but any number of instructions may be executed between the two write operations. The elapsed time between software resets must not be greater than the COP timeout period. Reading the COP reset register does not return valid data and does not affect the watchdog timer. (MC68HC705C8 AND MC68HC05C9 ONL V) For More Information On This Product, COPRA Go to: www.freescale.com Freescale Semiconductor, Inc. DORA Data Direction Register A (DORA) $04 7 6 5 4 3 2 l 0 I I I I I I I I I DDA7 DDA6 DDA5 DDA4 DDA3 DDA2 DDA1 ODAO RESET 0 0 0 0 0 0 0 0 DDA7-DDA0 - 0 = Inputs 1 = Outputs DDRB Freescale Semiconductor, Inc... Data Direction Register B (DDRB) $05 7 6 5 4 3 2 1 0 I o□ B7 I I o□B5 I o□ B4 I o□ B3 I ooss oos2 f oos1 I I ooso RESET 0 0 0 0 0 0 0 0 DOB7-DDB0 - 0 = Inputs 1 = Outputs DDRC Data Direction Register C (DDRC) $06 7 6 5 4 3 2 1 0 I I I I I I I I I DDC7 DDC6 DDC5 DOC4 DDC3 DDC2 DOC1 DDC0 RESET 0 0 0 0 0 0 0 0 DDC7-DDC0 - 0 = Inputs 1 = Outputs For More Information On This Product, Go to: www.freescale.com DDRC Freescale Semiconductor, Inc. DORO Data Direction Register D (DDRD) $07 1 6 5 4 3 2 1 0 1 0001 I l I D0D5 D0D4 · 1 D0D3 I I I I D0D2 D0D1 DODO' RESET I 0 0 0 0 0 0 0 0 DDD5-DDDO - 0 = Inputs 1 = Outputs Bits 7,6 - Not used. Freescale Semiconductor, Inc... ICHR Input Capture High Register (ICHR) $14 7 6 5 4 3 2 1 0 I I I I I I I IcH1 icHs icH5 icH4 IcH3 IcH2 IcH1 1 icHo I RESET u u u u u u u u ICLR Input Capture Low Register (ICLR) $15 7 6 5 4 3 2 0 ICL7 ICL6 ICL5 ICL4 ICL3 ICL2 ICLl ICLO RESET u u u u u u u u For More Information On This Product, ICLR Go to: www.freescale.com Freescale Semiconductor, Inc. IRQOR (MC68HC705C8 ONLV) Option Register (IRQOR) $1 FDF The option register is used to select the IRQ sensitivity , enable the PROM security, and select the memory configu- ration. 7 6 5 4 3 2 0 I I I RAMO RAM 1 0 0 SEC IRQ 0 RESET 0 0 0 0 u 0 RAMO- Random Access Memory Control Bit 0 1 = Maps 32 bytes of RAM into page zero starting at address Freescale Semiconductor, Inc... $0030. Addresses from $0020 to $0030 are reserved. This replaces 48 bytes of PROM that were used at these locations. This bit can be read or written at any time, allowing memory configurat ion to be changed during program execution. 0= Provides 48 bytes of PROM at location $0030. RAM 1 - Random Access Memory Control Bit 1 1 = Maps 96 bytes of RAM into page zero starting at address $0100. This replaces 96 bytes of PROM that were used at these locations. This bit can be read or written at any time, allowing memory configurat on to be changed during program execution. 0= Provides 96 bytes of PROM at location $0100. SEC- Security 1 = Bootloader disabled, MCU operates only in single-chip mode. 0= Security off, bootloader enabled, expanded mode enabled. !RO-Inter rupt Request Bit Sensitivity 1 = iRa pin is both negative edge- and level-sensitive. 0 = iRa pin is negative edge-sensitive only. iRo is set only by reset, but can be cleared by software. This can only be written once. Bit 0, 4, 5 Always read zero. Bit 2 Can be either one or zero. For More Information On This Product, Go to: www.freescale.com IRQOR Freescale Semiconductor, Inc. IROOR (MC68HC05C9 ONLV) Option Register (IRQOR) $3FDF The option register is used to select the IRQ sensitivity, enable the ROM s~urity, and select the memory configuration. 7 6 5 4 3 2 0 I I I RAMO RAMl 0 0 0 0 IRQ 0 RESET 0 0 0 0 0 0 0 RAMO-Ra ndom Access Memory Control Bit 0 1 = Maps 32 bytes of RAM into page zero starting at address Freescale Semiconductor, Inc... $0020. This replaces 48 bytes of ROM that were used at these locations. This bit can be read or written at any time, allowing memory configuration to be changed during program execution. 0 = Provides 48 bytes of ROM at location $0020. RAM 1 - Random Access Memory Control Bit 1 1= Maps 128 bytes of RAM into page zero starting at address $0100. This replaces 128 bytes of ROM that were used at these locations. This bit can be read or written at any time, allowing memory configuraton to be changed during program execution. 0= Provides 128 bytes of ROM at location $0100. !RO-Inter rupt Request Bit Sensitivity 1 = iRTI pin is both negative edge- and level-sensitive. 0 = iRTI pin is negative edge-sensitive only. iRTI is set only by reset, but can be cleared by software. This can only be written once. Bit 0, 2, 3, 4, 5 Always read zero. For More Information On This Product, IROOR Go to: www.freescale.com Freescale Semiconductor, Inc. IRQOR (MC68HC805C4 ONLV) IRQ Option Register (IRQOR) $1 FOF 7 6 5 4 3 2 0 Io Io Io Io Io fo IRQ I O-, RESET 0 0 0 0 0 0 0 Bits 7-2, 0 - Not used Always read zero. IRO - Interrupt Request Bit Sensitivity 1 = IRO pin is both negative edge- and level-sensitive. 0 = IRO pin is negative edge-sensitive only. Freescale Semiconductor, Inc... IRQ is set only by reset, but can be cleared by software. OCHR Output Compare High Register (OCHR) $16 7 6 5 4 3 2 1 0 I OCH7 I OCHS I OCH5 I OCH4 I OCH3 I OCH2 I OCHl I OCH0 I RESET u u u u u u u u OCLR Output Compare Low Register (OCLR) $17 7 6 5 4 3 2 1 0 I OCL7 I OCL6 I OCL5 I OCL4 I OCL3 I OCL2 I OCLl I OCL0 I RESET u u u u u u u u For More Information On This Product, Go to: www.freescale.com OCLR Freescale Semiconductor, Inc. PORTA Port A Data Register (PORTA) $00 7 6 5 4 3 2 0 PA7 PA6 PA5 PA4 PA3 PA2 PAl PAO RESET u u u u u u u u PORTB Port B Dat~ Register (PORTB) $01 7 6 5 4 3 2 0 Freescale Semiconductor, Inc... PB7 PB6 PB5 PB4 PB3 PB2 PBl PB0 RESET u u u u u u u u PORTC Port C Data Register (PORTC) $02 7 6 5 4 3 2 0 PC7 PC6 PC5 PC4 PC3 PC2 PCl PC0 RESET u u u u u u u u PORTO Port D Data Register (PORTO) $03 7 6 5 4 3 2 1 0 PD7 I PD5 I PD4 I PD3 I PD2 I PDl I PD0 RESET PD7 0 PD5/ PD4/ PD3/ PD2/ PDl/ PD0/ ss SCK MOSI MISO TOO ROI (Port D fixed input register) RESET u u u u u u u u For More Information On This Product, Go to: www.freescale.com PORTO Freescale Semiconductor, Inc. PR (MC68HC705C8 ONLV) Program Register (PR) $1C The program register ($1C) is used to perform PROM pro- gramming. 7 6 5 4 3 2 l O Ia a IaIa 0 LAT I 0 PGM RESET 0 0 0 0 0 0 0 0 LAT - Latch Enable 1 = Enables PROM data and address bus latches for pro- gramming or erasing on the next byte write cycle. Freescale Semiconductor, Inc... 0 = Latch disabled. PROM data and address buses are un- latched for normal CPU operations. This bit is both readable and writable. PGM - Program 1 = Applies Vpp power to the PROM for programming. 0 = Vpp power off. If LAT is cleared, PGM cannot be set, Bits 1, 7-3 - Not Used Always read zero. (MC68HC805C4 ONLV) Program Register (PR) $1C The program register ($1 C) is used for single-byte EE PROM programming. 7 6 5 4 3 2 1 0 I I I O CPEN 0 0 I I I I I ERASE LATA LATB EEPGM RESET 0 0 0 0 0 0 0 0 CPEN - Charge Pump Enable 1 = Charge pump enabled 0 = Charge pump disabled ERASE - Erase EEPROM Enable 1 = Erase enabled 0 = Erase disabled LATA- Latch A Enable 1 = Enables array A data and address bus latches for pro- gramming or erasing on the next byte write cycle. 0 = Latch disabled LATB - Latch B Enable 1 = Enables array B data and address bus latches for pro- gramming or erasing on the next byte write cycle. 0 = Latch disabled Note: If LATA and LATB are cleared, EEPGM cannot be set. For More Information On This Product, Go to: www.freescale.com PR Freescale Semiconductor, Inc. PR EEPGM - Electrically Erase/Program 1 =Applies Vpp power to the EEPROM array for program- ming or erasing operation. 0=Vpp power off Bits 4, 5, 7 - Not used Always read zero. SCCR1 Serial Communications Control Reg. 1 (SCCR1) $OE The SCCR1 register control bits determine word length and select the wake-up method. Freescale Semiconductor, Inc... 7 6 5 4 3 2 0 I RB TB RESET u u u u R8 - Receive Data Bit 8 R8 bit provides storage location for the ninth bit in the receive data byte (if M = 1). T8 - Transmit Data Bit 8 T8 bit provides storage location for the ninth bit in the transmit data byte (if M = 1). M - SCI Character Word Length 1 = One start bit, nine data bits, one stop bit 0 = One start bit, eight data bits, one stop bit WAKE -Wake-Up Select Wake bit selects the receiver wake-up method. 1 = Address bit (most significant bit) 0 = Idle line condition Bits 2-0 and 5 - Not used Can read either one or zero. The address bit is dependent on both the wake-bit and the m-bit level. Additionally, the receiver does not use the wake- up feature unless the RWU control bit is SCCR2 is set. Wake M Receiver Wake-Up 0 X Detection of an idle line allows the next data byte received to cause the receive data register to fill and produce an RDRF flag. 1 0 Detection of a received one in the eighth data bit allows an RDRF flag and associated error flags. 1 1 Detection of a received one in the ninth data bit allows an RDRF flag and associated error flags. For More Information On This Product, SCCR1 Go to: www.freescale.com Freescale Semiconductor, Inc. SCCR2 Serial Co,mmunications Control Reg. 2 (SCCR2) $OF The SCCA2 provides control of individual SCI functions such as intern,pts, transmit/receive enablin9, receiver wakeup, and break code. 7 6 5 4 3 2 0 I TIE TCIE RIE ILIE TE RE RWU I SBK RESET 0 0 0 0 0 0 0 0 TIE - Transmit Interrupt Enable 1 ;,= SCI interrupt enabled 0 = TORE interrupt disabled Freescale Semiconductor, Inc... TCIE - Transmit Complete Interrupt Enable 1 = SCI interrupt enabled 0 = TC interrupt disabled RIE - Receive Interrupt Enable 1 = SCI interrupt enabled 0 = RDRF and OR interrupts disabled ILIE - Idle Line Interrupt Enable 1 = SCI interrupt enabled O= Idle interrupt disabled TE-Transmit Enable 1 =Transmit shift register output is applied to the TDO line. Depending upon the SCCR1 M bit, a preamble of 10 (M =O) or 11 (M = 1) consecutive ones is transmitted. 0 = Transmitter disabled after last byte is loaded in the SCDAT and TORE is set. After last byte is transmitted, TOO line becomes a high-impedance line. RE - Receive Enable 1 = Receiver shift register input is applied to the ROI line. 0 = Receiver disabled and RORF, IDLE, OR, NF, and FE sta- tus bits are inhibited. For More Information On This Product, Go to: www.freescale.com SCCR2 Freescale Semiconductor, Inc. SCCR2 RWU - Receiver Wake-Up 1 == Places receiver in sleep mode and enables wake-up function. O Wake-up function disabled after receiving data word with MSB set (if WAKE= 1 ). Wake-up function also dis- abled after receiving 10 (M = 0) or 11 (M = 1) consecu- tive ones (if WAKE=O). SBK - Send Break 1 = Transmitter continually sends blocks of zeros (sets of 10 or 11) until cleared. Upon completion of break code, transmitter sends one high bit for recognition of valid start bit. O= Transmitter sends 10 (M = 0) or 11 (M = 1) zeros then reverts to an idle state or continues sending data. If Freescale Semiconductor, Inc... transmitter is empty and idle, setting and clearing the SBK bit may queue up to two character times of break because the first break transfer immediately to the shift register, and the second is queued into the parallel transmit buffer. SCDAT Serial Communications Data Register (SCDAT) $11 The SCDAT is a read/write register used to receive and transmit SCI data. 7 6 5 4 3 2 1 0 I SCD7 I SCD6 I SCD5 I SCD4 I SCD3 I SCD2 I SCDl I SCDO I RESET u u u u u u u u SCSR Serial Communications Status Register (SCSR) $10 The SCSR proyides inputs to the SCI interrupt logic circuits. Noise flag and framing error bits are also contained in the SCSR. 7 6 5 4 3 2 0 I TORE I TC6 I RDRF I IDLE OR NF FE RESET 0 0 0 0 0 TORE - Transmit Data Register (TOR) Empty 0 = TOR contents transferred to the transmit data shift reg- ister. 0 = TOR still contains data. TORE is cleared by reading the SCSR followed by a write to the TOR. For More Information On This Product, SCSR Go to: www.freescale.com Freescale Semiconductor, Inc. SCSR TC - Transmit Complete 1:;;;;;; Indicates end of data frame, preamble, or break con- dition has occurred. Oz:: TC bit cleared by reading the SCSR, followed by a write to the TDR. RDRF-Receive Data Register (RDR) Full 1 = Receive data shift register contents transferred to the RDR. 0 = Receive data shift register transfer did not occur. RDRF is cleared by reading the SCSR, followed by a read of the RDR. IDLE - Idle Line Detect 1 = Indicates receiver has detected an idle line. 0= IDLE is cleared by reading the SCSR, followed by a read of the RDR. Once IDLE is cleared, IDLE cannot be set until Freescale Semiconductor, Inc... RDI line becomes active and idle again. OR - Overrun Error 1 = Indicates receive data shift register data is sent to a full RDR (RDRF = 1). Data causing the overrun is lost, and RDR data is not disturbed. 0 = OR is cleared by reading the SCSR, followed by a read of the RDR. NF - Noise Flag 1 = Indicates noise is present on the receive bits, including the start and stop bits. NF is not set until RDRF=1. 0 = NF is cleared by reading the SCSR, followed by a read of the RDR. FE - Framing Error 1 = Indicates stop bit not detected in received data char.. acter. FE is set the same time RDRF is set. If received byte causes both framing and overrun errors, proces- sor will only recognize the overrun error. Further data transfer into the RDR is inhibited until FE is cleared. 0 = FE is cleared by reading the SCSR, followed by a read of the RDR. Bit O - Not used Can read either one or zero. For More Information On This Product, Go to: www.freescale.com SCSR Freescale Semiconductor, Inc. SPCR Serial Peripheral Control Register (SPCR) $0A The SPCR provides control of individual SPI functions such as interrupt and system enabling disabling, master slave mode select, and clock polarity phase rate select. 7 6 5 4 3 2 1 0 I s;1E I SPE lowoM*I MSTR I CPOL I CPHA I SPR1 I SPR0 I RESET 0 0 0 u u u u SPIE - Serial Peripheral Interrupt Enable 1 = SPI interrupt enabled 0 = SPI interrupt disabled SPE - Serial Peripheral System Enable 1 = SPI system on Freescale Semiconductor, Inc... 0 = SPI system off MSTR - Master Mode Select 1 = Master mode 0 = Slave mode CPOL - Clock Polarity Clock polarity bit controls the clock value and is used in conjunction with the cloc~ phase (CPHA) bit. 1 = SCK line idles high 0 = SCK line idles in low state CPHA - Clock Phase Clock phase bit along with CPOL controls the clock-data relationship between the master and slave devices. CPOL selects one or two clocking protocols. 1 = SS is an output enable control. _ 0 = Shift clock is the OR or SCK with SS. When SS is low, first edge of SCK invokes first data sample. SPR1-SPR0 - SPI Clock Rate Bits Two clock rate bits are used to select one of four clock rates to be used as SCK in the master mode. In the slave mode, the two clock rate bits have no effect. Clock rate selection is shown in the following table. Internal Processor Clock SPR1 SPRO Divided By 0 0 2 0 1 4 1 0 16 1 1 32 Bit 5 - Not used* Can read either one or zero. (*MC68HC05C9 only, bit 5 (DWOM) is the wire-OR mode bit.) 1 = Disables active pull up devices on Port D, causing outputs to be open drain. O= Open-drain disabled. For More Information On This Product, SPCR Go to: www.freescale.com Freescale Semiconductor, Inc. SPDR Serial Peripheral Data 1/0 Register (SPDR) $0C The SPDR is read/write register used to receive and trans- mit SPI data. 7 6 5 4 3 2 1 0 I SPD7 I SPD6 I SPD5 I SPD4 I SPDJ I SPD2 I SPDl I SPD0 I RESET u u u u u u u u A write to the SPDR places data directly into the shift reg- ister for transmission. Only a write to this register will initiate transmission/reception of another byte and will only occur in the master device. On completion of byte transmission, the SPIF status bit is set in both master and slave devices. Freescale Semiconductor, Inc... A read to the SPDR causes the buffer to be read. The first SPIF status bit must be cleared by the time a second data transfer from the shift register to the read buffer begins, or an overrun condition will exist. In overrun cases, the byte causing the overrun is lost. SPSR Serial Peripheral Status Register (SPSR) $0B The SPSR contains three status bits. 7 6 5 4 3 2 0 I SPIF I WCOL I I MODF I RESET 0 0 0 SPIF - Serial Peripheral Data Transfer Flag 1 = Indicates data transfer completed between processor and external device. (If SPIF = 1 and SPIE = 1, SPI interrupt is enabled.) 0 = Clearing is accomplished by reading SPSR, followed by SPDR access. WCOL-Write Collision 1 = Indicates an attempt is made to write to SPDR while data transfer is in processor. O= Clearing is accomplished by reading SPSR, followed by SPDR access. MODF - Mode Fault Flag 1 = Indicates multi-master system control conflict. 0 = Clearing is accomplished by reading SPSR, followed by a write to the SPCR. Bits 3-0 and 5 - Not used Can read either zero or one. For More Information On This Product, Go to: www.freescale.com SPSR Freescale Semiconductor, Inc. TCR Timer Control Register (TCR) $12 The TCR is a read/write register containing five control bits. Three bits control interrupts associated with the timer status register flags ICF, OCF, and TOF. 7 6 5 4 3 2 0 I ICIE OCIE TOIE 0 0 0 IEDG OLVL RESET 0 0 0 0 0 0 u 0 ICIE - Input Capture Interrupt Enable 1 = Interrupt enabled 0 = Interrupt disabled OCIE - Output Compare Interrupt Enable Freescale Semiconductor, Inc... 1 = Interrupt enabled 0 = Interrupt disabled TOIE - Timer Overflow Interrupt Enable 1 = Interrupt enabled 0 = Interrupt disabled IEDG - Input Edge Value of input edge determines which level transition on TCAP pin will trigger free-running counter transfer to the input capture register. 1 = Positive edge 0 = Negative edge OL VL - Output Level Value of output level is clocked into output level register by the next successful output compare and will appear on the TCMP pin. 1 = High output 0 = Low output Bits 2, 3, and 4 - Not used Always read zero. For More Information On This Product, TCR Go to: www.freescale.com Freescale Semiconductor, Inc. TSR Timer Status Register (TSR) $13 The TSR is a read-only register containing three status flag bits. 7 6 5 4 3 2 0 ICF OCF TOF 0 0 0 0 0 RESET U U U O O O O 0 ICF - Input Capture Flag 1 = Flag set when selected polarity edge is sensed by input capture edge detector. 0 = Flag cleared when TSR and input capture low register ($15) are accessed. Freescale Semiconductor, Inc... OCF - Output Compare Flag 1 = Flag set when output compare register contents match the free-running counter contents. 0 = Flag cleared when TSR and output compare low reg- ister ($17) are accessed. TOF - Timer Overflow Flag 1 = Flag set when free-running counter transition from $FFFF to $0000 occurs. 0= Flag cleared when TSR and counter low register ($19) are accessed. Bits 4-0 - Not used Always read zero. For More Information On This Product, Go to: www.freescale.com TSR Freescale Semiconductor, Inc. ADDRESSING MODES IMMEDIATE (IMM) The effective address (EA) of an immediate mode instruc- tion is the location following the opcode. This mode is used to fetch a value which is known at the time the program is written, and which is not changed during program execution. DIRECT (DIR) The EA of a direct mode instruction is the contents of the byte following the opcode. This mode is used to fetch a value from any one of the first 256 memory locations with a two- byte instruction. EXTENDED (EXT) The EA of an extended mode instruction is the contents of the next two bytes following the opcode. This mode is Freescale Semiconductor, Inc... used to fetch a value from any location in the MC146805G2 memory location, 1.0, RAM, and ROM, with a three-byte in- struction. INDEXED (IX, IX1, IX2) The EA of an indexed mode instruction is determined by the contents of the X-register being added to an offset. The offset can be either zero, 8-bit, or 16-bit. For zero offset (IX), the X-register is the EA. For 8-bit offset (IX1 ), the result of the X-register contents added to the byte following the op- code is the EA. For 16-bit offset (IX2), the result of the X- register contents added to the concatenated contents of the two bytes following the opcode is the EA. RELATIVE (REL) The EA of a relative mode instruction depends upon whether or not the branch is taken. If a branch is taken, EA is formed by adding the byte following the opcode to the value of the program counter, and the program counter is loaded with the EA. If no branch is required, EA is equal to the contents of the program counter. BIT SET/CLEAR (BSC) The EA of a Bit SetiClear mode instruction is contained in the byte following the opcode. The actual bit which is to be set or cleared is contained in the lower four bits (nibble) of the opcode. BIT TEST AND BRANCH (BTB) This addressing mode combines direct, relative and bit addressing. The EA of this instruction is the contents of the byte following the opcode (direct mode), if no branch is taken. If a branch is taken, the EA becomes the result of the second byte following the opcode being added to the value of the program counter (similar to relative mode). The actual bit which is to be tested is contained in the lower four bits (nib- ble) of the opcode. INHERENT (INH) This addressing mode has no EA since all information nec- essary to carry out the instruction is contained in the opcode. For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. M68HC05 INSTRUCTION SET The following table is an alphabetical listing of the instruc- tions available to the M68HC05 MCU user. In listing all the factors necessary to program, the table uses the following symbols: Condition Code Symblols H - Half Carry (Bit 4) • - Test and Set if True, I - Interrupt Mask (Bit 3) (Cleared otherwise) N - Negate (Sign Bit 2) - Not Affected Z - Zero (Bit 1) ? - Load CC Reg. from Stack C - Carry/Borrow (Bit 0) O - Cleared 1 - Set Freescale Semiconductor, Inc... Boolean Operators ( ) - Contents of (i.e.) (M) = + - (inclusive) OR means the contents EB - EXCLUSIVE OR of memory location - NOT M - negation • - is loaded with, 'gets' (twos complement) • -AND x - multiplication MPU Registers A - Accumulator PC - Program Counter ACCA - Accumulator PCH - PC High Byte cc - Condition Code Reg. PCL - PC Low Byte X - Index Register SP - Stack Pointer M - Any memory location REL - Relative Address (one byte) Addressing Modes (Abbreviation) Operands Inherent INH none Immediate IMM ii Direct (for bit DIR dd test instructions) dd rr Extended EXT hh II Indexed O Offset IX none Indexed 1-Byte IX1 ff Indexed 2-Byte IX2 ee ff Rilative REL rr For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc... INSTRUCTIONS, ADDRESSING MODES, AND EXECUTION TIMES Addressing Machine Coding Source Boolean Operation Mode for (hexadecimal1 Bytes Cycles Condition Code Form(s) Expression Operand Opcode Operand H I N z C Freescale Semiconductor, Inc. • •.. • • For More Information On This Product, ADC (opr) Add with Carry ACCA. ACCA+ M -t C IMM A9 ii 2 2 - DIR 89 dd 2 3 EXT C9 hh II 3 4 IX2 D9 ee ff 3 5 IX1 E9 ff 2 4 IX F9 1 3 ADD (opr) Add ACCA • ACCA + M • ••• - Go to: www.freescale.com IMM AB ii 2 2 DIR BB dd 2 3 EXT CB hh II 3 4 ! IX2 DB ee ff 3 5 IX1 EB ff 2 4 IX FB 1 3 AND (opr) Logical AND ACCA • ACCA • M 1MM DIR EXT A4 84 C4 ii dd hh II 2 2 3 2 3 4 - - •• - IX2 D4 ee ff 3 5 IX1 E4 ff 2 4 IX F4 1 3 Freescale Semiconductor, Inc... ASL (opr) ASLA Arithmetic Shift Left - DIR INH(A) 38 48 dd 2 1 5 3 - - .• .• • ASLX □ •1111111 I I• 0 INH(X) 58 1 3 Freescale Semiconductor, Inc. ASL (opr) IX1 68 ff 2 6 For More Information On This Product, C b7 b0 ASL (opr) IX 78 1 5 ASR (opr) ASRA ASRX Arithmetic Shift Right qi 111111 I•□ DIR l'NH(A) INH(X) 37 47 57 dd 2 1 1 5 3 3 - - ••• ASR (opr) b7 b0 C IX1 67 ff 2 6 ASR (opr) IX 77 1 5 Go to: www.freescale.com BCC (rel) Branch if Carry Clear ? Cc-=0 REL 24 rr 2 3 - - - - - BCLR n, (opr) Clear Bit n in Memory Mn•0 DIR(b0) 11 dd 2 5 - - - - - DIR(b1) 13 dd 2 5 DIR(b2) 15 dd 2 5 DIR(b3) 17 dd 2 5 D1R(b4) 19 dd 2 5 DtR(b5) l'B dd 2 5 DIR(b6) 1D dd 2 5 DIR(b7) 1F dd 2 5 BCS (rel) Branch if Carry Set ?C -=1 0 REL 25 rr 2 3 - - - - - BEO (rel, Branch if Equal ?2=1 REL 27 rr 2 l - - - - - Freescale Semiconductor, Inc... Addressing Machine Coding Source Boolean (hexadecimal) Condition Code Operation Mode for Bytes Cycles Form(s) Expression Operand Opcode Operand H I N z C BHCC (rel) Branch if Haff Carry Clear ?H=0 REL 28 rr 2 3 - - - - - Freescale Semiconductor, Inc. For More Information On This Product, BHCS (rel) Branch if Half Carry Set ? H= 1 REL 29 rr 2 3 - - - - - BHI (rel) Branch if Higher ? (C+Z)=0 REL 22 rr 2 3 - - - - - BHS (rel) Branch if Higher or Same ?C=0 REL 24 rr 2 3 - - - - - BIH (rel) Branch if IRO Pin is High ? IRO Pin= 1 REL 2F rr 2 3 - - - - - BIL (rel) Branch if IRO Pin is Low ? IRO Pin=0 REL 2E rr 2 3 - - - - - •• Go to: www.freescale.com BIT (rel) Bit Test Memory with A ACCA • M IMM A5 ii 2 2 - - - DIR B5 ctd 2 3 EXT C5 hh II 3 4 IX2 D5 ee ff 3 5 IX1 E5 ff 2 4 IX F5 1 3 BLO (rel) Branch if Lower ? C= 1 REL 25 rr 2 3 - - - - - BLS (rel) Branch if Lower or Same ?(C+>O=1 REL 23 rr 2 3 - - - - - BMC (rel) Branch if I Bit is Clear ? !=0 REL 2C rr 2 3 - - - - - Freescale Semiconductor, Inc... BMI (rel) Branch if Minus ?N=1 REL 2B rr 2 3 - - - - - BMS (rel) Branch if I Bit is Set ? I= 1 REL 2D rr 2 3 - - - - - BNE (rel) Branch if Not Equal ?Z=O REL 2'6 rr 2 3 - - - - - REL 2A rr 2 3 - - - - - Freescale Semiconductor, Inc. BPL (rel) Branch if Plus ? N=O For More Information On This Product, BRA (rel) Branch Always ? 1= 1 REL 20 rr 2 3 - - - - - BRCLR n, (opr) (rel) Branch if Bit n of M = 0 ? Bit n of M =0 DIR('bO') DIR(b1) DIR(b2) 01 03 05 dd dd dd rr rr rr 3 3 3 5 5 5 - - - - • D1'R(b3) 07 dd rr 3 5 DIR(b4) 09 dd rr 3 5 dd Go to: www.freescale.com DIR(b5) OB rr 3 5 DIR(b6) OD dd rr 3 5 DIR(b7) OF dd rr 3 5 BRM {rel) Branch Never ? 1 =0 REL 21 rr 2 3 - - - - - BRSET n, (opr) (rel) Branch if Bit n of M = 1 ? Bit n of M = 1 DIR(bO) DIR(b1) DIR(b2) 00 02 04 dd dd dd rr rr rr 3 3 3 ' 5 5 5 - - - - • DIR(b3) 06 dd rr 3 i 5 '. DIR(b4) 08 dd rr 3 5 DUltb5) OA 'dd rr 3 5 DJR(b6) oc dd rr 3 5 DIR(b7} OE dd rr 3 5 Freescale Semiconductor, Inc... Addressing Machine Coding Source Boolean (hexadecimal) Condition Code Operation Mode for Bytes Cycles Form(s) Expression Operand Opcode Operand H I N z C BSET n, (opr) Set Bit n in Memory Mn.1 DIR(b0) 10 dd 2 5 - - - - - Freescale Semiconductor, Inc. DIH(b1) 12 dd 2 5 For More Information On This Product, DIR(b2) 14 dd 2 5 DIR(b3) 16 dd 2 5 ' DIR(b4) 18 dd 2 5 DIR(b5) 1A dd 2 5 DIR(b6) 1C dd 2 5 DIR(b7) 1E dd 2 5 Go to: www.freescale.com BSR (ref') Branch to Subroutine PC • PC+ 0002 REL AD rr 2 6 - - - - - (SP) • PCL; SP • SP - 0001 (SP) • PCH; SP. SP-0001 l'C. PC+ Rel .. CLC Clear C Bit C bit. 0 INH 98 1 2 - - - - 0 CLI Clear I Bit I bit. 0 INH 9A 1 2 - 0 - - - CLR (opr) Clear M. 00 DIR 3F dd 2 5 - - 0 1 - CLRA A. 00 INH(A) 4F 1 3 CLRX X. 00 INH(X) 5F 1 3 CLR (opr) M •oo IX1 6F ff 2 i CLR (opr) M. 00 IX 7F 1 5 Freescale Semiconductor, Inc... CMP (opr) Compare A with Memory ACCA-M IMM DIR EXT A1 B1 C1 ii dd hh II 2 2 3 2 3 4 - - ••• Freescale Semiconductor, Inc. IX2 D1 ee ff 3 5 For More Information On This Product, IX1 E1 ff 2 4 IX F1 1 3 COM (opr) COMA COMX 1's Complement M. M=$FF-M A. A=$FF-A X ..X=$FF-X DIR INH(A) INH(X) 33 43 53 dd 2 1 1 5 3 3 - - •• 1 COM (opr) M. M=$FF-M IX1 63 ff 2 6 Go to: www.freescale.com COM (opr) M. M=$FF-M IX 73 1 5 CPX (opr) Compare X with Memory X-M IMM DIR EXT A3 B3 C3 ii dd hh II 2 2 3 2 3 4 - - ••• IX2 D3 ee ff 3 5 IX1 E3 ff 2 4 IX F3 1 3 DEC (opr) DECA DECX Decrement DEX (same as DECX) M. M-01 A. A-01 X. X-01 DIR INH(A) INH(X) 3A 4A 5A dd 2 1 1 5 3 3 - - ••- DEC (opr) M. M-01 IX1 6A ff 2 6 DEC (opr) M. M-01 IX 7A 1 5 Freescale Semiconductor, Inc... Addressing Machine Coding Source Boolean (hexadecimal) Condition Code Operation Mode for Bytes Cycles Form(s) Expression Operand Opcode Operand H J N z C EOR (opr) Exclusive OR A with Memory ACCA • ACCA EB M TM'M A8 ii 2 2 - - ••- Freescale Semiconductor, Inc. DIR B8 dd 2 3 ca For More Information On This Product, EXT hh II 3 4 IX2 D8 ee ff :3 ' 5 IXl E8 ff 2 4 IX F8 1 3 INC (opr) INCA INCX Increment INX (same as INCX) M. M+0l A. A+0l X. X+0l i DIR INH(A) INH(X) 3C 4C 5C dd 2 ' 1 1 5 3 3 - - •• - INC (opr M. M+0l IXl 6C ff 2 6- Go to: www.freescale.com INC (opr) M. M+0l IX 7C 1 5 JMP (opr) Jump PC • effective address DIR BC dd 2 2 - - - - - EXT cc hh II 3 3 IX2 DC ee ff 3 4 IXl EC ff 2 3 IX FC 1 2 JSR (opr) Jump to Subroutine PC• PC+n (n= 1, 2, or 3) DIR BD dd 2 5 - - - - - (SP) • PCL; SP • SP- 0001 EXT CD hh II 3 6 (SP) • PCH; SP. SP-0001 IX2 DD ee ff 3 7 PC• effective address IXl ED ff 2 6 IX FD 1 5 Addressing Machine Coding Source Boolean (hexadecimal) Operation Mode for Bytes Cycles Condition Code Form(s) Expression Operand Opcode Operand I N z C Freescale Semiconductor, Inc. H For More Information On This Product, NEG (opr) NEGA NEGX Negates (2's Complement) Mt -M (i.e. 00-M) At -A X t -X DIR INH(A) INH(X) 30 40 50 dd 2 1 1 5 3 3 - - •• • •• NEG (opr) Mf-M IX1 60 ff 2 6 NEG (opr Mf -M IX 70 1 5 NOP No Operation INH 9D 1 2 - - - - - Go to: www.freescale.com ORA (opr) •• •• Inclusive OR ACCA f ACCA + M IMM AA II 2 2 - - - DIR BA dd 2 3 EXT CA hh II 3 4 IX2 DA ee ff 3 5 IX1 EA ff 2 4 IX FA 1 3 ROL (opr) ROLA ROLX Rotate Left through Carry □ •111111111• □ DIR INH(A) INH(X) 39 49 59 dd 2 1 1 5 3 3 - - • • •• ROL fopr) C b7 b0 C IX1 69 ff 2 6 ROL (opr IX 79 1 5 Freescale Semiconductor, Inc... LDA (opr) Load A from Memory ACCA. M IMM DTR AG 86 II dd 2 2 2 3 - - ..• .• - EXT C6 hh II 3 4 Freescale Semiconductor, Inc. IX2 D6 ee ff 3 5 For More Information On This Product, IX1 E6 ff 2 4 LDX (opr) . Load X from Memory X.M LX IMM DrR F6 AE BE ii dd 1 2 2 3 2 3 - - .• •. - EXT CE hh II 3 4 IX2 DE ee ff 3 5 IX1 EE ff 2 4 Go to: www.freescale.com LSL (ap,r) LSLA Logical Shift Left IX DlR INH(A) FE 38 48 dd 1 2 1 3 5 3 - - ..• • .• LSLX □ •1 I I I II I II • 0 iNH(X) 58 1 3 LSt (opr) C b7 bO rxr 6B ff 2 6 LSt fopr) LSR (opr) lSRA Logical Shift Right IX DIR INH(A) 78 34 44 dd 1 2 1 5 5 3 - - 0 .• .• 1 lSRX LSR (opr) 0• I I I I 11 111• □ LN!-t(X) fXl 54 64 ff 2 3 6 b7 bO C LSR(opd IX 74 1 5 MUL Unsigned Multiply X:A. X•A INH 42 1 11 0 - - - 0 Freescale Semiconductor, Inc... Freescale Semiconductor, Inc... R0R (opr) RORA Rotate Right through Carry DIR INH(A) 36 46 dd 2 1 5 3 - - ••• R0RX □ •I 11111111• □ INH(X) 56 1 3 Freescale Semiconductor, Inc. R0R (opr) C b7 bO C IX1 66 ff 2 6 For More Information On This Product, ROR (opr) IX 76 1 5 RSP Reset Stack Pointer SP t $00FF lNH 9C 1 2 - - - - - RTI Return from Interrupt SP t SP+0001; CC t (SP INH 80 1 9 (Loaded from Stack) SP tSP + 0001; ACCAt (SP) SP t SP+ 0001; X t (SP) SP t SP+ 0001; PCH t (SP) ••••• Go to: www.freescale.com SP t SP+0001; PCL t (SP RTS Return from Subroutine SP t SP+ 00tl1; PCH t (SP) INH 81 1 6 - - - - - SP t SP+ 0001; PCL t (SP) SBC (opr) Subtract with Carry ACCA t ACCA- M · C IMM D1R EXT A2 82 C2 ii dd hh II 2 2 3 2 3 4 - - ••• IX2 D2 ee ff 3 5 IX1 E2 ff 2 4 IX F2 1 3 SEC Set C Bit C bit t 1 INH 99 1 2 - - - - 1 SEI Set I Bit I bit t 1 INH 98 1 2 - 1 - - - Freescale Semiconductor, Inc... Addressing Machine Coding Source Boolean (hexadecimal) Condition Code Operation Mode for Bytes Cycles Form(sl Expression Operand Opcode Operand H I N z C STA (opr) Store A in Memory M. ACCA DIR 87 dd 2 4 - - •• • - Freescale Semiconductor, Inc. EXT C7 hh u 3 5 For More Information On This Product, IX2 D7 ee ff 3 6 IX1 E7 ff 2 5 IX F7 1 4 STOP Enable IRO, Stop Oscillator INH 8E 1 2 - 0 - - - STX (opr) Store X in Memory 1 M.X DIR EXT BF CF dd hh II 2 3 4 5 - - •• • 0 Go to: www.freescale.com IX2 DF ee ff 3 6 IX1 EF ff 2 5 IX FF 1 4 SUB (opr) Subtract ACCA • ACCA - M IM'M DIR EXT AO BO co ii dd hh II 2 2 J 2 3 4 - - • •• •• IX2 DO ee ff 3 5 IX1 EO ff 2 4 IX FO 1 3 Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. For More Information On This Product, SWI Software Interrupt PC. PC+ 0001 INH 83 1 10 - 1 - - - (SP) • PCL; SP • SP 0001 (SP) • PCH; SP. SP 0001 (SP). X; SP• SP 0001 (SP) • ACCA; SP • SP 0001 (SP). CC; SP. SP 0001 Go to: www.freescale.com I bit. 1 PCH • n - 0003 (vector PCL • n ~ 0002 fetch) TAX Transfer A to X X. ACCA 'INH 97 1 2 - - - - - TST (opr) TSTA TSTX Test for Negative or Zero M--0 DIR INH(A) INH(X) 3D 4D 5D dd 2 1 1 4 3 3 - - • •• 0 TST (opr) IX1 6D ff 2 5 TST (opr) IX ' 7D 1 4 TXA Transfer X to A ACCA. X INH 9F 1 2 - - - - - WAIT Enable Interrupts, Halt CPU INH SF 1 2 - 0 - - - Freescale Semiconductor, Inc. MC88HC05C4/C8 MC68HCL05C4/C8 AND MC68HSC05C4/C8 MC68HC705C8 PIN ASSIGNMENTS 40-PIN DUAL-IN-LINE PACKAGE RESET 1 40 Voo IRQ 2 39 OSCl *NC 3 38 OSC2 PA7 4 37 TCAP PA6 5 36 PD7 PA5 6 35 TCMP PA4 7 34 PD5/SS Freescale Semiconductor, Inc... PA3 8 33 PD4/SCK PA2 9 32 PD3/MOSI PAI 10 31 PD2/MISO PAO 11 30 PDl/TDO PBO 12 29 PDO/RDI PBl 13 28 PCO PB2 14 27 PCl PB3 15 26 PC2 PB4 16 25 PC3 PB5 17 24 PC4 PB6 18 23 PC5 PB7 19 22 PC6 Vss 20 21 PC7 44-LEAD PLCC PACKAGE ..... u "' 0 N u en 0 a.. u z ,~ Ii g u u > Cl) 0 N Cl) 0 Q. <( u I- u 2 6 0 40 PA5 39 P07 PA4 TCMP PA3 P05/SS PA2 P04/SCK PAI PD3/MOSI PAO 12 34 PD2/MISO PBO POI/TOO PB! PDO/RDI PB2 PCO PB3 PCl PB4 17 29 PC2 18 23 28 u U") g u u 0.... u:, ,_ N ,_ 2 STX DC2 II 2 B R b r CJ) 3 4 ETX EQT DC3 DC4 # $ 3 4 C D s T C d s t -nn u Go to: www.freescale.com 5 ENO NAK % 5 E e u :r:: 6 ACK SYN &, 6 F V f V )> 7 BEL ETB 7 G w g w ::c -I 8 BS CAN ( 8 H X h X 9 HT EM ) 9 I y I y A LF SUB * .. . J z J z B VT ESC + I K [ k { C FF FS I < L \ I I D CR GS - - M ] m } E so RS . > N I\ n - F SI us I ? 0 - 0 DEL Freescale Semiconductor, Inc. HEX/DEC CONVERSION HEXADECIMAL AND DECIMAL CONVERSION How to use: Conversion to Decimal: Find the decimal weights for corresponding hexadecimal characters beginning with the least significant character. The sum of the decimal weights is the decimal value of the hexadecimal number. Conversion to Hexadecimal: Find the highest decimal value in the table which is lower than or equal to the decimal number to be converted. The corresponding hexadecimal character is the most significant. Subtract the decimal value found from the decimal Freescale Semiconductor, Inc... number to be converted. With the difference repeat the process to find subsequent hexadecimal characters. 0 .- N M "¢ !!) (0 r-- 00 (J') 0 .- N M "¢ LO ~ 0 0 -.:-- -.:-- -.:-- -.:-- -.:-- -.:-- .. ca .s:: (J )( Cl) O .- N M LO (0 r-- CX) (J') <{ CC U O LU LL ...> Cl) M :::c "¢ a:i '<:t' u Q Cl) o~~~cZ~~:=~J~~~~~~ .. ca .c (J )( Cl) 0 .- N M V LO (0 r-- 00 C'> <{ CO U O W LL ..... ..... :::c 00 co u 0 (0 N 00 V O (0 N 00 "¢ 0 (0 N CX) V 0 Cl) LO .- t0 N CX) M C') V O t0 .- r-- N 00 V Q N LO r-- 0 N LO r-- 0 M LO 00 0 M LO CX) ~~~~NNNNMMMM ...... :::c Cl) )( Cl) 0 .- N M v LO (0 r-- CX) C'> <{ CO U O W LL >- a:i ... N Q u Cl) 0(0NCX)"¢0(0NCX)"¢0(0NCX)"¢0 C') (J') N CX) 00 r-- r-- (0 (0 (0 LO LO V V V O.-NM"¢LO(Or--OO(J')O.-NM"¢ o:iooN