:L I : . MC68HC05i8 rrA3 P & *0+’ ADVANCE INFORMATION MOTOROLA @ TMs document contiins inforfi~tiorihn a new product Specifications and information herein are subjeti to change without notice. .! .,1.:.$ .\\, >. . ..>,+.. ,.:$ ‘~f~ -:t, -, ,>.i\..! **~ \ ..,k.. Motorola re~,~ W right to make changes without further notice to any products herein to improve refiabitity, function or design. Motorola ,: \... ~ does n~t%@e any habili~ arising out of the app~mtion or use of any wodwt or circuit descti~d herein; neither does it convey any ~cense ,.!- ~~s.\,],\ .,. under~~~nt rights nor tb (ghts of othe~. Motorola prduck are not designed, intenkd, or authwbed for use as components in systems ,$; \ ... .:,>.. ~X&d ... ?0 rsurgiml implant into the bdy, orotherapplicatbns intended to suppotiorsusmin life, or for any other application in which the failure p: ,::,$,%q~J& ‘bOtOrQla product CoUti Create a situatbn where pemoml injuv or death m~ uur. Should Buyer purchase w use Motorola produck ‘+;~~’:t.ibrany such unintended or unauthodzed appfl-tion, Buyershallindemni fyand hold Motoro!aand its of fcers, employees, subsidiati=, affiliates, ‘.:?, . . .’s~i. \.L ..<$,~ ati disttihtors harmless against all claims, ws~, damages, and expenses, and rmsonable anornay fees arising out of, directly or indirectv, ?19 ~J, any claim of pe=onal inju~ or death asswia ted with such uninte~ed orunauthotized use, even if such claim alleges that Motorola was negbgent regarding the design N manufacture of tie pam Motorola and @ are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal OpNnunity/Affirmative Actbn Employer. Table of Contents Paragraph Page Number Wtle NumQer — 1.1 1.2 2.1 2.2 2.2.1 2.2.2 2.2.3 2.3 2.4 2.5 2.5.1 2.5.2 2.5.3 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.7 MC68HC05i8 Table of Contents (Continued) Paragraph Number Title RESETS, INTERRUPTS AND LOW POWER MODES MC68HC05i8 MOTOROW ill Table of Contents (Continued) Table of Contents (Concluded) Paragraph Number 10.4.2 10.4.3 10.4.4 10.4.5 10.4.6 ...... ............................................................ 12-3 MC68HC05i8 MOTORO~ vii List of Figures Figure Page Number ~tle NumQpr 1-1 2-1 2-2 3-1 3-2 4-1 4-2 4-3 5-1 6-1 6-2 7-1 7-2 7-3 74 7-5 8-1 9-1 9-2 9-3 9-4 9-5 9-6 9-7 10-1 10-2 10-3 104 MC68HC05i8 MOTOROW ix MC68HC05i8 List of Tables Table Page Number ~tle Num~r 11-4 AC Electrical Ck~&#~stics ., 11-5 Read Cyclel~,@~~~ing ..... ... 11-6 Wtite Cyclq+B*~’’tmin{ 12-1 64-pin ~~~:~lmension: MOTOROU xi .:<* ,,.. ~:..u m.,..,-., t ?}$., ~’,+$< ‘. ,,.\\:> >.,+,$. ~.. SECTION 1 !: $~ *1 INTRODUCTION i:,.y,, \,:> :~<,?.;>+~ ~.>l+, .. . +i,?h”$ ~.)* ‘:? ,.\:h,..>$* ..$’, . Y ~ $s.m\:* The MC68HC05i8, with on-board M68000 interface module, is designed a~u’~d ‘the industry standard M68H C05 CPU core. The M68000 interface module allows e[~~{$t~nt=commun ication between an M68000 family processor (the Host) and an MC68HC05J8~R~ WCU) serving as a peripheral device. The transfer of data is managed via an 8-bit data by$$~d a set of seven control and eight data registers. Information is held in the data registers i#:~~$age FIFO buffers that can be accessed by both the M68000 processor and the MC68HQj$I~. dther features of the device include a 16-bit programmable timer, a multi-purpose :#&&:’timer, two independent Serial Communications Interface (SCI) modules and a Comp~~#Qperating properiy (Cop) watchdog timer, The MC68HC05i8 is available in a 64-pin QFP<~ack@e. ~.:$,.. “,..tl:~ ., ~.~\! .. ‘\\ ~i> ,,, , :$./t ~‘1. ~ :.t~~;~ .~,~~~r,’ ..+.t.x.. 1.1 FEATURES .!,:$), ,.;.s -,.,* ~. ● Industry standard M68HC05 cor$:~~,instruction set . , *:~.“$:s, ● On-chip oscillator with divid~Q}~d or 8 mask option +!::$.3;:. .:}.,l,,,:,, ● 7936 b~es of user ROQ$3;~,:, “$~:t. ‘*’\+l,.” ● 224 bytes of RAM,,fl.,’t:,2$ ● Power saving $T~,&-~;d WAIT modes .-, ‘o.,\\\.,:, ● M68000 imt{~~e’module with 8-bit data bus, 4 register select lines and 4 control lines ..’~ ? ● 16-bi~&mmable timer with two Input Captures and one Output Compare # !y,,. ● ~#~&rpose Core Tmer with Computer Operating Properly (COP) watchdog and Real Tme ,&&,.fi\$~*rrupt(RTI) ..<>*,! J%~d+tid & .$:.,+. Two independent, full duplex SCI subsystems each with its own Baud Rate Generator ,;~q,:.- ~t+,,, .ktl;> programmable to 32 different rates $y{$,ie ~J: ~J :.. ● Receiver wake-up function for use in multi-receiver systems ● Mask option selection for interrupt sensitiviw, oscillator division ratio, COP enable/disable and STOP enable/disable * Temperature range: 0-70 “C ● 64-pin Quad Flat Pack (QFP) package MC68HC05i8 INTRODUCTION MOTOROW 1-1 Osc 1 OSC2 User V**S 16 byhs Oscilbt.r end User ROM RAM COP Watch&g dNtie by 7936 Bytes 224 8yti$ Syslem 2,40r B PFo — PF1 — Port F oat, tir I I ., 1 r~ = RESH *:A~:~,.,;,.:,}~, Reg Reg ,, W1 ,, ~ s~,, W2 $’” ,.:,> ’.’ oat. Poe PC+ f ,,: PBO — Accumuh~r . ‘ ‘,’ ‘ CPU fir c PBI — ContrOl ,:, ,:g~~’” Reg Reg PB2 — Port Data Indm PB3 — B Dir Register ~ W7’” PB4 — ., ., \ . ..,,,:%$ Reg Reg .?,.*.. I*,’ PB5 — Poo . ‘ 4\ x PB6 - Cond(f ion C.de Po 1 :.. ~,.,{+ PB7 — Register ,,, ,. ., Mu ,,i~q :k ~ PAO — PA1 — Stack POinter ,;,, . . P05 Pm — ,$,:1:,:,,$’ ‘ “9 Port Oata P06 P* — ;.< A mr l~~:?:: ,k::.}., PD7 PM — Program Counter‘ H,gh .: ~~ , B- .,.. Re9 Reg Pm — PA6. — <$ ~$:,,,,, PE1~l ,, . ,.. .,.., ., ., PA7 — Pr.giarn Co””ter LOW ‘Lu ;: ..$>i,:< i:.\. PE2~2 .: ,., ,.’ ,, ,7 s ,.. , Data Port PE3~ ‘lRo68K’— ,,, D, -: .‘.’.., ~.,:,.,:. E PE4flcM”P RS4 — ~$:: ,,*J, ,, Reg Reg PE5flcAPA RS3 — ,., ~ *t:: M68~ .1, PE6flcAPB RS2 — l“!erfam A B PE7LLK6BK “-’” RS1 — Module I Fs — RWaK — core 7imer 1&tit 1*TI tiatwn. C.mmunkation, =K— Inierf..e 1 ttttttttt ‘RODUCTION MC68HC05i8 Allsignal inputs onthe MC68HC05i8 except RESET and OSCl are TTLcompatible. — MC68HC05i8 FUNCTIONAL PIN DESCRIPTION MOTOROLA 2-1 2.1 VDD AND VSS Power is supplied to the microcomputer via these two pins. VDD is the positive supply and VSS is ground. It is in the nature of CMOS designs that vev fast signal transitions occur on the MCU pins. These short rise and fall times place very high short-duration ,current demands on the power SUPPIY::~)~ To prevent noise problems, special care must be taken to provide good power supply by-pas~ti$~ at the MCU. By-pass capacitors should have good high-frequency characteristics and be as,.~~$$ “ to the MCU as possible. By-passing requirements vary, depending on how heavily the ~~$&ns ,,,\}?* , ,.<8,.$ ,.,$ are loaded. ..- !:,,,,,.. ,,~*,$,,,~,..,1’ ~J\.~ *.;?,‘f.~.$,~ ..> ..3, .,k\,$ ,Ti.. ,,. b %:.\h$+, $,~s~.,,:$$ ,%t ,y 2.2 Oscl/osc2 .,,3$:. :$. ,.*. .!,, ,,,, ,!.‘.\. \ .,,.>, ~t!i’>.i:,! ‘‘*\*\\ These pins provide control input for an on-chip clock oscillator circ@~$A c~stal, ceramic resonator ~3$,.’ ?.W%t or external clock signal connected to these pins provides l@ei,Q’&clllator clock. The oscillator frequency (fo~c) is divided by 2, 4 or 8, chosen via a ma~:$~~dn, to provide the internal bus frequency (fop). “$.$.* “.$. ~ .,?. .’”*::. ~<, ., S..?* .?.+. $ ~t:., .,: ..$., ‘3]$/ ,J 2.2.1 Crystal . ,.. , ‘~;s.. .,?.~ ,,,34. ~+,.: *..$ ‘ The circuit shown in Figure 2-2(b) is recox,ended when using a crystal. The internal oscillator is designed to interface with an AT-cut ,@@Je~resonant quartz crystal resonator in the frequency range specified for’fosc (refer to ~~@@ 11.4 AC Electrical Characteristics). Use of an external CMOS oscillator is recomrnend~$@ crystals outside the specified ranges are to be used. The cvstai and components shqu$~~,wmounted as close as possible to the input pins to minimise output distotiion and staQwi~R~bilisation time. ‘.*,,, >\,.*& ,. ,*.2 ., ,* .*.. ... ,$* .>?!, *- >:. ‘,$.:,, ):... 2.2.2 Cerq~7&+@&sonator ..:?,,.* ,J}, “!tyt,:”t.!]. A cerami~~~~nator may be used instead of the crystal in cost-sensitive applications. The circuit in Figqr#t~2(b) is recommended when using a ceramic resonator: The manufacturer of the ~lti~ pa~$?tilpg.ceramic resonator being considered should be consulted for specific information. t.... ‘i$y+.i+:’ ,..,* ,~,,”::.,;.,k... ~~:i ., ‘~$?+.~ K+:~.2.3 External Clock An external clock should be applied to the “OSCI input with the OSC2 pin not connected, as shown in Figure 2-2(d). The toxovspecification does not apply when using an external clock input. The equivalent specification of the external clock source should be:used in lieu of toxov MOTOROU FUNCTIONAL PIN DESCRIPTION MC68HC05i8 2-2 c~stsl Ceramic Resonator ~- 1 I t ,.,., ,.. . Q 30k 40k — Q 1250$’’;” ~V$: — t I I ,.,.. ,...., $,,..),, I MCU I It Crystal Circuit I MCU I ~~%~~$~oa known start-up state. An external RC-circuit can be connected to this pinto generate ,~$,~,x,~s~er-on reset (POR) if required. In this case, the time constant must be great enough f+.,~{mlnimum 100 ms) to allow the oscillator circuit to stabilise. This input has an internal Schmitt = is an input pin for external interrupt sources. The interrupt trigger sensitivi~ (edge or edge-and-level) can be selected via a mask option. The ~ pin has an internal Schmitt trigger to improve noise immunity. MC68HC05i8 FUNCTIONAL PIN DESCRIPTION MOTOROLA 2-3 Host and the MC68HC05i8 ,, 2.6.3 RS1-RS4 . . . The register select lines select the MCU internal registers during read/wtite operations. .,<... ..’, 2.7.2 TCAPA, TCAPB When configured to support the 16-bit timer, Port E bits 5 and 6 sewe as the input pins for the timer input capture functions. MC68HC05i8 FUNCTldNAL PIN DESCRIPTION ‘MOTOR~ti 2:5 *[ Program Counter N[ Stack Pointer I INIZI:I Condition Code Register Cary / Borrow Zero figure 3-I Programming Model 7 0 ,? Condition Code Register I Increasing ~ Accumulator Decreasing Memoy 5 Memoy Address m Address Unstack figure 3-2 Stacking Order MC68HC05i8 CPU CORE AND INSTRUCTION SET MOTOROU 3-1 3.1.5.2 Interrupt (1) .,.~.~~$,” .,, +,<$p$~$~ollowing paragraphs briefly explain each type. All the instructions within a given type are “l$$~esented in individual tables, *a:.\~,, .,* :> s>.>,. ‘;< This MCU uses all the instructions available in the Ml 46805 CMOS Family plus one more: the unsigned multiply (MUL) instruction. This instruction allows unsigned multiplication of the contents of the accumulator (A) and the index register (X). The high-order product is then stored in the index register, and the low-order product is stored in the accumulator. A detailed definition of the MUL instruction is shown in Table 3-1. MC68HC05i8 CPU CORE AND INSTRUCTION SET MOTOROLA 3-3 3.2.1 Register/Memo~ instructions “.., ,, Most of these instructions use two operands. The first operand is either the accumulator or the index register. The second operand is obtained from memory using one of the addressing modes. The jump unconditional (JMP) and jump to subroutine (JSR) instructions have no register operand. Refer to Table 3-2 for a complete list of register/memo~ instructions, ,. s>,\ :.t.:p,. ;,,$? ,,,,..‘S,,t. ,:,.*.rK>:~ ,’ ,., ., *i . ..:.,: .)/*\4t,,$”,’ 3.2.2 Branch Instructions” ,,++sf,: ,},,, ~‘ .\*.:J, ,$ , ‘;ix$s, ,~.\.’ ,~,},,~.,, These instructions cause the program to branch if a particular condition is met;..@t~~:@~se, no operation is performed. Branch instructions are two-byte instructions. Refer to ~a~~?$-3. %$> >,$\ ‘,Iy, ,.“~i\>j,\i\ ,,- ,,, , .:.)-\ p .,;: ~ ~~~ *.> :;:},? ~?:,.-’8:**..! 3.2.3 BitManipulation Instructions S:*\\. . ..,,*,. >* .,,. ,>,. Indexed Indexed Indexed ~ ~*&dA (abt E ~reti (No (16-bfi Offset) Offset) I Function I Load A from MemoN ~d Memory to A lJumD to Subroutine MC68HC05i8 CPU CORE AND INSTRUCTION SET MOTOROM 3-5 .:, ,.. :. ,, Relative Addressing Mode # .# Funstion’ Mnemonic Opcode B~es Cycles Branch Always ‘‘ ‘, ; BRA 20 2 3 .’>. Branch Never ~~+’,<’~i, BRN 21 2 3 ,,., ,. “ ., Dul ~~ ~ Branch if ‘:-L-- Branch if Branch if Ilulatl-1, —. ,— \. —.-:+,,J, - Branch if Minus BMI :, %$$B “ : ; ; Branch if Interrupt Mask Bit is Clear B~~:%+ .2C” 2“ 3 : Branch if Interrupt Mask Bit is Set ,ip*sy 2D, “2 3 n---_L :1 l-._ ...._. , :_. :_ , . ... . .. “’hIW -r . . .. 1 I 1 BIH. ”1-2F I 2’.1 3 I J I 1 J runctlon I Table 3-5 Read/Modi~~rite Instructions ..,ti> .,.., ,.:$ ~’ .‘$t~+. I Inherent Addressing Mode Reset Stack Pointer RSP 9C 1 2 No-Operation NOP 9D 1 2 stop STOP 8E 1 2 Wait WAIT aF 1 2 MC68HC05i8 CPU CORE AND INSTRUCTION SET MOTOROW 3-7 ---- I . -. I lnte~upt v DIR Direct 1X1 Indexed, 1 byte Offset EN Extended 1X2 Indexed, 2 byte Offset N Negate (S!gn Mt) ? Load CCR from Stick INH Inherent RE L Relattie Z Zero O Cleard C Carry/Borow 1 set = N.t,~p,.~~n,ed MOTOROW CPU CORE AND INSTRUCTION SET MC68HC05i8 3-8 Table 3-7(b) instruction Set(20f2) 1 ...- . I Addressing Mlodes - I Condition Codes I Mnemonic .. ... i _________ ,_. __,___ , ._. ..?,..,,. >. .::.: I , -, I :.*..: ,:.:.: Not Affected N Negate (Stgn Bitt ? Load CCR from Stack EN Exten*d IX2 Indexed, 2 byte Offset INH Inherent Z Zero o Cleard REL Relathe C Carry/Borrow 1 Set Implemented MC68HC05i8 CPU CORE AND INSTRUCTION SET MOTOROU 3-9 VZ Table 3-8 ODcode MaD 4 5 6- -7 8 --9- mzl o &:1 Olm 0101 0110 0111 lm 1001 t 3.3 ADDRESSING MODES Ten different addressing modes provide the programmer with the flexibility to optimise his code for all situations. The various indexed addressing modes make it possible to locate data tables, code conversion tables, and scaling tables anywhere in the memory space. Short indexed accesses are single byte instructions; the longest instructions (three bytes) permit acce~~~~~, tables throughout memory. Short absolute (direct) and long absolute (extended) addressin&~j#so included. One or two byte direct addressing instructions access all data byte~~~..,dost applications. Extended addressing permits jump instructions to reach all memoy,l?. ,...+.’ The term “effective address” (EA) is used in describing the various addressin&@2@s. Effective address is defined as the address from which the argument for an instruction .\,i is’~~$hed or stored. The ten addressing modes of the processor are described below. Rq@,h$eses are used to indicate “contents of” the location or register referred to; e.g., (PC) i@~@~{&sthe contents of the location pointed to by the PC (Program Counter). An arrow indicate~~~~placed by~, and a colon indicates concatenation of two bytes. For additional details and.~~ap%~calillustrations, refer to the M6805 HMOS/M146805 CMOS Famity Microcomputer/~.&@hocessor User’s Manual. $< $\ *V*/$’ . ,,$.$::, \~.;,wJ\,. .. “’i),,\, ,> <...~~.~\i.,\, In the immediate a~~~s~ing .’*..”.? mode, the operand is contained in the byte immediately following ,,.>.$>.:, the opcode. The,~k~dlate addressing mode is used to access constants that do not change during program~e~$cution (e.g., a constant used to initialise a loop counter). ,.. ‘,,,.f) *<....:: ~+l.?.i \r~ , (PC+2) ~,J)t;:$,‘, .,, ,,., ,--- .,. ,:. ,,’. ,.$.! ,,,\\\*,: ,,.” -. ~.$3, ,ix.? $., ,: ,“” ,; ,.;>..~,’!ti$ ‘::,, .,:. “/ti,$ *$‘ \>w ‘ ,1>.: 3.3.5 Indexed: No Wset ,.,.~:, if<*,.\<$,, .,” ,......*. *.“~’:<.~,: ‘ In the indexed, no offset addressing mode, the effective address of the a~$~~e%t is contained in the 8-bit index register. This addressing mode can access the first 25@#@ov locations. These instructions are only one byte long. This mode is often used to m~w~ a ~ainter through a Iable, or to hold the address of a frequently referenced RAM or 1/0 loca$w~!$”i ~‘!.,. ,# EA = X PC+ PCt3 <~k”” Address Bus High + O; Addre,$&Bu@Low + X ~. ~~<, ,,::’’1”-... ,, ,; ,, ~~ .~;,.,!!{. “.’i.k, J?.+..;.7 3“!3.6 ~Indexed, 8-&t &set ‘“’ “’ ‘ “%$~$%’:‘ ‘ ““ ,. ,, ,’. ,$:, ,, .,;,. EA=X+,(PC+I); PC+ PC+2. - . A@,~~#Bus High - K; Address Bus Low - X+(PC+I ) ,,:&#e K = the car~yfrom the addition ofX and (PC+I) # <4J ,.- ,,:?.;.. J.’.J.> .:,., ,,$ 3.3.7 .,~dw~, 16-Mt Offset ,\i,, *\?+~ “;>\< ~.:> In t@~~F~ed, 16-bit offset addressing ,mode, the effective address is the sum of the contents ~$~t%~.knsigned .,::.:? ,,<,,~ >, 8-bit index register and the-two unsigned bytes following the opcode. This ,, ad~tess “.*?;;l*,L,.!J mode can be used in a manner similar to indexed, 8-bit offset except that this, three-byte ‘-~tnstruction allows tables to be anywhere in memory. As with direct and extended addressing, the Motorola assembler determines the shortest form of indexed addressing. EA = X+[(PC+I ):(PC+2)];”bC~ PC+3 Address Bus High & (PC+ I )+ K;’Address Bus Low’= X~(PC+2) where K = the carry from the addhion of X and (PC+2) MOTOROLA CPU CORE: AND INSTRUCTION SET ,MC68HC05i8 3-12 3.3.8 Relative The relative addressing mode is only used in branch instructions. In relative addressing, the contents of the 8-bit signed byte (the offset) following the opcode is added to the PC if, and only if, the branch conditions are true. Otherwise, control proceeds to the next instruction. The span of relative addressing is from–126 to +129 from the opcode address. The programmer nee,~.~@t calculate the offset when using the Motorola assembler, since it calculates the proper of{sa$%<~ .,: ...:, ~: checks to see that it is within the span of the branch. -t,\,.!)*,.., ,, ,..i.~f .e,&;:$~ ,,::~.li.~ EA = PC+2+(PC+I ); PC+ EA if branch taken; >,,,,,tit~ ‘J?# ~,! \.j othe~ise EA = PC F PC+2 ,,..,”x%, .? ,f~ ~s$ ‘J>,p\~ b~ j( ,*&,~:,. ‘\.s“ ~! \ \+\*. *~.,.,,, ...>.,.,>}. ,,:. , ~,.,.<,:, 3.3.9 BitSet/Clear -:.:,>,$..$. ,. *’<, y ..%~: ,,~~ .:$ +>.!$ .,.;:!$ In the bit seticlear addressing mode, the bit to be set or clear~, i~~rt of the opcode. The bfie following the opcode specifies the address of the byte in ~,{&~Me specified bit is to be set or cleared. Any readlwrite bit in the first 256 locations of ~~,o,w, including 1/0, can be selectively f~”. .>.. set or cleared with a single two-byte instruction. . ~~~$, .,, EA = (PC+ I )jFF~:&. PC+2 Address Bus High + O;~,~.as Bus Low - (PC+ I ) ......,.~,, ,, x$ ?\yw\t,. >~}, .,.. ..$: 3.3.10 Bit Teat and Branch s$ii% $.:.,, ...\ .>, ,:3,:..,..’:,., :~ f.*\‘Jk,+$ The bit test and branch addr~~m,~mode is a combination of direct addressing and relative addressing. The bit to be ,t~$~$tind its condition (set or clear) is included in the opcode. The address of the byte to ~xt~f@Is in the single byte immediately following the opcode byte (EAI ). The signed relative 8-&R o~~&t in the third byte (EM) is added to the PC if the specified bit is set or cleared in the sw~~~ !.~ memo~ location. This single three-byte instruction allows the program to branch baseQ.@$hd condition of any readable bit in the first 256 locations of memory. The span of branch is. f/&$-l ..?:. 25 to +130 from the o~code address. The state of the tested bit is also transferr$ld~~,he carry bit of the condition code register. .. otherwise PC - PC+3 :$, MC68HC05i8 CPU CORE AND INSTRUCTION SET MOTOROLA 3-13 iND INSTRUCTION SET MC68HC05i8 SECTION 4 A 1 Internal Oata Bus(21 Xxix, New PCH New PCL Invafid data Iix~xxxxxxxyx Op co& , New PCH New PCL Inwfi data , OP code r ‘r 1+,. .x+?!~.1*>,... .,., +,:, ,.,. Rogmm Program executwn execuion begl”s begins ,~v*~~*h+Ae OSC1 fine is not meant to represent frequemy; it is usd to represent time only, “*~$;’’.2. Internal ckk and bus sgnak are not availaMe extwnal~. \.:.**\:\i,i, ,? 3. The first rking edge of the intwnal cl=k after the fising dge of=T initiates the reset sequenm, ‘;:..r. 4. Refer to Electikal Specifimtions %ction for specifk values of timing parameters. $:. tigure 4-1 Power-on Reset and RESET MC68HC05i8 RESETS, INTERRUPTS AND LOW POWER MODES MOTOROM 4-1 4.1.1 Power-on Reset A power-on reset occurs when a positive transition is detected on VDD. The power-n reset function is strictly for power turn-on conditions and should not be used to detect drops in the power supply voltage. The poweran circuit~ provides a stabilisation delay (tPoRL) from when the oscillator becomes active. If the external RESET pin is low at the end of this delay then the ., processor remains in the reset state until =T goes high. he user must ensure that the voltagqjw$ on VDD has tisen to a point where .— the M.CU.can operate properly by the time tPoRL has elap#:e@~~” If there is doubt, the external RESET pin should remain low until the voltage on VDD has~~~~~~ the specified minimum operating voltage. This may be accomplished by connecting,~~~%~rnal RC-circuit to this pinto generate a power-on reset (POR). In this case, the time co~:~~~~:~ust be great enough (at least 100 ms) to allow the oscillator circuit to stabilise. ... *~J*’ ~,,,~,,.~~ ?::.::l- 3+,,:,, ~*,!i~k.y,~, .,. . ,,.7. ,$$ —, . .~k,p.. ,, +iJ,:,;, %\v), .’ 4.1.2 RESET tin ., J?:,> !t.,hf.., ,’$’ ‘.:. ,. ,. .,- Qa ~*\ .,sj\\ ,, . ,~+. ~~.~, When the oscillator is running in a stable state, the MCU is resg~weh a logic zero is appliedto the RESET input for a minimum period of 1.5 machine cycle~,~Gx&)~This pin contains an internal s. Schmitt Trigger as part of its input to improve noise imrnun~~~ ,,-,~,~$, ~ “ .!$-, ..,.,. ‘~4, .“‘ ‘?s \ \jt, .:!: :$,~:.,.F&&i> 4.1.3 Illegal Address Reset ,$+..’.> ;,,,,;~.>., ,’%!>. ,,. .~i~ When an-opcode fetch occurs from an,ad,~,ss%hich is not part of ’the RAM ($0050-$01 2F) or of the ROM ($200 G$3FFF) then the dev~c,~~s’htomatically reset. ,,~ . ,~.., .: ,,‘:k)+> ~’<:!,,,:~, “’~%~ ,’. ~~,.:.i ‘J:t * 4.1.4 Computer Operat@~&$&perly!(COP):Re~t’ ~ .. .; -..,..’ ]~.f,,, ~ r,i’ >**\a\:\.*.*. The MCU contains a waf~~g timer that automatically times out if not reset (cleared) within a ,$:+.*W:$ ,~+> ::~ specific time by”a pro~~a~ reset sequence. If the COP watchdog timer is allowed to time-out, an internal reset is ge$~~&/ed to reset the MCU, Because the internalreset signal is used, the MCU comes out of .@::$O~reset in the same ”operating mode it was in when. the COP time-out was generated. ‘~~$~’$ *;;.*.,J$, The CQ~/&[function is enabled or disabled by a mask option. ~.s,,.u,.~~ .:3.. , I.* ~,:! Ref&r @ section 8.2 for more information on the COP Watchdog timer, ~ ~,t<:ti>..:*X. .,. .~> .:,.,,,\.\~\ !.~ ,,,.,,, ,, .,, :$>,, . ‘~~.,, ,, ,. ‘:,~,~. “~,.$ .!,. ,. ‘,~. ,, MOTOROU RESETS, INTERRUpTS”AND:LOW POWER MODES MC68HC05i8 4-2 4.2 INTERRUPTS The MCU can be interrupted by seven different sources, six maskable hardware interrupts and one non-maskable software interrupt: b External signal on the ~ pin ● 15-stage ripple counter (Core Tmer) 16-bit Programmable Tmer Sell ● SC12 ● IRQ68K ● Software Interrupt instruction (SWI) Interrupts cause the processor to save the register contents,,~~ke stack and to set the interrupt mask (1-bit) to prevent additional interrupts. The RTI instru,c@d~{~eTurn from Interrupt) causes the register contents to be recovered from the stack and ~{~h~~rocessing to resume. .~, Unlike reset, hardware interrupts do not cause the&’~Yent .,* .....*\ instruction execution to be halted, but are considered pending until the current instructiQGn,~~complete. The current instruction is the one +J\. .,, already fetched and being operated on. Wh~T* current instruction is complete, the processor checks all pending hardware interrupts. lf,j,nt8rrupts are not masked (CCR l-bit clear) and the corresponding interrupt enable bit iS::&t, the processor proceeds with interrupt processing; otherwise, the next instruction is f~~the~ and executed. ,,*$.L?.. \,\$\, If both an external interrupt a,~~~~~er interrupt are pending after an instruction execution, the external interrupt is se~ice,$~$~~*. Table 4-1 shows the ~d~&~& priority of all the possible interrupt sources. Figure 4-2 shows the Interrupt Processi~<#~*~ .,?. Register Flags Vtitor Address PrioriW — — $3FFE, $3FFF highest — — $3FFC, $3FFD ‘?&xternal Interrupt (~) — — $3FFA, $3FFB Core Tmer (CTIMER) CTCSR CTOF, RTIF $3FF8, $3FF9 M68000 Intefiace (MEEK) IMR05 RMx, TMx $3FF6, $3FF7 16-bit Timer TSR ICAF ICBF, OCAF, TOF $3FF4, $3FF5 1 Sell SCSR TDRE, TC, RDRF, IDLE, $3FF2, $3FF3 SC12 SCSR OR, NE FE $3 FF0,$3FFI lowest MC68HC05i8 RESETS, INTERRUPTS AND LOW POWER MODES MOTOROM 4-3 4.2.1 Non-Maskable Sofiware Interrupt (SWI) ,. The software interrupt (SWI) is an, executable instruction and a non-maskable interrupt: it is executed regardless of the state of the l-bit in the CCR. If the l-bit ISzero (interrupts, enabled), SWI is executed after interrupts that were pending when the SWI was fetched, but before interrupts generated after the SWI was fetched. The SWI interrupt service’rou~ne address is specified by,, ~A;,,, ;$rp~~i the contents of memory locations $3FFC and $3FFD. .. , f:.! ,~.$~ ~: .t,ty$ *yk:~i:b.+ 4.2.2 Maskable Hardware Interrupts ,,.JX,x’ ~~‘ .(\,,,.,,, y,$,, ..:>... ., ,:,** ~:;:$’,’,,,,. If the interrupt mask bit (l-bit) of the CCR is set, all maskable interrupts (internal a,~w~rnal) are .X*$. ;$ masked. Clearing the l-bit allows interrupt processing to occur. ?), ,..$: \,,? ‘*,..t!.~~, ?:<., :~:,. Note: The internal interrupt latch is cleared in the first part of thelt~~irjpt service routine; therefore, one external interrupt pulse could be latched a*5~5ti’iced as soon as the l-bit is cleared. ‘ - ,. :..)> ,A~*$: .. , >ai~ !,, , >... *\\iki+t . ;,. .?.a$,,;~%+ .,’? .,, ~ .* ‘~~ , ~+*\.*~ ,:.:~ 4.2.2.1 Etiernal “Interrupt(=’) “:<, .+, .:~.~, ,../, ,.,., ~\~ The interrupt request is latched immediately followi~~~d’eelected edge on the ~ pin. It is then synchronized internally and serviced by the routj,~j~~,@se: start address is contained in memory locations $3FFA and $3FFB. Edge sensitiveonly’’&J#tige-and-level sensitive triggering is selected via a mask option. : *,{.. .~:’ ~.;+..:>l, ,,.’ ...i .J!:,,i ,,,:.). . 4.2.2.2 Real Tme and Core ~~t~fiMER) , **.,~.> Interrupts,: ~ -~.,-- !~~:~ .:*8,\”’~~- There are two different core {~*&nterrupt flags that cause a CTIMER interrupt whenever an interrupt is enabled’ and it~<~~$ ~ecomes’ set, namely R“TIF and CTOF. The interrupt flags and enable bits are located ini~@,cTl MER Control and Status Register (CTCSR). These “interrupts will ....$*>V%C: r,,,.~,*’ vector to the sam ., To ~a~~se of the Core Tmer Overflow Interrupt the CTO FE bit must first be set. The CTOF bit +w$~,,j~enbe set when the Core Tmer Counter register overflows from $FF to $00. .$‘*$X .\i.~*:.\$,* ,, :, ~~$, 4.2.2.3 M68000 Interrupt. .1, ,. ,, ,,. ,., ..-. There are eight sources that can cause an M68000 intetiace module interrupt to be,latched. Once latched, the interrupt is synchronized internally and sewiced by the routine whose start address is contained in memory locations $3FF6 and $3FF7. The M68000 interface module interrupt mask bits are held in the Interrupt Mask register at location”$3D. See Section 10 for more details. MOTOROM RESETS, INTERRUPTSAND LOW POWER MODES MC68HC05i8 44 4.2.2.4 Programmable 16-tit Tmer Interrupt There are four sources of interrupt on the 16-bit timer; two Input Captures, one Output Compare and a Tmer Overflow. The interrupt enable bits for these functions are held in the Tmer Control register ($1 C) and the interrupt flags in the Tmer Status register ($1 E). These interrupts will ~~::t~ ‘:$,t,,> ~.,.. ~,, ..... 4.2.2.5 SCI 1 Interrupt .1,.*:,\, ,x,\ -j)\~J ,~, ,,.~ ,\>* ..i.,>,.,~’ ., Serial Communications Interface 1 can generate four types of interrupt; Tra~’~~~&fierrupt (Tl), Transmit Complete Interrupt (TCI), Receiver Interrupt (Rl) and Idle Line Inter~t’~k~). The interrupt enable bits for each of these sources are held in the SCI 1 Control registe~~w}and the status bits in the SCI 1 Status register ($26). All the interrupts are serviced by the,~~~~~j,~ewhose start address is contained in memory locations $3FF2 and $FFF3. ... ‘“3>~ .a..is$:}s.i.i’ ~~, ,,,$~>. ~?*3. , ,,\:t.~,> .>., ,,,, $.\t,,, ,~.-;i:.. , ,\ 4.2.2.6 SC12 Interrupt ,,,f;i ,? ,,4+” ~~‘,.,*, -k,.... Serial Communications Interface 2 can generate f@r tybes of interrupt; Transmit Interrupt (Tl), Transmit Complete Interrupt (TCI), Receiver Inter{-~ ~1) and Idle Line Interrupt (ILI). The interrupt enable bits for each of these sources are hel~.~~~ SC12 Control register ($2D) and the status bits in the SC12 Status register ($2 E). All th~$@@rrupts are sewiced by the routine whose start address is contained in memory Iocatiops QFFO and $3FFI. ,~:’’,-t.i.. :**\ +,\. ‘-’!~> +i$$..i) .\*$,,\\. $,!’i., 4.2.3 Hardware Control~%:f#errupt Sequence $*,,:*1/, Ii::,. ,~’ .:>~:, .,,, +.’3 ~~~,tt ,:: ~~. ..’. The following three fun@~+~?RESET, STOP, and WAIT) are not in the strictest sense interrupts. However, they are a~~d~$pon in a similar manner. Flowcharts for STOP and WAIT are shown in Figure 4-3. ~’(~w >-. .*,:~.$\ ‘<+,>,?, .#’ RESET A,r&set condition causes the program to vector to its starting address, which is ~’.\>.?~ ‘~-conlalned in memory locations $3FFE (MSB) and $3FFF (LSB). The l-bit in the *.:b;,;*”s ~,,,$t ~~;?i~’onditioncode register is also set, to disable interrupts. \.i~’. !...;+, iv,~,, S:g;g$s ~ The STOP instruction causes the oscillator — to be turned off and the processor to f, ~~.:,$. “sleep” until an external interrupt (1RQ ) occurs or the device is reset. ~\~k ,,~t “-:<~~AIT: The WAIT instruction causes all processor clocks to stop, but leaves the core timer ::y+ ~., .>>,3;?,. running. This “rest” state of the processor can be cleared by reset, an external ;/t ,:,. interrupt (=), or a core timer interrupt. There are no special WAIT vectors for these interrupts. Note that the 16-bit timer, SC I 1, SCI 2 and the MC68000 module are not active during WAIT mode. MC68HC05i8 RESETS, INTERRUPTS AND LOW POWER MODES MOTOROLA 4-5 4.3 LOW POWER MODES ., .,. ,,, ,, 4.3.1 STOP ~ :,. .:,. -.,, ,., ,’. ,. The STOP instruction places the MCU in its lowest — power consumption mode. The processor can. only be started again by an external interrupt on the IRQ pin or a reset. The oscillator is stoppe~{:pt~ all CPU and timer functions are stopped, and an oscillator stabilization delay of tPoR~ is req~?ra’* ‘ ~,..!\.:.\,,. ,~:.’ to start the processor again. I.*,S*>., .,,,,.,)?: , s. , ‘:a\*,-. ~.. During the STOP mode, the core ,timer interrupt .flage and, interrupt enable bits a@~f$&~6-bit Tmer interrupt and enable bits are cleared by internal hardware to””remove any pe~~~?interrupt requests. The timer prescaler is also cleared, The l-bit in the CCR is cleared~+~ eti$ble external interrupts. All other bits, registers and memo~ remain unaltered. All in~~~.~~$ut lines remain unchanged. The STOP instructioncan be disabled by a mask option; ,L*@ disabled, STOP is ~**c\~~ executed as a NOP (no operation). .)’*p..J .\,:), ,. ,\,,r* $. ~:~<., $$;{ ..M\J# . -1.+,?,,, Note: Pending interrupts from the M68000 interface, S~[~~$$d SC12 are not cleared by the .STOP instruction,, ., . ., ,,\ t;j< “ {, .,?j: . ,, . .: ”’. :..,,;j,.l ,, “-~ Qmtik w+. ,’~ ~,. ,. ,, 4.3.2 WAIT “ :, ‘-; ,+%$$”C* - - ,.. : ..../., ,, The WAIT instruction places the MCU in,ta!.:li a’lo~~power “ consumption mode, but the WAIT mode consumes more power than the STOPf~$ode. All CPU action is suspended, but the Core Tmer remains active. An interrupt from tb@ &&j& ’Timer, can cause the MCU to exit the WAIT mode.. $:,!>::., ~v,:, ,,.> During the WAIT mode, the l-&~7#~e CCR is cleared to allow interrupt processing. All other X\,’*p+!:% ‘ registers, ‘memo~ and”inpu~o@t Ilnes remain In their previous state. ., .,, ,., :~,~~,. :> ,,. ~\$.:l,k,, ~y: y: : ‘~k$::e&P. ,:.. 4.3.3 , Data R$wgh Mode .,, !I:?iyj$ .,! ,. The content$~~f~e RAM are retained atsupply voltages as low as 2.0 Vdc. This is called the Data Retention:N@$ in which, data is maintained but the device is not guaranteed to operate. ~,, J,$i, .. ,, For,l~@%$}ower consumption in data retention mode the detice should be put into STOP mode befqre:~~ducing the supply voltage, to ensure that all the clocks are stopped. If the device is not $$$t~P mode then it is recommended t~at ~ be held low whilst the power supply is outw”ith ~~f$~e normal operating” range, to ensure that processing is suspended in an orderly ’manner. ,,4’ .. Recove~ from Data Retention Mode, after the power supply has been restored, is by an external interrupt, or by pulling the RESET line high. ,, ,. MOTOROW RESETS, INTERRUPTS AND LOW POWER MODES MC68HC05i8 44 }No I ? Y No No I Execute Instruction I Rgure 4-2 Hardware Interrupt Flow Chart MC68HC05i8 RESETS, INTERRUPTS AND LOW POWER MODES MOTOROU 4-7 a. k,, MOTOROU RESETS, INTERRUPTS AND LOW POWER MODES MC68HC05i8 4-8 :..t. ,$~ts~:i$ *,,{ a:.,,’ ~:)i SECTION 5 $?,,..::&, 6 ,3, ~’;i.’**v2?’ t, ,8~, MEMORY AND REGISTERS - ..: ,:$\..ha .?, . .,,. ~~k> . . .~.:”.,t* “““ .!...>$k. . :. ...: ,;,,, ..’1’ ,.v ~’$i>,;:, ,.-,, “.y,i:s 5.1 MEMORY MAP .,.,$),,>~ ~..i:~~ ~“ ..,, .~ > ,ii:!, ~,~..,,., The MC68HC05i8 has a 16 kb~e memory map comprising 7936 b~~$fof~ser ROM, 224 bytes of RAM, 240 bytes of self-check ROM, 16 bytes of user vector~t~@~4 bytes containing the 1/0 registers. ,,4 \& ~$” ,J:. ‘,,. .?J ,.N~,.? .ti\; ,,.:$ 5.2 RAM ....~. ~ ..,.X;:.;). 224 bytes of on-chip static RAM are locatedfro~Q’B50to$012F. The processor stack starts at $OOFFand is limited to 64 bytes ($OOCOto $OO@,@hen the stack overflows it wraps round from $OOCOto $OOFE overwriting any existing daf~$~ ., ,*,) ., Note: Using the stack area for dd~~;$torage or as temporary work locations requires care to prevent it from being a.+itten due to stacting from an interrupt or subroutine call. ,4::”-”>. ,, .},, ~,$,,t-:,:,.F $4: )*,t, .%:~~ ~?, :1*+,}< . x.~ $$.*:7:+ 5.3 ROM 1~$~$+.,, !.. ..,,3.. *>:,*..:’,.’ The user ROM con~:~l,~ 7936 bytes of ROM at location $2000 to $3EFF and 16 bytes of user vectors from $3,FW~t@$3FFF. The self-check ROM and vectors are located from $3FO0 to $3FEF. ,,y ‘, ,$ \’J*<~ ~,.,$ ‘?.~., ., \.y’ “ .,$~. ,,*, 5.4 .t>>j;~%lSTERS ~:; >,,, lnt~,r$~~gisters associated with the on-board hardware functions are contained in the block from ,~O<@ to $O03F. All internal registers and their contents are shown in Table 5-1. Refer ‘to the ,*.“-~$ ,~ar~ware module descriptions later in this document for more detailed information on the .:,,t~~~operation of these registers and their contents. {jr:,$(i\ *,, ..,. ..:. ,> 5,5 VECTORS All vectors for reset, hardware interrupts and software interrupt are located at the top of the memory map, from $3FF0 to $3FFF. Each vector location consists of two bytes containing the stati address of the reset or interrupt routine (See Table 4-1). MC68HC05i8 MEMORY AND REGISTERS MOTOROW 5-1 $0018 $M19 $OOIA $001 B ““ $Oolc $MID “ $001 E :, $OOIF : $0020 $m2 1-$0022 $0023 $0024 $0025 $0026 $W27 W2=$O02A $0028 $@2c $O02D $O02E $O02F ~$0030 $0031 $M32 $0033 $0034 .“h “’$0035 $~36 .. . . -, $m37 $0038 : “,? $@39 . $O03A $O03B $O03C $O03D $O03E $#3F MOTOROU — MEMORY AND REGISTERS MC68HC05i8 Table 5-1 (a) Register Outline Atiress Bit 7 Wooo $0001 $0002 WO03 $0004 $0005 $OOM $0007 $OOOB CTOF $0009 $OOOA $OOOB $Oooc $OOOD H$OOOE $OOOF $0010 $0011 $0012 $0013 $0014 ..> I I Unused I 1 I s I s $001 c ICAIE CBIE OCIE TOIE O IEDGA IEDGB OLV I Timr Control (TCR) I moo Ouuo $OOID I Unused I 0 $001 E ICAF ICBF OCF TOF O = o 01 Timer Status nSR) I Uuuo 0000 $001 F - - 1-1-1-1-1-1-1 Reserved I u = unaffected MC68HC05i8 MEMORY AND REGISTERS MOTOROU 5-3 Table 5-1 (b) Register Outline (continued) Resat Address Bk 7 Bit 6 Bit 5 Bit 4 mt 3 Mt 2 Bit 1 Bit O Register Name ,,, Status W20 CK68 TCAW TCAPA TCMP WOM3 WOM2 WOM1 WOMO Poti E Mtie mooDo -21 UnKd W22 * $W23 - 0 SCPI Scm - SCR2 SCR1 SCRO SCI 1 Baud (BAUD) m -M,,;. .5 ~24 R8 Ta o M WAKE o 0 0 SCI 1 Control 1 (SCCR1] .+*” $W25 nE TCIE, RIE ILIE TE RE RWU SBK SCI 1 Control 2 (SCCR2] ~v’ ;@b <.. SC, , ~btu: ,~csRkf:>+p. ~ylm ~ $0326 TORE ‘TC RDRF IDLE OR NF FE 0’ .,* .,:,. W2B - 0 SCPI Scm -’ SCR2 SCRI SCRO ,~\N\S*~~B%ud (BAUD] m -Uuu ,~, ,, 0 W2C R8 M WAKE o 0 0 ,i.j~@~T control 1 (KCRII uu~ ~ 3002D nE TCIE RIE ILIE E RE RWU. s,~ ‘: .,, ~ SCI 2 co”tral 2 (sccR2) m~ .,. ‘~.>’ ‘$O02E TORE “TC RDRF IDLE OR NF FE , ,, ?~if, SCI 2 Sbtus {SCSR) llmoOsO , ,$.,. 3002F ,,\.*.4xi>\ ,,.% \ SCI 2 Data (SCDR) woOOO ,’ ,. ! .1 &*, .I{.%.:J),:J MCU Channel A Dati Wtite ~~ m30 !$:;~j,:,$$f RDRW05) <~,. ,~) MCU Channel B Dab Wdte b31 ., (BDRW05) ,? & ,, “%: ‘J$i. ‘ MCU Channel C Data Wtite “ W32 ,, .:s..$,.i,.~:k ,. :. ,.?$:,. (CDRW05) , ,’. \~’,:,... ., :!i. MCU Channel D Dab Wtite $0033 **,, ~,>,,,,;.’ . x$..! .,, (DDRW051 tit ..,,J&. , ‘,) , $+ :~:t:y; MCU Channel A Data Read ,aff~ed. W34 ~ “t:&, @DRRo5) ,. : .+..’..- \2 . ~, ~~ MCU Channel B Dab Read m35 .“.)..%.,:.a,” -t%>.,i (BDRR05) ..: -, k ‘j, L:?**; ,.,. MCU Channel C Dab Read $0036 ;\.!,i‘~...> “.’$’, ‘f [CDRR05) .,. ~~>< ;’. , .*! MCU Channel D Data Read $W37 .,] “{,:..~’..., (DDRR05) $0038 ~~e&~q “fiRDY RFULL REMTY To~ mDY TFULL TEMti MCU Channel A Status (AsR05) 00010001 RRDY RFULL REMTY TOR TRDY TFULL TEMTY MCU Channel B“Status (BSR05) ml ml RRDY RFULL REMTY TOR TRDY TFULL TEMTY MCU Channel C Status (CSR05) ml Otil RRDY RFULL REMW TOR mDY TFULL mMTY ~cu Channel D Status (DSR051 Wol ml RB TB RC TC RD m MCU Interrupt Status (ISR05) W& ,, *3D RM,A TMA. RMB TMB ,RM,c : .Mc - RMD, TMD : MCU”lnterrupt Mask (IMR05) W’ow .~3E IMOD o ‘o. 0 ~,, AEN ~ BEN CEN DEN MCU, M&e {MR05) m mo .5ti3F”’ .’. Uriused .:$~ .* , .,,.. ‘:’:’*&,m\:, !\:\, SECTION 6 .{.+*:V: ,.;. $,, k: **,,\&.$. F\,.: ~. PARALLEL lNPUT/OUTPUT PORTS .:! ,~}.,.?it?., \,\ .t\:i$, ‘Xi ,,:s \. ~,,\?. .$:. .*‘ ~ ...“:;$:, \,f7 In Single Chip mode there are 42 lines arranged as five 8-bit and one 2-bit 1/0 ~r~$~~he l/O ports are programmable as either inputs or outputs under software control,~,~k, th~ data direction registers. Port E also. controls the timer functions, the external clock ‘l~~$~ and the wired-OR capabili~.. Control of these functionsis done via the Pofi E Mode r~~$@ explained later in this section. *$:y-<$~e,. ~i},.. ~~, .\., ‘-’:?b.<.j. ~ ‘t, \*,? ~\.;*,,,\<.! ‘,i,.. !:,:i.., ,.,., tt:+.:,:: ‘~: “ Dab ~:,h, ~.?, Directiw ‘DRn Rqister ,i~$ > ,tt$:&8* Dab Ouwut 1/0 Rqister —DATA ,~’:.:~!.,.$tig Buffer Rn ,??~$%~, DDRn DATA 1/0 Pin ‘!;:~,i~:+.$, = +\: 1 0 0 s o@ut Date 1 1 1 ; Reg. z o 0 tri-state ~~ E ~ < ~ Input‘s o 1 tri-state Buffer Figure 6-1 Bi-directional l/O Port Structure Block Diagram MC68HC05i8 PARALLEL lNPUT/OUTPUT PORTS MOTOROU 6-1 6,2 PORTS A-D Ports A, B, C and D are 8-bit hi-directional ports. The port data registers are located from $0000 to $0003 and the data direction registers (DDR) from $0004 to $0007. Reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. Writing a “1” to a DDR bit sets the corresponding port bit to output mode. ,. ,. .,,},,,., ~it.. Y\ .>,,.+? .,:..,..$>.:$ ,, ,- ?/’ ,.’~tiy .,.. ~i,},,’~+$,.qii.:.~ ,.,,,,, .~.,.,k ~,”,}l.) *.:. * PORT E ,,y ,,:’ 6.3 $,:..,’,,:~’ ,- .’ ,.. , ‘,.:1., .*? ,i$.b.th,>x+~’ “ >>~ Port E is an’ 8-bit bidirectional l/O’poti. The port E data register iS at $OOOC’andth~’~sta direction <.:*- register (DDR) ‘isat $OOOD’;Reset does not affect the data register, but’ cle~:~~@ data direction register, thereby returning-thepofl to inputs. This ‘port can’be reconfigur~$o’w?ovide the signals ,,.1 ‘+~~~: .!:. needed for the Serial Communication Interface units, the 16-bit timer+~,~~}~e M68000 Interface unit. Futihermore it has wired-OR capability on. pin: G3., The func~~n’& each pin is determined by the Port E Mode register at location $0020. With the exceptiR@@?Me ~s,+’ :~:.\\ :?h SCI subsystems, a logic one in the mode register selects the associated subsysterne~.hl~p a zero configures it as an l/O line. Reset’clears the Port E Mode register, causing Port E @{unction as a standard 1/0 port. The action of setting the Port” E Mode bits is desc~bed ,. :i~jow” and summarised .in .Table 6-2. To configure the port to support the SCIS, bits 2 and 3 ~~’’~e%Cl Control register 2 should be used. This register is desctibed, in Section 9. ,i,:>~> ., . .. ., T.+>.>$ . )’ .,, ,,’ ..!:.’ ... ,’. .>T,j f’, ..:, -,, !, p?3*:,1\ , ,.. .+;J,,,.,, ~:;, ,’“i;,!t,v!’ Table 6-1 l/O Pin Functions .., . , Rl~~~ ~;tibR 1/0 Hn Function ,<, < j?’ o The 1/0 pin is in input mode. Data iswritten into the output data latch. ~ ., ‘,.~..::‘-,$,~~ ‘d.:t);. o .’! .\,.,, 1 Data is’written into the output data latch, and output to the 1/0 pin. $\:,:$.*> .“ -.. 1 0, The state of the 1/0 pin is read. ,, 1 “1 The:l/O pin is in output mode: The output data latch is read. t Note that R~ is an internal signal, not available to the user. . ,,, . . MOTOROW PARALLELlNPUT/OUTPUT PORTS MC68HC05i8 6-2 6.5 PORT REGISTERS The following sections explain in detail the individual bts in the data and control registers associated with the 1/0 ports. Reset clears this register. MC68HC05i8 PARALLEL lNPUT/OUTPUT PORTS MOTOROW 6-3 lnaddition totheDDR,P oti,Eha s.amode registerwhic hcontrolsthef unctionof each pin in Port E, A “l” in a particular bit selects the “subsystem” while a “O” configures the pin as standard 1/0. ,, VOM2 WOM1 WOMO Poti E Mof@$W#ster ,.,,.,,,.:, >!.*J\ “ 6.5.6.2’ TCAPB — Input CaPtUre B *,. 6.5.6.5 WOM&3 — Wired-OR mode 1 (set) - The corresponding Port E line (bits G3) is configured for Wired-OR mode operation. O (clear) – Wired-OR mode is disabled .:. . !. !?$j~: ~~., ::.~, ,,..s.* ‘ .~$ >. i? .:-::,$: Note: Wired-OR mode can be selected when the pin functions as a standard l/O pi%*&,@ an SCI pin. Bits 2 and 3 of the relevant SCI Control register 2 are used t:?+@~re the Port E bits G3 to support the SCI functions. See Section 9 for further xfqifsj ,~i.$’..~~,,, .*$+* ,J, .+,. ‘s $\. ~,’,.. ~$t>’ Table 6-2 Port E Mode Table . ,;.. :.:,~..> ~$. \\.%,,$:.: ~:: Bit Value Functi@g~~f~ ~ *.., ,., o No wired-OR capa~~~~ o&pln PEO WOMO 1 Wired-O R capabilit$~~this ~,$..,)\\, pin o No wired-O~${$~~*lity on pin PEI WOMI 1 Wired-ORcaphility on this pin .,;$”.:(lX, o No @~~ capability on pin PE2 WOM2 1 W~~~~~ capability on this pin o ,*&, No wired-OR capability on pin PE3 WOM3 1 t%: ~!~Wired-OR capability on this pin PE4 functions as standard l/O TCMP Tmer compare function on this pin .j.~ “$>, $: :... *: o PE5 functions as standard 1/0 TCAPA ~“? :Q’ ‘ ~ ,,~.. :$>:,. ~,+ Tmer compare function on this pin :*. ~: o PE6 functions as standard 1/0 T@$F’ .!:.+,, 1 Tmer compare function on this pin .!; ~ ?; :\,::3:,,,:$’ o DTACK synchronised with MCU clock J“ ;$t ‘k:”CK68 ?kt~+>“’ 1 DTACK synchronised with external clock ,~~.,t,,. ,~.\. <..),,., ..,$ .>~,,, . ,t> . . ($OOOF) ,,y Writing a “1” to any bit configures the corresponding bit in the Port F data register as an output. Conversely, writing” any bit to “O” configures the corresponding Port F bit as an input. Reset clears this register. MC68HC05i8 PARALLEL lNPUT/OUTPUT PORTS MOTOROW 6-5 6.6 OTHER PORT CONSIDERATIONS - ‘“ “-’ ‘ “’ “’” Alllnputi"Outputports' cane mulateo pen-drainoutputs. This isachieved bywriting azero tothe relevant output port latch. By toggling the corresponding data direction bit, the port pin will either bean output zero or tri-state (an input), Refer to Figure.&Z.. ..: RALLELINPUT/OUTPUi PORTS MC68HC05i8 ,, .,..F,*,*,Q4< !*: ‘~:$?, SECTION 7 \,.t!’ .+,:’$ ~\,}I-\,t ,>,, ~~ h.,J. ,,].$, .. ;C?’ PROGRAMMABLE TIMER *: ‘~ *, ..*,,:,.,. “:*; .,,:~,\,\,.t,.. t;;: ?,), “ i.’,~:, ~.?.~\l\i,., The programmable timer on the MC68HC05i8 consists of a 16-bit read+nly f~~$nnlng counter, with a fixed divide-by-four prescaler, plus the input capture/output tom@’@ ,.>\t.\ cr~cuitry. Selected ~.< input edges cause the current counter value to be latched into a 16-b~$k@’?Ncapture register so that software can later read this value to determine when the ed~&{{@urred. When the free running counter value matches the value in the output compare ?&~~ters, the programmed pin action takes place. Refer to Figure 7-1 for a block diagram of ~~~+JJ,rner. .,’ ~.< ,.\ The timer has a 16-bit architecture hence each specific fgni~o$al segment is represented by two 8-bit registers. These registers contain the high an$,,fbw byte of that functional segment. Accessing the low byte of a specific timer functio@’~{~ows full control of that function; however, an access of the high byte inhibits that specific ti~~$ftinction until the low byte is also accessed. ..}~:$,,i . ~A1.,,...1 ‘+?} ~{.+:$,. ‘\~.+, Note: The l-bit in the CCR should bq set.\\.* its value. ::.$)‘,r:, , .\* q:,,, ,>.;*.l ,..~, !. >?:++; ~:,‘~ ~i{.. ~+.? 7.1.1 Counter Register ($18/19) and Alternate Counter Register ($lA/~@~~+,*”>”’ . ‘:, v “ l!;\\.*,:,:$* $0018 $0019 ~;{$~~::: .~ii ., $OOIA ,:$.,.<,4,)Alternate Counter High Register ‘t * ,,,. ‘!;<{ $001B *$:, Alternate Counter Low Register .,., > Reset: Register states not affected by ,~~t” ,Jit: ‘++l::,i:$$ The double-byte, free-running counter can b&?&$~ from either,of two locations, $18-$19 (counter register) or $1 A-$1 B (alternate counter jegister~. A read from only the less significant byte (LSB) of the free-running counter ($19 or $ll~”~~~ceives the count value at the time of the read. If a read of the free-running counter or alte~~$r%lcounter register first addresses the more significant byte (MSB) ($18 or $1 A), the LSB i$i~~~jferred to a buffer. This buffer value remains fixed after the first MSB read, even if the.j~~%??eads the MSB several times. This buffer is accessed when ~,k~,:y,?+p reading the free-runningtc~l~ter or alternate counter register LSB and thus completes a read \*“?,> sequence of the total ~un~~~value. In reading either the free-running counter or alternate counter register, if the MS~@,;~~~d, the LSB must also be read to complete the sequence. If the timer overflow flag (T.@~~w#$etwhen the counter register LSB is read then a read of the TSR will clear ‘~~,:+!. the flag. ,, ~~..:$$ $\ ,.:’ The Alter~’~~ounter register differs from the Counter register only in that a read of the LSB does not d~~I@OF. Therefore, to avoid the possibility of missing timer overflow interrupts due to .$.:,.$,?+, cl,~${~~~.of TOF, the Alternate Counter register should be used where this is a critical issue, .,. .,,..i ,J$~3~@~free-running counter is set to $FFFC during reset and is always a read-only register, During a ,(P~\i~~bwer-on reset, the counter is also preset to $FFFC and begins running after the oscillator start-up *:}*L ,,~ delay. Because the free-running counter is 16 bits preceded by a fixed divided-by-four prescaler, the value in the free-running counter repeats every 262,144 internal bus clock cycles. TOF is set when the counter overflows (from $FFFF to $0000); this will cause an interrupt if TOIE is set. MC68HC05i8 PROGRAMMABLE TIMER MOTOROU 7-3 7.2.1.5 IEDGA — Input Edge A When IEDGA is set, a positive-going “edge on the TCAPA pin will trigger a transfer of the free-running counter value to the input capture register. When clear a negative~oing edge triggers the transfer. 7.2.2 nmer p~e~egister (TSR) .>,., ~,.i ~.::;i ,.-,,.., ~. ..+:)’ ,~. The Tmer ~tafi$,~gister ($1 E) contains the status bits corresponding to the four timer interrupt conditiongf+<~~ ICBF, OCF and TOF. Acc~@~~*h:e Tmer Status Register satisfies the first condition required to clear the status bits. TQ,&k@&alning step is to access the register corresponding to the status bit. :~,$$~, ~,.* :+ $;;**,>.’ .,):. 7. 6 5 4 3’2 1 0 .. ..>...”.,,. k,,*. .. -? .,. ?.kt,.+ I*, * ..?~ $001E ICAF ICBF OCF TOF o 0 0 0 Tmer Status Register ~,~< ~. Reset u u u o 0 0 0 0 MC68HC05i8 PROGRAMMABLE TIMER MOTOROW 7-5 7.2.2.1 ICAF — Input Capture A Status Flag This bit is set when the selected polarity of edge is detected by the input, capture edge, detector; an input capture interrupt will be generated, if ICAIE is set. lCAFis cleared by reading the TSR and then the Input Capture A Low register ($11). ,..’ * – 1) The timer status register is read or wtitten when TOF is set, and - 2) The LSB of the free-running counter is read, but not for the purpose of servicing the flag, Reading the alternate counter register instead of the counter register will avoid this potential problem. MOTOROW PROGRAMMABLE TIMER MC68HC05i8 7-6 7.2.3 input Capture Function ‘Input Capture’ is a technique whereby an external signal is used to trigger a read of the free running counter. In this way it is possible to relate the timing of an external signal to the internal counter value, and hence to elapsed time. ,, ,):,* .,.-.+:<;\” ~ Note: The pins used for monitoring the external signals are the shared PE5flG#~@’nd PE6flCAPB pins, hence when this function is used the corresponding po~@~annot ,,, be used as a standard l/O line. ,a$~,.’ *j. tt~ .l~: *..‘ ,t.*%$:*::~,\! ~*, .~:’ There are two input capture registers: Input Capture Register A (lC,~(Jand”’ Input Capture ,.>~, Register B (lCRB). ,Jt..?.,,,~:j, ,,:, ~$.:a ,,?.::, .,(,..:, -,,**, ?:~;:$k.e 7.2.3.1 Input Capture RegisterA (ICRA) .,\$.,$*\“:’:. {~.,\;!:.,,.. .,,b!.~ .,~ \y.$?:+?$:l< +.. .\ 765432 1 ,$-,%.:>? t ‘i\\;l, $0010 .,<.*>:,,, Input Capture A High Register ..,*, “i~, $0011 f!” *Q: Input Capture A Low Register *!, }! Reset: Register states not affecte&~~~~set ~.t The two 8-bit registers that make up we 1&bit Input Capture Register A are read-only, and are “*“$. used to latch the value of the free-r~pl~ :<.*, counter after the input capture edge detector senses ~,,,t,l,. a valid transition. The level transi~~~%l triggers the counter transfer is defined by the input edge bit (lEDGA). The 8 most sig:{~#~{&ts are stored in the Input Capture A High Register at $10, the 8 least significant bits in t~f~~ti Capture A Low registerat$11. .?, ‘,.%, \ ‘!~] The result obtained fr~m ,@w’input capture will be one greater than the value of the free-running counter on the risin~#~@ of the internal bus clock preceding the external transition. This delay is ,~ required for int~~~,~,~~nchronization. Resolution is one count of the free-running counter, which is four interna~@ clock cycles. The free-running counter contents are transferred to the input capture 4~&iter on each valid signal transition whether the input capture A flag (ICAF) is set or clear. ,,T.~~Ltiput capture A register always contains the free-running counter value that corr~~~ds to the most recent input capture A. After a read of the input capture A register MSB ~$f~atfie counter transfer is inhibited until the LSB ($11) is also read. This characteristic causes ,$..:~%~time used in the input capture software routine and its interaction with the main program to ,W~~&etermine the minimum pulse period. A read of the input capture A register LSB ($11) does not .\. ~$’+* ), inhibit the free-running counter transfer since the two actions occur on opposite edges of the internal bus clock. Reset does not affect the contents of the Input Capture A register, except when exiting STOP mode. (See Section 7.4) MC68HC05i8 PROGRAMMABLE TIMER MOTOROLA 7-7 7.2.3.2 Input Capture Register B (ICRB) ,, . . .: ’”: “’7 ‘6 5 : 4“3’’-”2 ‘“l” “o” ,,3, ,., ,. ,., . :, .,, ‘ $0014 ‘ Input Capture B High Register ,, ,-’, $0015 Input Capture B Low Register ~“.$. .$*, .:$:~:+,,.,.,., ~, Reset: :, H.egister states not affected by Reset , .,,:, ~x>.+$ ; .J. :. \.t\i’ , ~ ,., The two 8-bit registers that make up the 16-bit Input CaptureRegister B are read-nl~::~~#re} used to latch the value of the free-running counter after the inptit capture edge dete~:~r ases a valid transition. The level transition that triggers the counter transfer is defined by.~~;~~~~t edge bit (IEDGB): The 8 most:significant bits’are stored in the Input Capture B High Rq@l~$at $14, the ~’:.t,.:i>. ‘~;~.,*,*,, ,.” 8 least significant bits in the Input Capture B Low Registerat$15. ~~-$< .t,+”.t, ,$’’:.+ ~<~~ The result obtained from an input capture will be one greater than the ~~~~~f the free-running counter on the rising edge of the internal bus clock preceding the ext@@~%ransition. This delay is required for internal synchronization. Resolution is one count of,~f~{ree-running counter, which is four internal bus clock cycles. The.,free-running counter coqte~~. are transferred to the Input Capture Register B ,on each valid signal transition whether, $~tdut Capture B Flag -(ICBF) is set or clear. The Input Capture Register B always conta~~s ‘!& free-running counter value that corresponds to the most recent input capture B, Afte}~~~ of the Input Capture Register B MSB ($14), the counter transfer is inhi~ted until the L~;~$l$) is also.read. This characteristic causes the time used in the input capture software routi~~:snd its interaction with the main program to determine the minimum’ pulse period. A read ‘o~+the Input Capture Register B LSB ($15) does not inhibit the free:running counter transfe~+}~,e the two actions occur on opposite edges of the internal bus clock. ~ ‘ . .JJ,N<:~j~j. ‘ .,*, ,, .,’, ~~>p !..,.,. Reset ‘does not affect”the conten@~&f~e Input Capture, B. Register; except when exiting STOP, ,<.+.,. *& ,,. ,, .,*.* q.,s,:, .,>*.. .-i. \- mode. (See Section 7.4)’ .*+“:.9,$. ,.. ,. ,,, ,)<*, ,., .,~&,‘Sk..:$ .,..,’ ‘, ,’ 7.2.4.1 Output Compare Register (OCR) 7654321 0 $0012 Input Compare A High Register $0013 Input Compare A Low Registe~,,,<”kU ~’,+$< ‘. ,,.\\:> ,~:,~~!$.,. Reset: Register states not affected by Reset .1--- -*?. .*:.!.,+ \ ~~it,,,>1 .’?>$, *{~#a .* The 16-bit Output Compare Register is made up of two 8-bit registers at locations $%t~~~B) and $13 (LSB). The contents of-the Output Compare Register are compared with th~$~~~nts of the free-running’ counter ”continually and, if a match is found, the corresponding O@~~&ompare Flag (OCF) in the Tmer Status Register is set and the output level (OLVL) bi~,,~~cti~d to the Output Level Register. The Output Compare Register values and the output l~@~j~should be changed after each successful comparison to establish a new elapsed ti~~~~ An interrupt can also accompany a successful output compare provided the correspon~~~’terrupt enable bit (OCI E) is set. (The free-running counter is updated every four intern+~~~, clock cycles.) ..:.> .:x.,**)$I>, After a processor wtite cycle to the Output Compare,,@&is&r containing the MSB ($1 2), the output compare function is inhibited until the LSB ($l,3??~~~alsowtitten. The user must wtite both bytes (locations) if the MSB is written first. A writ~qlde only to the LSB ($1 3) will not inhibit the compare function. The processor can write to eit~~k@yTe of the Output Compare Register without affecting the other byte. The output level ~~~~’pibit is clocked to the Output Level Register whether the Output Compare Flag (OCF) is se?~r clear. The minimum time required to update the Output Compare Register is a functio~$f tti~ program rather than the internal hardware. Because the Output Compare Flag and the OQQu&Compare Register are not defined at power on, and not ;,-..i\.’:\’~,< affected by reset, care must be,]~c~~’when initializing output compare functions with software. The following procedure is re&@bnded: +~.$:<.~‘ Write to OutRu&~,~pare High to inhibt further compares; .*>: *t*:. ~~ - Read the T~~%atus Register to clear OCF (if set); ~~!$t.?~:l ;,l$~’ - Write ta Oytput Compare Low to enable the output compare function. V$<:;’3,*.4 All bits of the di~~btCompare Register are readable and writable and are not altered by the timer hardwar~~~~et. If the compare function is not needed, the two bytes of the output compare regist,~~~be used as storage locations. *... ‘~:,~,.>. ~.:~,j,:$-*$ ..,$..l> ,* r...,!. .4,’*. ?, R. }:, ,I$t’.l,’:~>,,,,.y ~>e7.3 TIMER DURING WAIT MODE *.,..,$.:>, ..$l The CPU clock halts during the WAIT mode, hence the Tmer stops, and holds the last count value, On exit from WAIT mode the timer will resume counting from where it had stopped. If RESET is used to exit the WAIT mode then the counters are forced to $FFFC. MC68HC05i8 PROGRAMMABLE TIMER MOTOROU 7-9 — ,,~. TO1 n n .:, n ..‘ n Internal Xmer Clinks TIOJ— n n Note: If the input edge occurs in the shaded area from one timer state TIO to the next timer state T1 O, then the input capture flag will k set duting thenext Tll state. figure 7-3 Tmer State Tming Diagram forlnput Captures MC68HC05i8 PROGRAMMABLE TIMER MOTOROW 7-11 ~,!: -.,,, ,., . . . . .. ..* ifs\> A,,?’: NOTE1: The CPUwfite totbcompare registers maytake @acdF~.$nyAtim, Wtacompare onlymcursat timer state TOI. Thus a four cycle dfference may Q@t baWeen the write to the compare register ad the actual compare. , ,$... .. . \*> NOTE 2: Internal compare takes @acedufing timer st~’~~. ‘W NOTE 3: OCF is set at the timer state TI 1 that follo~,%&#omparism match (WFED in thisexample]. .~;:.y. ,s~{~. ,.,. .~a ~,;.!, ,+i,- NOTE: The TOF-bit is set at timer stateT11 (transition of counter from $FFFF to $0~). It is cleared bv a read of the timer status register during the internal processor clock high time followed bv a read of the counter low register. Hgure 7-5 Tmer State Tming Diagram for Tmer Overflow M070ROW PROGRAMMABLE TIMER MC68HC05i8 7.12 SECTION 8 .?+,\ ,,*, .:,. \.~*#t,,}\, F ~.*.\,, CORE TIMER >*,.. ~~,>:,:, :~,,. ,J $ ,,11 ~.~.. ~... ~,,,~,.<+!? ‘ ,r.,~<>$,.. ~. Besides the 16-bit timer on the MC68HC05i8, there is a 1bstage ripple coun~e~~~~ed the Core Tmer (CTIMER). Features of this timer are: Tmer Overflow; Power-On ~~t&~OR); Real Tme interrupt (RTI), with four selectable interrupt rates; and a ComputerJ.@,&ja~~ng Properly (COP) ., \ ::$:’ ~,,,~ ~. watchdog timer. i$k> }+ .K’ +,,. .,,>\$}* As seen in Figure 8.1, the timer is driven by the internal bus,.Qoc~~%~ded by four with a fixed prescalei. This signal drives an 8-bit ripple counter. The val~~~~~tiis 8-bit ripple counter can be read by the CPU at any time, by accessing the CTIMER ~~~n?~r Register (CTCR) at address $09. A timer overflow function is implemented on the las~~~age of this counter, giving a possible interrupt at the rate of fop/l 024. (The POR signal is~l:o’~erived from this register, at fop/4064.) The Counter Register circuit is followed by four ~’d~ stages, with the resulting clock (fop/l 6384) driving the Real Tme Interrupt circuit. The RTI ‘&r@i~consists >,:,+::*F,,, $,), of three divider stages with a 1-f-4 selector. The output of the RTI circuit is furt~x divided by 8 to drive the COP Watchdog Tmer circuit. The RTI rate selector bits, an~:the~’~Tl and CTI MER overflow enable bits and flags are located in the .CTIMER Control and ~ak Register (CTCSR) at location $08. .<}*,.., ,, ,* .:..,.,, .\\. CTOF (Core Tmer Overflow Fla$~~s,fklearable, read-only status bit and is set when the 8-bit ripple counter rolls over from $F~.#~~~~@.A CPU interrupt request will be generated if CTOFE is set. ,.. ,+”! Clearing the CTOF is do~e~~~ntlng a “O” to it. Writing a “1 “ to CTOF has no effect on the bit’s value. Reset clears CT@~~; !.\. . \, .,.. ‘;: * When CTOFE (Co~~ ?fler Overflow Enable) is set, a CPU interrupt request is generated when the CTOF bit is sqg?~i$~t clears CTOFE. ‘+.~,$~,i, ,t,i The Corq~~&~[ Counter Register (CTCR) is a read-only register that contains the current value of the 8~&~~~~~e counter at the beginning of the timer chain. This counter is clocked at fop/4 and can@~sed .,:~i .,., ~: -\t..\\ . for various functions including a software input capture. Extended time periods can ,@e~l~dined using the CTI MER overflow function to increment a temporary RAM storage location ..?@eby simulating a 16-bit (or more) counter. cycles, the power-on reset circuit is released, which again clears the counter chain and allows the device to cqme out of reset. At this point, if RESET is not asserted, the timer will start counting up from zero and normal device operation will begin. When RESET is asserted at any time during operation (other than POR), the counter chain will be cleared. MC68HC05i8 CORE TIMER MOTOROU 8-1 ,. .- bTo Reset ,Logic 8.2 COMPUTER OPERATING PROPERLY (COP) WATCHDOG TIMER The COP watchdog timer function is implemented by taking the output of the RTI circuit and fuflher dividing it by eight, as shown in Figure 8-1. Note that the minimum COP timeout period is seven times the RTI period. This is because the COP will be cleared asynchronously with respect to the value in the Core Tmer counter register/RTl divider, hence the actual COP timeout p,~~~ .. will vary between 7x and 8x the RTI period. .,j,’”~’” ~ ,6$* ‘“;;3.,~<~u., The COP function is a mask option, selectable via the Mask Option register d@~&~~evice .,. r.., . manufacture. *,$*, ?*.!” ~ .,..!.:’”.,> ..’~:t..’” If the COP circuit times out, an internal reset is generated and the normal rese{~~~or ISfetched. Preventing a COP time~ut is done by writing a “O” to bit O of address $~~~: when the COP is cleared, only the final divide by eight stage is cleared (see Figure 8-1 ).,+’~~+:~~’”i’ .$J,\),:l! ;} ~?, ,* ~‘,:~~~.~’ ,~..)~,+,~,.~i \\,, *;:. 8.3 CORE TIMER REGISTERS ,..~. ~.i];.” ~?,~. t.;’.$ ,. .: /l..,}\.t?~,M, ‘:~” ,*.. *+,,, ,Xi , 8.3.1 Core Tmer Control and Status Reg~*r!GTCSR) ($08) :;’, - ,.s ,,} $$1,~ .,!, \ ,, $08 CTOF RTIF CTOFE l~~%E I O I O RTI RTO Reset o 0 @?~+ “ \,%.-.$ o 0 0 1 1 ‘,* \,$, {13 +*:*] k, >$.. 8.3.1.1 CTOF — Core Tm~~&~;flow ~tt, .\.;$: k.., “~ .>., .?$}.-, * Tmer Counter register rolls over from $FF to $00; an interrupt This bit is set when tht~,::~q~~ request will be gener?~edfF~TOFE is set. When set, the bit may be cleared by writing a “O” to it. 1 (set) ,$?i*Y1. ~~~o~ ..... Tmer Overflow has occurred. ~~.~, O (cl,@a:):# No Core Timer Overflow interrupt has been generated. ‘$:.x’<.+ ,\\\ ,i, ‘f,..+, \.*.* .’!:, ;?}.:?,, 8.3.1~><,c RTIF — Real Tme Interrupt Flag ,,;....*:k.Lt ~.,\ ,t..j~ .,,,$:~~l$tiit is set when the output of the chosen stage becomes active; an interrupt request will be ~~~nerated if RTIE is set. When set, the bit may be cleared by writing a “O” to it. .:i:>>xy.t, ,* ‘,~ ,} 1 (set) - A Real Tme interrupt has occurred. O (clear) - No Real Time interrupt has been generated. MC68HC05i8 CORE TIMER MOTOROU 8-3 8.3.1.3 CTOFE - Core,~mer O.vetilowEnable ~~ ,.. ,: Setting this bit enables the Core TmerOverflow Inter[upt. A CPU interrupt request will then be generated whenever the, CTOF bit becomes set.: Clearihg this bit disables the Core .Tmer Ovetilow interrupt capabi~ty. ‘ ‘ ~~~ ~ ~~ ~~ ., .- .,, ... -:,.! ,,:. !’: 1 (set) - Core Tmer’Ovetilow interrupt is enabled.’ “’$:.\,+ ,,. . *iti:y;.,,*. $+~,,%h’*+ 0 (clear) – Core Tmer ‘Ovedlow interru~t is disabled. 8.3.1.4 RTIE— Real Tme lnterru~t Enable 8.3.1,5 RT1:RTO— Real Tme Interrupt Rate Seled ‘{$~’’”;” -4 ~.~~~?,$;,, These two bits select one of four taps from the Re#W%elnterrupt circuit;. Reset sets both RTO $? and RTI to one, selecting the lowest periodic r,~~~i~~wtherefore the maximum time in which to alter them if necessary. The COP reset times are~~o determined by these two bits. Care should be taken when altering RTO and RTI if a &ufit is imminent, or the timeout petiod is uncertain. If the selected tap is modified dufing a ~c!a.in which the counter is switching, an RTIF could be missed or an additional one could @~@~*rated. To avoid :problems, the COP should be cleared before changing the RTI taps. S~~$~@ “8-1 for some example RTI periods. ~.l,:., ;ii:,:.,~ ‘:’.>xe,?~.: : :., f S:t. ~;+ ... ,-- ~ . \:.,T*., ,ti.~,i:,i,t ,:,,s ~, i:-. ~~c ~S ,.,,,...*\:*< ~..>\,, ,,$ Table 8-1 Example RTI Pe~ods !’ ‘..’,.. ,L.Q> ,,\:,i:\\y \\.,. ...1.! :’,::;-%,\ ~<~ RTI, Pefiod at a Bus .-.“’ Di~sion Frequency of: ~+:;::f~” RTO .,.’ $.$..,. Ratio ,.$5,?x”/.~$.t 16.384kHz 2.097 MHz ..,:.., ,, ~l:.:.~ ~,<, ;~;.,? i>‘ “-i%: -:,?.. .’+.~!$>!,,, ‘ o 0 “’ 2’4 Is 7.8 ms ,,. , ~ \,.*>$ ) ,: . ~ :,<: ,,,,,? 0“ . 1 2’5. ,’ , 2s 15.6 ms ,, ~“’:, ,.,...$.<.:: .,,, t’~,. s~.p:,it,$. ,\, ~,.\\”{ 1 0 ,2:6-, ‘4s 31.3 ms ~::~ 1 .1 ~~ 217. 8s 62.5 ms 8.3.2 Core Tmer Counter Register (CTCR) ($09) The Core Tmer Counter register is a read-only register, which contains the current value of the 8-bit ripple counter at the beginning of the timer chain. MC68HC05i8 CORE TIMER MOTOROM 8-5 SECTION 9 ~\. .. -,\ .,,,,.. \*,\,+$, .$. This section describes the UART ~pe serial communications interface syste@~~~$N’The SCI can be used, for example, to connect a CRT terminal or personal computer t~,~~e ~CU or to form a serial communication network connecting several widely distributed,W# The MC68HC05i8 has two independent SCI subsystems — SCII and SC12. The inte{~~~eration of each SCI is identical, with each unit having its own set of control registers. SG4$;~Sitrol registers 1 and 2 are at locations $0024 and $0025 respectively, and SC12 Contr@f~~is?ers 1 and 2 are at locations $O02C and $O02D. Each of the SCI units has its own Bau4~~~register, SCII at location $0023 and SC12 at location $O02B, which allows each unit to,t$~,&& and transmit data independently. For example, SC I1 can be set up to receive and traWrn?t@-bit data at 9600 baud while SC12 can receive and transmit Shit data at 19,200 baud. ~~$~~e of the identical nature and operation of each unit, only a description of SCII is provi~:~,J& this manual. Both units are covered in the register summa~. , .:.$., +i,$, +.~, ‘,,,>. The external signals for the SCI block~~re?outed through Port E bits G3. Bit O and bit 1 are the receive and transmit pins for SCII (R~l’~pd ml ), while bit 2 and bit 3 are the receive and transmit pins for SC12 (See Figure 9-1). ~~~~$hher or both of the transmitters or receivers are disabled, the respective pins can be u~~!$~~~tandard 1/0. If open drain operation is required for either of the transmitters, it can be$a%w~d by writing to the WOMX bit in the Port E mode register, (See ~y,:~>.” Section 6.2.) .:?.> ~’%>)t ‘ k, “~ “?*.*,:; ,$.., ,.:. ‘~’\:~ ,$ ~ . ~~, ‘~:.i.:\t.l<, .\:,~i\ \ ,1 ~,,, .*- 9,1 .,PY’&lEW AND FEATURES ,u\, ,x,$’ $, -*,::$. “t ,,,. The .Sf~~ the MC68HC05i8 is a full duplex UART type asynchronous system. The SCI uses st~bf~ non-return-to-zero (NRZ) format (one stati bit, eight or nine data bits, and one stop bit). ~i~h+hip baud rate generator derives standard baud rate frequencies from the MCU oscillator. ~~~tifh the transmitter and the receiver are double buffered so back-to-back characters can be ,1?.,.., handled easily, even if the CPU is delayed in responding to the completion of an individual .tYa~ ~;?: character. The SCI transmitter and receiver are functionally independent,’ but use the same data format and baud rate. SERIAL COMMUNICATIONS INTERFACE MOTOROU 9-1 9.1.1 SCI Two-wire System Features ● Standard NRZ (marWspace) format Advanced error detection method includes noise detection for noise duration ofupto1/16th bit time ,. ~:t.,,,, ● Fullduplex operation ,,*>.,,<3 ,’;.s~.~, ,. ~,,,.: .<‘-f:$.~., ‘.’.““ 9.2 FUNCTIONAL DESCRIPTION A block diagram of the SCI is shown in Figure 9-1. The user has option bits in serial control register 1 (SCCRI } to select the “wakeup” method (WAKE bit) and data word length (M bit) of the SCI. Serial communications control register 2 (SCCR2) provides control bits which individually enable/disable the transmitter or receiver (TE and RE, respectively), enable system interrupts{~%, TCIE, ILIE) and provide the wake-up enable bit (RWU) and the send break code bit (SBK)?Y~~tFOl bits in the baud rate register (BAUD) allow the user to select one of.32 different baud ~Q~~%7 the ,;.*,$<+ *.,. transmitter and receiver. .,t, >,~$<. ,\, ...... Data transmission is initiated by a write to the serial communications da~~$~~~~er (SCDR). Provided the transmitter is enabled, data stored in the SCDR is transferred.to~~ transmit data shift register. ~is transfer of data sets the transmit data register empt~~~f~ (TDRE) in the SCI status register (SCSR) and may generate an interrupt if the trans@~in~&#rupt is enabled. The transfer of data to the transmit data shift register is synchr~#~~:ffith the bit rate clock (Figure 92). All data is transmitted least significant bit first. Up~~$@letion of data transmission, the transmission complete flag (TC) in the SCSR is set (p~~~~,dtno pending data, preamble or break is to be sent), and an interrupt may be generat@~,jf. we transmit complete interrupt is }, 1>*: enabled. If the transmitter is disabled, and the data, ~r$~ble or break (in the transmit data shift register) has been sent, the TC bit will also be ~$~,,$This will also generate an interrupt if the transmission complete interrupt enable bit (TCIE~’~s~t. If the transmitter is disabled in the middle of a transmission, that character will be comQ~$~&%efore the transmitter gives up control of the ,, ‘ ~ pin. ~$.~.$ \\\\. When SCDR is read, it contains the (~$~ata byte received, provided that the receiver is enabled. The receive data register full flaq %$!RDRF) in the SCSR is set to indicate that a data byte has been transferred from the inpgf!~r,ti! shift register to the SCDR, which can cause an interrupt if the receiver interrupt is ena@;fie data transfer from the input serial shift register to the SCDR is synchronized by ther~~’$~&bit rate clock. The OR (overrun), NF (noise), or FE (framing) error flags in the SCSR ma~bq~~t if data reception errors occurred. :- ...).,‘:?,..*.Y An idle line interr&t~s generated if the idle line interrupt is enabled and the IDLE bit (which ,, :,.t~’:, -e>. ..*:*.‘:, {*> ,,.4$., $ - A start bit (logic zero) is used to indicate the stati of a frame. ‘?:?..~~’” ,>$1 - The data is transmitted and received least significant bit first. {~~~’ .,$ .J,., - A stop bit (logic one) is used to indicate the end of a frame. Afra&~onsists of a start bit, a character of eight or nine data bits, and a st~@~t@; ,:;~.. >,,, “ ... ~, A break is defined as the transmission or reception of a.::..i & ldti’~legic ,,$\ zero) for at least one complete frame time. :.1, .::::), ~$.:: ‘,>:,*, . .. ,?4,. :..$!, *,,> ~,.~,,\ *+ . ~-$?, ., :.~< ,...~~ ,,:> “t”<* Control Bit “M” \!>” ~$ Selects ..’?&\,>, %>:* 8- or 9-bit Data $‘*>~\\ :+: ‘it A ,~>a. ~.,,, ,,$ .!.,.. Idle Line , ,,:>. $~ o [1.llllllllllr l’q*i9x 3 4 5 k 7 L o Stax$;> Stop Start ~.!\\)%...::< ,~,!:;~-’ .’. ~,:,...\, %~~”hgure 9-3 Data Format ,\ .t:$,.,,Q ,~$, .{.;,\,. ‘!+$3!, .?+, ‘-$,,,!:~: ~$\<~.>..! * ,,..,.’+ *$\ .:,>, .>?~.:,+.i ,ax,.;i. 9.4 REC~~$# WAKE-UP OPERATION :!*:., “’.< t, The recely~~~o$c hardware also supports a receiver wakeup function which is intended for system ‘ *.*:*it:; ‘k~ng more than one receiver. With this function a transmitting device directs med~~s to an individual receiver or group of receivers by passing addressing information as the j~i~~b~yte(s) of each message. The wake-up function allows receivers not addressed to remain +~.+.?~$,r$ dormant state for the remainder of the unwanted message. This eliminates any further ,, “%$~ftware overhead to service the remaining characters of the unwanted message and thus ‘{$S improves system performance. ‘}. The receiver is placed in wake-up mode by setting the receiver wakeup bit (RWU) in the SCCR2 register. While RWU is set, all of the receiver related status flags (RDRF, IDLE, OR, NF, and FE) are inhibited (cannot become set). Note that the idle line detect function is inhibited while the RWU bit is set. Although RWU maybe cleared by a software write to SCCR2, it would be unusual to do so. Normally RWU is set by software and is cleared automatically in hardware by one of the two methods described below, MC68HC05i8 SERIAL COMMUNICATIONS INTERFACE MOTOROLA 9-5 In idle line-wake-up mode, a dormant receiver wakes up as soon as the RX line becomes idle,ldle is defined as a continuous logic high level on the RX line for ten (or eleven) full bit times. Systems using this type of wake-up must provide at least one character,time of idle between messages to wake up sleeping receivers, but must not allow any idle time between characters within a.:<* message. ~~:, -t).!>. ..,,. ,, ,., xx.-‘,~~ ~:%~~~” ., {~,, >3:$>:+$ ,,;C:. ~’‘~f,. 9.4.2 Address Mark Wake-up ~~~”~‘ ~‘ “~-‘ ,*. .1,.?) 3..~ ‘!,. ~’ ,.5.:,,..~~,. ,..=>,,,... ‘“ *,,:w,~\ ..:,,, >~. In address mark wake:up, the most significant bit (MSB) in a character is used to iR~~c&’ewhether it is an address (1) or a data (0) character. Sleeping receivers will wake up w~%,ever ~ .~,‘F3 an address character is received. Systems u~ng this method for wake-up would s,~,:$w, MSB, of the first character of each message and leave it ‘clear for all ottier characters ‘in M(%k#ssage. Idle petiods .~~,l.:!~t. ~J’ may be present within messages and no idle time is required tiettie:n %~ssages for this wake-up method. .:::*,,,.t”’,t*: .. s.-!<’. ,{, !?..\, ,:, .. ‘:,. .* ,. ,,<::”,,.--.1:<’,’ ~.,{.,. $,. ,.., \ ,\::: .\tx +~k . .)% ,,.,., 9.5 RECEIVE DATA (RX) ,.~’ “ ‘.tl~ ~ \ i:,[.,\,J~ [ !. ‘~,i:i$,, Receive data is the serial data that is applied thr$~$ be assumed with a set noise flag present. * “ .~~\,:;:~ If there has been a framing error without detection of a break (1Ozeros for 8-bit format.,$~$~~eros for 9-bit format), the circuit continues to operate as if there actually was a stop ~jk,~~j~he start edge will be placed artificially. The last bit received in the data shift register is,k~$~sti to a logic one, and the three logic one start qualifiers (shown in Figure 9-5) are forced,.in~{$~e sample shift register during the interval when detection of a start bit is anticipated (se@:/~~ure 96); therefore, +J\>,J4’.i the stati bit will be accepted no sooner than it is anticipated. ~$t’ ‘+’ >.$ ,Fe-Ti,,~“”, ,,\\,~,.,,*~ . If the receiver detects that a break produced the framing error, th~@htiblt will not be artificially induced and the receiver must actually detect a logic one bef~~ th~ start bit can be recognised ,:+,Y.$JJ*+ (see Figure 97). . . .$,:.<, ;.t~-’” ~’~i, ~:*;% I*>:+*.t’~ ‘-:;..:,:,}. ;>, %i. 16x Internal Samphng Clwk RT Clwk Edges (For all tiree examples) ‘$’* 12345678 ,~i, ,,.... !::7 ?7!! Idle ,a!$.t:$,.. ~*!, ‘~k~ Start RX ,.<, ,::,,,.,. ,t! “.$* \’”~’,~ . .< $~, 1111 1~;;f;~$,,.,b 1 1 1 1 0 0 0 0 +:- .,*.x$ .t?~~::.hx .+.,, Start Start Ed e ., ~~~,~.?>,?. Qualifiers Verifimtion ? amples ~~,)i;:” Idle <., ;’~- k Noise ~+,. ~-.:.,.+$::* Start RX ?>, ‘~,?, :, .,$.> .\\,,):/$ ..’~“. 1 3:>,$>:]1 1 1 1 1 1 1 1 0 0 1 0 .*, *,, ,\c-.. ., $ikg?’”’ Noise -a,,~, Start Rx :tii~’’%,,,’”” :~},.+ .J:;i:\\),. .,, ~,*.*? , ‘i.+., 11110111 110 0 0 0 ,..,~:.1 ~.$$$ , ‘--$,i\f! ,,<,~,. ,.,,.,.t.$,/, .,,,:$,, ~,‘:!..$. \.”,.,,, <$:>~. ‘, Rgure 9-5 Examples of Start Bit Sampling Techniques ,+,. MC68HC05i8 SERIAL COMMUNICATIONS INTERFACE MOTOROU 9-7 MOTOROM SERIAL COMMUNICATIONS INTERFACE MC68HC05i8 9-8 MC68HC05i8 9.7 TRANSMIT DATA (TX) Transmit data is the serial data from the internal data bus that is applied through the serial communications interface to the output line. The transmitter generates a bit time by using a derivative of the RT clock, thus producing a transmission rate equal to 1/1 6th that of the receiver sample clock. .~’$il ~,. - “~! +. ‘fs’!’~~’:~’~ ~~~.,. ,+.+.’!. . >,,9 ,,f, ,:,, .\\. 11’ .QJ \ ‘.. ~:,i~ ;\,.i ‘..~+.$, ,::-.>.\i,$~. ~~ “tl<,:h ,>>, . ,4~.>k:.,, >, *$;,l+.: Primarily the SCI system is configured and controlled by five registers; ~~~: %CCRI, SCCR2, SCSR, and SCDR. Reference should be made to the block diagram sh~~.~~ Figure 9-1. ..*:: “~:1> ,, .;..~,yi~’ sT}*!YL\<$> ‘ **>+ 9.8.1 Serial Communications Data Register (SCDR) .&>$$t + .,~<,.,,, ,,. $.J\, !, . The SCI data register (SCDR) shown in the following ~@$~s actually two separate registers. When SCDR is read, the read-only receive data regss~er‘iRaccessed and when SCDR is written, ~f’. , ‘~\,~.\, the write-nly transmit data register is accessed ~:: ...~$t4 j. *. ,* .*,,. .,,.> 7 6 5 4 ,.g,;fi~’ 2 1 0 $W27 I *t$+ I SCDR Reset o 0 0 >,~iy,, o 0 0 0 “~):~.,‘. _.,t,>~~.~j ~~. :.,: ,,,.,;+‘++) ~k;{... .!., *,p,.:+’ 9.8.2 Serial Commu~i@&s Control Register 1 (SCCRI) ,i,t~:r “ The. SCI control reg~,~er :~~CCRl ) contains control bits related to the nine data bit character format and the re~lv~~tiake-up feature. *,*.X> “k!.:,,).f .{* *i. >~.> *.~:}~+s Note: ..&I+~,,5,’2, 1 and 0 are not implemented and always read as zeros. .,.‘ ~~.:>, ~ .<*!>, *! .- .... +~.:.i.fi> .:\,$‘.i.~., ,.,.+,::., “,>,, ,, ; 7 6 5 4 3 2 1 0 ....$ ..it?, * .<, ~i<$,@z4 R8 T8 o M WAKE o 0 0 SCCR1 ,?“ ‘$ ‘“’” I .!, ‘~r Reset u u o 0 0 0 0 0 ‘$,, *.;2i,?tix L,)., .,,:, MC68HC05i8 SERIAL COMMUNICATIONS INTERFACE MOTOROU 9-9 This read~nly bit is the’ ninth serial data bit received when the SCIsystem is configured for nine data bit operation (M = 1). The most significant bit (bit 8) of the received character is transferred into this bit at the sarnetim,e as the remaining eight bits. (bits V7) are transierre~ from th.~ sq~al receive shifter to the SCI receive data register. ,, .,,i ,’~ *:,“$2:, “+,: ~ .~,...a, *4,,i~:i‘ ., ,,,i)iy$*.*. 9.8.2.2 T8 — Transmit Data tit 8 ?.,. .i~k,, -.s{r?.,,$ . .+... MOTOROti SERIAL COMMUNICATIONS ,INTERFACE MC68HC05i8 .9-10 MC68HC05i8 9.8.3.1 TIE — Transmit Interrupt Enable 1 (set) - TDRE interrupts enabled O (clear) – TDRE interrupts disabled MC68HC05i8 SERIAL COMMUNICATIONS INTERFACE MOTOROU 9-11 9.8.4.2 TC — Transmit Complete Flag This bit is set to indicate that the SCI transmitter has no meaningful information to transmit (no data in shifter, no preamble, no break). When TC is set the serial line will go idle (continuous MARK). Reset sets this bit. “$~kf, \ ,!.is, ‘..?.. .,:]. ~<:~-’ ~tt,. ‘;~*\<:$\ *~ 9.8.4.3 RDRF — ReceiveData RegisterFull Flag *:J, ,“:$,+,.s>.:’ ,,,,..,, ~,+.$,,: ,,{:.4 , \ c++,~ ~ This bit is set when the contents of the receiver serial shift register are transferred~~ ~kreceiver ,\~,. ., ,,.. data register. ,$!7, ?+,, k~,t.,.~~ ,~, “,\ ~ k,~i%,,,.<:.$ ~<$ .! .*. w}, t.:+lv,,,.,x 9.8.4.4 IDLE — Idle Line DetectedHag ~~;.i! ‘ \:&‘“+ ~& , “ ~\’ **‘ .,,f,$..,, ~.*,,Ii’ . i~.~~v This bit is set when a receiver idle line is detected (the receip~~~~ minimum of ten/eleven consecutive” 1 “s). This bit will not be set by the idle line cond~~~~$$~tien the RWU bit is set. Once cleared, IDLE will not be set again until after RDRF has ~~hl~t, (until after the line has been ,~.# :.~,,$ ,:,>:J” active and becomes idle again). ,.,‘<\sy#\. ‘“.*”’ ,.:.;y\\ ~..g, .,,.,i~i>, ,, ~ ..,+. ,+. ..~>\, .,q 9.8.4.5 OR — Overrun Error Flag ... $ ~$,:$+*,,,. ,,,\....? ~,a:, ...$,, This bit is set when a new byte is ready to be$transferred from the receiver shift register to the receiver data register and the receive ,~$ta ~egister is already full (RDRF bit is set). Data transfer is inhibited until this bit is cleared. ~,, ‘“~$ $f,$~:.j${-:> ,iqst$’ \ J:. . \,* ..?’< ,tt~’ ~,,,~. ,...., x 9.8.4.6 NF — Noise Errq ,\.~\” This bit is set if there ~~~$~ on a “valid” stati bit, any of the data bits or on the stop bit. The NF bit is set during t~~’’qh$ cycle as the RDRF bit but does not get set in the case of an overrun $~.. ,,, (OR). ,t)>.:+j,yi< .$:; +;, ‘..: ,., .r\:t!NJ.$ *.- ~ ., ,f:,: ~: ~ 9.8.4.7hL$%~,* Framing Error Flag .~.,’ Tht&~~R:;sset when the word boundaries in the bit stream are not synchronized with the receiver +{,~~:$atinter (generated by the reception of a logic zero bit where a stop bit was expected). The FE ~.~~1 reflects the status of the byte in the receive data register and the transfer from the receive ,,,Y+.,,, .~:+, :~, ;,:$:,4, shifter to the receive data register is inhibited by an overrun. The FE bit is set duting the same ~>~:. cycle as the RDRF bit but does not get set in the case of an overrun (OR). The framing error flag inhibits futiher transfer of data into the receive data register until it is cleared SERIAL COMMUNICATIONS INTERFACE MOTOROLA 9-13 ~:t.,,,, .~,+... ,“: ~“::),, ,,.,L*> SECTlON 10 ,.W:“,,‘&*, .?.}.:. ~y:~ *.,$,..! ,. .<, .~<*.~ ,.,...,, . ,~.,s: * t’.<.*\!.*” , .s,,. .“’‘t):,:>> ~!?~t.$ ~ . .,~ \\.+ *:,$ ~$.!i ~,.,,.,.* 10.1 M68000 BUS INTERFACE PIM;*SCRIPTIONS ,, ,, ..\$’ v:’ .,,.>$.. ..,, ‘“J+,>> .J!$$,. 10.1.1 DTACK :$.:,~i,t;i } ,~,$x~... \., .,,.~ ,,,x~~~ q,+ The tri-state active-low opew.~~~~~ata Transfer Acknowledge (DTACK ) output signal is asserted during read and write c~cY@~~ indicate the proper transfer of data between the MCU and the ,? Host. ~,~,>t+ ‘:~.,;,j:). ~i :3+, ,,,,$*’,:\,. .,:.::\~ .,, .,*, .+$ ~! ,.:.*<<~,...,,>’ 10.1.2 I* ~: *I?”,~,,, The a~~~~~f open-drain output pin signals to the Host that one or more of the maskable intew~~conditions is true. >*:~,<$ ‘J$$,,,t, .il:,!.. *:T) * ,1}, .?*.?:,\:j.i*{: ,p:~~*o.1.3 RSI-RS4 :;w-”k” .;.:. The register select lines select the MCU internal registers during read/write operations. These lines are usually driven by four of the M68000 address bus lines. MC68HC05i8 M68000 INTERFACEMODULE MOTOROW 10-1 10.3 INTERRUPT ACKNOWLEDGE CYCLE When the IRQ68K pin is assetied it indicates that an interrupt condition has occurred. This pin remains asserted until the Host responds to the interrupt and reads the data register of the channel which issued the interrupt. .:<* . RS2 W$30ADRW05 e Channel A { D1 D2 D3 D4 D5 D6 07 channe’D{=E*, ‘03DDRwHi Channel D St .s@.- I $~C ISR05 $OC ISRH I - figure 10-1 M68000 Interface Module block diagram MC68HC05i8 M68000 INTERFACE MODULE MOTOROW 10-3 Communication between the MCU and the Host is achieved via four independent transmit >,. MOTOROU M680001NTERFAcE -—------- .------- II F MOnl hAPRQUPnK; ,.,”””, ,“”O, Q ” 10-4 MC68HC05i8 1 .*,* ..1 I I I I I t .>. MC68HC05i8 M68000 INTERFACE MODULE MOTOROW Table 10-2 Host Data and Control/Status Registers ., RS4- Rsl Mt 7 Sit 6 Et 5 mt4 mt 3, Wt 2 .Mtl Wt o Register Name ~ooo . .,, ,. Host. Chanml ~ Data Wtite @DRWH) Host Chanwl B Data Wite ,“ 0001 .:,~.,, (BDRWH) s,,~. ,-,i...,:i:$,,,, Host Chanml C Data ~i{~~ ‘e 0010 (CDRWH),*$:$:*,,$ Host Channel$p ~~,~ffie 0011 (DDW)” ,X1 ,$! I ~1 ‘1 I I I -1 Host. Ch&$A’’Data Read I IUuu nun nHuY nru LL HE(VII Y Iun I n~?t.x I rULL ltNll T “J,-.,.> ‘*’ $,, @SRH) .,:, ,.. ... ~!? ‘:~ Host Channel B Status 1001, ROR RRDY RFULL REMTY TOR; ‘ i\TmY TFULL TEMTY y?$ .(:&. (BSRH): ,.. Host Channel C Statua 1010 ROR RRDY RFULL REMTY .$i~,Tof TRDY TFULL TEMTY ,.,. (CSRH) ... Host Channel D Status 1o11 ROR “RRDY RFULL R@&$’ ‘< TOR TRDY TFULL TEMTY ., ,.~ .,,Lly+! ‘, (DSRH) ., ..,> ,i s ,., . :$;*N:** Host Interrupt Status 1100 RA TA ‘ RQ::~ $(* ‘*TB RC TC RD TD ~J.?,‘ ,’, (ISRH) ~,.?. ‘ ~:.:$,,l Host Interrupt Mask 1101 RMA TMA ~Rd~ ‘TMB, RMC TMC RMD TMD ,.,. ,:, (IMRH) .,.l\i!\ ,.,.,,. 1110 IMOD ,$&,@g$~ o 0 AEN BEN CEN DEN ,Host Mode (MRH) 1111 Unused “ (ADRWO%DDRW05) :i ? MCU Channel Data Read Registers (ADRROSDDRR05) Q>,, ~“~>,,., ,tlrk ~:> $‘,\,\. ,,,\L,], ~k.~::,, Host Channel Data Write Registers (ADRWH-DDRWH) ‘.c:$\\ l:,t::t?ift>+ Host Channel Data Read Registers (ADRRH4DRRH) !$iy .. When the MCU wishes to send a byte of data via channel A, say, it writes that information to its Channel Data Write Register (ADRW05). This information can then be read by the Host from its corresponding Channel A,Data Read Register (AD RRH). Similarly, data sent from the Host to the MCU via channel C, say, would be written by the Host to its Channel C Data Wtite Register (CDRWH) and read by the MCU from its corresponding Channel C Data Read Register (CDRR05). MOTOROU M68000,1NTERFACE MODULE MC68HCQ5i8 10-6 MC68HC05i8 The Read registers and the Write registers are implemented as 4-stage FIFO locations and can therefore queue four bytes of data at any one time. Each byte wide FIFO register has a transmit counter and a receive counter which point at the next available location to be either written to or read from. In this way the data is always transmitted and received in the same order. It is the information transferred in these channels which affects the bits and flags of the Control and Status Registers. “’$:.\,+ ~.., .*,x, .,, 1,2:<..,$ .x,!: .+’ ,.,/: is...:.;\~\,; ,,* ,* ~~y *..‘ ,\~<:, Each pair of transmitireceive channels has its own Channel Status Registg~$haNd between the MCU and the Host. This register comprises four transmit status bits a~d:~~~~receive status bits, all of which can be read by both the MCU and the Host. Figure 10?~~$@~s how these bits are used by both the MCU and the Host. Note that in Figure 10-2, ‘~~&$/fie MCU Channel Status Register (xSR05) bits are shown in their correct sequence. .l$~:r,,, ““ The four bits interpreted as receiver status bits by the M,$~~~~$k, RRDY, RFULL and REMTY) are the same four bits seen by the Host as the transm[W~[ status bits (TOR, TRDY, TFU LL and TEMW), and vice versa. Therefore, when the MCw~[anshits, the status of that transmission is available to the MCU in the transmitters tatus ~~~~f khe xSR05 and to the Host in the receiver status bits of the xSRH (see Figure 10-2). S;~~@~~?when the Host transmits, the status of that transmission is available to the Host in the tra~mltter status bits of the xSRH and to the MCU in the receiver status bits of the xSR05. \*,,,j$,,< .. ;’ .!:, .,;;,, \ 7 6 5 ,, .!$$&,,,““ 3 2 1 0 Channel Status ROR RRDY RF~~~:t~ :@~MW TOR TROY TFULL TEMTY Register A-D Reset o 0 ‘,f&$’J’” , ‘ o ‘ o ‘ ~ ‘ , “ ~{.t,‘:$+ .~7~:~.$y,! .\,.:,.,:) ,,,.,.. L(j*y ~> O (clear) - No overrun has occurred. +... *), “*;Y ..>~,.~, ‘!2:,,;\4\ >’ .. MC68HC05i8 M68000 INTERFACEMODULE MOTOROM 10-7 REMTY — ReceiverEmpty (MCU) TransmitterEmpty (Host)—TEMTY This bit is the complement of Receiver Ready. It is set on reset or when the MCU reads the FIFO, leaving it empty. It is cleared when the Host transfers a byte to the FIFO. If an attempt is made to read a FIFO when it is empty, the data will be undefined. ~:t.,,,, 1 (set) - FIFO is empty. as%$>~~>”) $:*“f$~’”” ,i>.,@\, O (clear) - FIFO contains data. ,,, ‘.~.. \ ,,x ‘$*,,:*? ,,,?, , 1,. ,,&,>,, ...s TOR — TransmiUer Overrun Error (MCU) ReceiverOverrun Error ~@~~&~ ROR ...:.,? ,,, .>.~$;,.>.., This bit is set when the MCU sends a byte to a FIFO that is already full. It is d~a~d on reset or /:k when the MCU reads the corresponding Channel Status Register, m~, ~ ~-’<. ..>.. .,;:,. ~. ,.:,.,,, ~, \:a \,.., 1 (set) – Overrun has occurred; one or more bytes in the,~~]~’~?ream have ,,.!~t. ,,.,>., .,.~’~. been lost. ‘j:r ~.13L\ .,?;, ~.,.~ !,! O (clear) - No overrun has occurred. .:.:?,.:,* .**,., ~~ Jy”‘“i,i+~. ~.,, TRDY — Transmitter Ready (MCU) $“*>, .~$:’heceiver Ready (Host)— RRDY *L~k, This bit is set when a byte is transferred by the MG&~&ottie FIFO. It is cleared on reset or when the Host reads the .Iast byte of information from &“&El PO, leaving it empty. $1 ‘...l..,.l.i(}.:’f 1’ (set) - A byte is waiting in the *“&to be read by the Host. .<> 0 (clear) – No byte waiting; Q+FOis empty .+,:“’~v~. ~.i, .* TFULL _ Transmi~er Full (MC~fl./12s’ ReceiverFull (Host)— RFULL :~:<,, ~>,,.., This bit is set when a byte ~~~$~~&ferred by the MCU to the FIFO and the transfer causes the buffer to become full. It iq~~;$d on reset or when the Host reads the FIFO. ,,.,,~~ *. ~>;l$.+,, 1 (set) - e,+~~,f$ur FIFO register positions are occupied. ,:tT ‘“%: O (clear)~~~$x@~FO is not full. %<,.;; .,.,, ‘\$$,. TEMTY ~~ysmi~er EmpW (MCU) ReceiverEmpty (Host)— REMTY .y ~~,~ This ~~~~}’~e complement of Transmitter Ready. It is set on reset or when the Host reads the traik&-k’”~lFO, leaving it empty. It is cleared when the MCU transmits a byte to the FIFO. If an %,,{lte~~t is made to read a FIFO when it is empty, the data will be undefined. ,~ .,.,““ .*:,*, *$*..,:,>>,. ~,&b. 1 (set) – FIFO is empty. /’;\;p >,,.\,m,, .5,....,,,.. ‘+? ~,t O (clear) – FIFO contains data. MC68HC05i8 M68000 INTERFACEMODULE MOTOROU 10-9 10.4.3 MCU Interrupt”Status Register ‘....,, ,.. ,. (ISR05) Host Interrupt Status Register (ISRH) This read-only register serves as the MCU Interrupt Status Register (ISR05) and the Host Interrupt Status Register (ISRH). Just like the Channel Status’Register bits described earlier in this section, the Interrupt Status Register bits seen by the MCU in ISR05 as receiver bits are seen by the Hostj, as transmitter bits in ISRH, and vice versa. Figure 10-3 shows the relationship between tNR*:k.> transmit interrupt status’ bit TA and the receive interrupt status bit RA as seen by the MCUa{~~4s the Host. These bits are set and cleared according to the status of the transmit and rece~y~~~~?~s and the criterion selected” by the ‘IMOD bit in the MCU and Host Mode Registers (~~’$~$tions ,,.y.~ .,\,<*,):.;\i:.i\ 10.4.5 and 10.4.6). ., .”, .:,:,,..., >{ \ ‘+,, “’::$,~!~” ::~l.c:j.. ,, ..,,* ,Jw,t ;.!,, MCU Adion lSR05\ ISRH ~~$?Action ‘$’:~’: :,.t..>~>, > ~ Read from FIFO RA ; TA .~~a ~,,:~ .‘t!Send t>f, ..>, to FIFO 1 Send to FIFO ~ TA I RA - Read from FIFO ,, ,,f !\,+:,,\,.,*!’ .:.,.,c.~: ~,”,$lf: ‘s&t (to 1) ,,,., ~+, ~ clear (to 0)” Note: The MCU IMOD bit ‘selects the crit.~~b}~f$r ,.$::>..4.}: -setting and clearing the MCU RWHost TA bit. The HOST IMOD bit selects ‘Me criterion for setting and clearing the Host RWMCU TA bit. All bits are rea~ on$,’ . “’3%. +‘t.,.,\k}.,, Figure 1~:> Interrupt Status Register ~’,.,*.. ,,/F , .>t;’”~<,,. L*+$.~ 7 6. 5 .Q:),$~y ~’$**’’&ti 3 2,.1 0 RA TA Interrupt Status Register ,. Reset o 0. i%,,..:!>W ;.,t.y$la, ‘:0 o o’ “o o 0 4 :s ‘$,, ,: ~,$,.m% ~*!)..j$”., RA-RD — Recei@~~-D (MCU) Transmitter A+ (Host) —TA-TD .,, ..e> When the 1~’$~$it in the MCU Mode Register is set, the R~x bit will be set when RRDYflRDY IS set, i.$~~~~g~teis transmitted from the Host to the FIFO. It is cleared when the MCU reads the last bytx#&~fnformation from the FIFO, leaving it empty. .$>:$\,~,< ,,, ,~@,N?the IMOD bit in the MCU Mode Register is clear, the Rflx bit will be set when t,~~~L~FULL is set, i.e. a byte is transmitted by the Host to the FIFO and the transfer causes the “$/~lFO to become full. In both instances, Rtix set indicates that data has been received on channel x and is waiting in the FIFO to be read by the MCU. This information is used in conjunction with the mask bits (R MA-R MD~MA-TMD) in the Interrupt Mask Register,to determine whether or not an interrupt will be issued to the MCU as a result of the data being received. Further explanation of how this register operates is given in the Interrupt Mask Register description. MOTOROLA M68000 INTERFACEMODULE MC68HC05i8 10-10 MC68HC05i8 TA-TD — TransmitterA- (MCU) ReceiverA-D (Host)— RA-RD When the IMOD bit in the Host Mode Register is set, the TtiRx bit will be set when TRDY/RRDY is set, i.e., when a byte has been transmitted by the MCU to the FIFO. It is cleared when the Host reads the last byte of information from the FIFO, leaving it empty. When the IMOD bit in the MCU Mode Register is clear, the TtiRx bit will be set ~$~, TFULURFULL is set, ;.e., when a byte is transmitted by the MCU and the transfer causes t&~$EO ~1, ~:~t .. to become full. ~%t4+‘.i~” ,+...F>.,. ..>., In both instances, Tx set indicates that a byte has been transmitted on channel x ~~~~$&CU and is waiting in the transmitter FIFO to be read by the Host. This information is ~~~J$~’””conjunction with the mask bits (TMA-TMD/RMA-RMD) in the Interrupt Mask Register t~ d8~@~minewhether or not an interrupt will be issued to the Host as a result of the byte beinq.~~wbitted by the MCU. Further explanation of how this register operates is given in th~~$~~$?rupt Mask Register “it.,;”>.$>.. ~ description. ~$.::~, .>:~k.: ,-, ,.$J~:?‘“ \*+/\a,.3*.!*, .,,,,$, .~~..\.,,,,’ ~: .\$ ~ ),,,:,, 10.4.4 MCU Interrupt Mask Register ,,i~. ‘w~k<,,$ (IMR05) ,+.~’ ,~f.$~ Host Interrupt Mask Register .,,* -, This read/write register serves as the Host lnterr~p?~ask Register (IMRH) and the MCU Interrupt Mask Register (IMR05). As with the Cha@$;:,~~atus Register bits and the Interrupt Status Register bits, the Interrupt Mask Register blt~seen by the MCU in IMR05 as Receiver Interrupt Mask bits are seen by the Host in lM~~&asTransmitter Interrupt Mask bits, and vice versa. As an example, Figure 104 shows this,:r~~t,lmship between the Receiver Mask bit, RMA, and the TransmitterMask bit, TMA, as @’@*&~’the MCU and by the Host. ,,.~J$’+ ,, ~$>)., ‘J~+ ,.l!~* As shown in Figure 104, t~~~;~$~lver Mask bits can be set or cleared only by the device acting as the receiver on that ckaq&~The Transmit Mask bits are set or cleared as a result of the other device setting or cle~i~~’’own Receiver Mask bits. ,.,$: i~~t ,,...:,$v:>i~~ 7 ,*Q).;,, $ 5 4 3 2 1 0 Rtikh+ $ TMA RMB TMB RMC TMC RMD TMD Interrupt Mask Register Reset ;$.~:~;s o 0 0 0 0 0 0 ~l,.!l,<,,p>, {t:, .{...,1,> ?.-.:~>,, ;:; , .. ~$:\ ..P~:,,.. ,,>k~~. ~~.,~i, ~ Read ReadWrite I I Figure 10-4 interrupt Mask Register MC68HC05i8 M68000 INTERFACE MODULE MOTOROLA 10-11 RMA4MD.— RaoeiveMask A4 (MCU) TransmitMask A-D (Host) —TMA-TMD The RMx bits are the read/write interrupt mask bits for the four receive channels. The RMx bits should be set if an MCU interrupt is required whenever the Rx bit becomes set, i:e. on receipt of data on channel x. When RMx is set, the corresponding read-only TMx bit in the Host Interrupt Mask Register is set, thus informing the Host that transmitting data on this channel can interrupt the MCU. ..’$:.1, \~$~,,’.i:,:$,i 1 (set) - h MCU interrupt will be asserted when the corresponding Rx flag ~~~ ~~..~t~ .,.*..... in the ISR05 becomes set. ,$..‘“:~?.>’~’ ,$,>., ... . ... . ,, ,,.,}?. q: O (clear) - No MCU interrupt will be asserted regardless of the state of,t${~&w ,, f,,~$-)‘, ‘....%, ~} ,!,’ -: >?, ,’ .*{. .>. TMA-TMD —Transmit Mask A4 (MCU) ReceiveMask A-D.,,~’&~ — RMA-RMD ~..,.,:. : The TMx bits are the read-only interrupt mask bits for the four trans~l,~~~a~nels. The TMx tit in the MCU Interrupt Mask Register is set when the correspond~$+.@ M. fit in the Host Interrupt Mask Register is set. These bits indicate whether the Host wL[P@+nterrupted when the MCU ,.,$,,,.’. .>’*:,.3} transmits data on a certain channel. ~ .}.&:*,*..J’l ,,@~’” .),)! >t,:~. 1 (set) - Transmitting data on channel x wwcatix ,,t~>k a Host interrupt to be generated when the Rx flag in?~p’~st Interrupt Status Register ‘p ,. becomes set. *~.\, S+it>,ti,> .:$:!:.+,:,:*:. O (clear) - No Host interrupt will be a~erted regardless of the state of the Rx flag in the Host Int~$~pt$tatus Register. ,, .$:.,.:~,, ,,,. .>. i~}l$$,$,,~~l .:$$,$“’+,. 10.4.5 MCU Mode Register~~~%) .?., J ..~ ;..: },,,, .:,,~, ,. $.:~\ .>s,?:i. . 7 6 ,,{,~!i$~ 4 3 2 1 0. ,.:,,.,- $~3E IMOD $,.a,$:\t,*..$o o AEN BEN CEN DEN MCU Mde Register Reset o >tw\;~!,4,+ o o 0 o 0 o !,..,,~,, ,. MOTOROU M68000 INTERFACEMODULE MC68HC05i8 10-12 MC68HC05i8 AEN, BEN, CEN and DEN — Channel A, B, C and D Enable In order to read from or write to a channel its enable bit (xEN) must be set. 1 (set) – Channel x is enabled. O (clear) – Channel x is disabled. .:<* ,,.. ~:..u ~’,+$< ,,..:.+*~$‘. ,,.\\:> $. ,.?... \ i:~,,,s,,,.. ~,:/,., .<.$+..., :.’ 10,4.6 Host Mode Register (MRH) ,...,>,.> \,$, \, :.,,>.t:: ,~, ., {$* ‘‘ 7 6 5 4 3 2 1 0 >N:~c.~’ ,>$.> \}\,. ,:$ $CODE IMOD FCLR 0 0 AEN BEN CEN DEN ~S We RegiSer I “.... i1,. Reset o 0 0 0 0 0 0 Q, ‘.k~p .. ,x\.. ~‘. ‘.k. ,*,* ,. ,.;>$ , ‘<:‘**~” l:..y:y.ai?>rt, IMOD — Interrupt Mode ‘-+:.. ,.e.tl$t This bit controls the criteria by which the Host Interrupt Stqt~}@~tiister (ISRH) flags are set. *4 !x\,.,::’ 1 (set) - Rx and Tx bits in ISRH will be set a<~g~fig to the “Receiver Ready” and “Transmitter Ready” crite~@ respectively. $ ‘*!l{,., O (clear) - Rx and Tx bits in ISRH will i$e~et according to the “Receiver Full” and “Transmitter Full” q~~~~respectively. *. \&. ..:, FCLR — FIFO Data Clear ~,.,{; ... “.:. MC68HC05i8 M68000 INTERFACE MODULE MOTOROU 10-13 This section contains the electrical s~ecifications and associated timina ~~d~~;tion MC68HC05i8. I Rating ~$~?%l l’” Value -0.3 to +7.0 Unit v ,,. .... -- ) to v I .,,. .\: I I .DD r J.3 TL to TH .C o to 70 ge TStg –65 to +150 ‘c ... ..... Currenk *A~ber pin (note 2) ,0 _ ~xdu~&vDD ~n~“~~ 25 mA ,,,, ., — 1 1 I 1 I ?f~ -+ ,.,,1> .*. ~, ~’sb$):h;.sc2* Note 1) All v$j~~~q$ are with respect to VSs. ... Note 2) ~a~dm current drain per pin is for one pin at a time, limited by an external resistor. ,.:tt, ,+,\* Note 3) ‘:i:%,&& device contains circuity designed to protect against damage due to high ‘Jt~’+’\electrostatic voltages or electric fields. However, it is recommended that normal ‘i!, .,5,i:~$i,,. ‘~“ precautions be taken to avoid the application of any voltages higher than those given >,>*! ,:\.* ,A + ,/ ~ $:’:‘\~ .:,+ in the Maximum Ratings table to this high impedance circuit. For maximum reliability ,l:+.Rle,,:e ,,<:,- \.. .,>.’., -J:+t- .. all unused inputs should be tied to either Vss or VDD. .. (:!:.’?. ..~‘‘ :::%,,.>~: ~,, MC68HC05i8 ELECTRICAL SPECIFICATIONS MOTOROW 11-1 Table 11-2 Package Thermal Characteristics Characteristics Symbol Value Unit. Thermal Resistance eJA ’50 “Cw ““*,!,< - Plastic 64+in Quad Flat Pack (QFP) .’~~.,, .{,t:~$ .,,,>s~ ~-~,? 6.*J ?y4.J>.,,1 Point — ~\,~~ ?--- .~~, All Port Hns, DQD7, 3,26kQ 2.38M 50pF c IRQ68K & DTACK Hgure 1’1-1:, Equivalent Test Load MOTOROLA ELECTRICALSPECIFICATIONS MC68HC05i8 11-2 11.3 DC ELECTRICAL CHARACTERISTICS Table n-3 DC Electrical Characteristics ~DD=5.0 vdC*lo%, vss=ovdC, TA=TLtOTH) ----- I Port A- Port F I Input High Voltage 1 v,~ 1 0.7VDQ ‘~p I ,.$...’”,. 1— ,,!,... v Input Low Voltage ..:. \r .. !.. t ,0.2VDD All ports, OSCI , ~ & RESET I ‘IL l$f~~,%,{ , – .,. kh. y.> Output LOWVoltage (ILOAD=’+1 .6 mA) ,. : ‘$.<>’”$:” —— ‘%?’+ – “– 0.4 v DGD7,0SCI, IRQ68K &DTACK ,,, “:” ‘L Input High Voltage ,? ,~~,’!.\ *?J v IH 0.7VDD — — v DGD7, RSI-RS4, E&j.* Input Low Voltage +$j., ,,.:~, ,, \,.~?t\ \.. .,.1. -.J.>: .$ V,L — — 0.2VDD v D&D7, RSI-RS~)>@$$RW68K Supply CurrenJJS’%,.*tes) IDD v Hys~ — “1.U — v ~T, ~ MC68HC05i8 ELECTRICALSPECIFICATIONS MOTOROM 11-3 Note 1) All IDD measurements taken with’ suitable decoupling. capacitors across the power supply to suppress the transient switching currents inherent in CMOS designs (see Section 2.1 ). Note 2) Typical values are at midpoint of voltage range and at 25°C only. Note 3) RUN and WAIT IDD: measured using an external ,. squarewave clock source (fop= 2MHz); all-inputs 0.2 V from rail; no DC loads; maximum load on outputs 50PF$,:,, .<.,.:> ~/,, (except OSC2 load 20pF). ,,..,,t>i.,,. ..:..,. Note 4) WAIT l~D: only the timer system, active; current varies linearly. with th~,fw ?,?,...\i ,. ~ ,7, ,L>i,, capacitance. ~ ; !- ~- ...‘ \~>.. i,.,,’. ~:~ ,,, Note 5) STOP and WAIT’lDD:’all potis configured as inputs; VIL = 0.2 Vand VIW~~~$#- 0.2 V. ,. ,. ‘a’.. “’l!>.*\i.’ . Note 6) STOP IDD: measured with ”OSC,l = VDD~” ..:$,, >* t!, e.,+\ ,, ~:<“**t.g\\ ~, ,, ,,8.,,:,, ~~{! :i\~4+$+: ,, ...,~,, :*~;@bJ: ,! 11.4 AC ELECTRICAL tiHARACTERISTICS *’* ‘“ ,~>:>:~.w ‘ ,’ ~<~.+.},,, .&$,, , ,, .’ ~+:+y,,,f~ Table 11-4””AC Electrical, Cha%enstics” L, (VD~= 5.o Vdc * 10%, V5s = O VdC, TA = TL to ~$~~~y ,.. . . ,’ Characteristic ! sfie~$~ Min Max Unit’ ,YF Frequency of Operation ,.. . .,. crystal ., ~ f~~c - 8.0 MHz % External Clock ‘ \>@,. :{, *,, ,~, f O$c .1’ dc ,16.0,, dc” ‘2.0 MHz Processor cycle time ns Crystal Oscillator staKu~j~$” toxo” — 100 Ms *$!. p: — RESET~ulse widt& ‘“* : %L 1.5 kYc MO,TORO,W’ ELECTRICALSPECIFICATIONS MC68HC05i8 114 11.5 M68000 INTERFACE MODULE -AC ELECTRICAL CHARACTERISTICS 11.5.1 Host Read Qcle Bus Kming Table 11-5 Read Cycle Bus Tming ELECTRICALSPECIFICATIONS MOTOROU 11-5 RW68K t—’ ‘i I i iJ_, I \i 11.5.2 Host Write Cycle Bus Tming Table 11-6 Write Cycle Bus Timing Characteristic I Svmbol 1’ Min Max I Unit C= Setup Tme to CLK68K High 90 —- ns %Sc 10 — risk ~ RSI -RS4 Setup Tme to ~S Assetied bss ‘.~,’ t~s- 10- — ,%‘?~’”~ ‘ RW68K Setup Tme to ~S Asserted ,. s ,,. ,$..! 130 - .$*““” ‘*’ti;‘!y,tis ~S Pulse Width Asserted ksWL .,’.’.. ~ ..,. ,.l~. Data Setup time to CLK68K High %s 50 ,,:~,h ns DTACK Asserted from CLK68K High tDcw — .tt~:~%”’” ns .:<,.:.,,, — ‘ s<, ,, ~.. ~S Asserted to DTACK Assefied t~sDT l..]~,,~t$.$ kYc ~S Negated from DTACK Asserted tcs~ ‘ : ns ~,.%;’” RSI -RS4 Hold Time from ~S Negated tRSH d ~’ $ :>:,h,+%%, - ns X ~ ns RW68K Hold Tme from ?S Negated .,. ~,t~, ‘“s. 10 — ns Data HoldTme from ~S Negated :x D$ ] \ ,~r... . Data Setup time to ~S Negated “ ‘g:kscs – 50 ns DTACK Negated from ~S Nega$~i: ‘“> tD*~ — 50 ns DTACK Hi-Z from ~S Negat~:s$’$*” tDAT — 75 ns ,,’+.,..\ .:, C—SNegated Pulse Wid$~~J&$ tcsw~ 70 ns ..~.:* CLK68K frequency ~$k,~,$<$” kLK — ; 10 MHz ,!::},,. ,J$.>$\.~. MC68HC05i8 ELECTRICAL SPECIFICATIONS MOTOROU ‘11-7 MOTOROU ELECTRICALSPECIFICATIONS MC68HC05i8 11-8 12.1 m Plane ,-, F B @ -L rp — 1 ? Metal Sect,on 8-B figure 12-1 64-pin QFP Mechanical Specifications MC68HC05i8 MECHANICAL DATA AND ORDERING INFORMATION MOTOROU 12-1 Table 12-1 M-pin QFP Dimensions I m,-. I ... - 1 . .. .. I ., ...’. lead where the lead exits the plaatic.body at the bottom of ~~$~a~g ~ :~uld~otrusion. ,>:., Allowable 12.~ REF I protrusion is 0.25mm per side: ,DJK~~w@ns A and B do include mould mismatchand are determined $t D~urn Plane – H –. M 6° .’ 8“ ,. +,.,;o~$ )1?: :,>,. N 0.143 ,0,157 , 7. Dimension D does not><,,) Mclu%&dambar ;.\\ protrusion, Allowable dambar P 0,40 BSC ____ ] prolrus ton shall be 0.0% total in excess of the D dimension at ,,.>,.,,, Q 2“ 80 maximum materi~” ti~dtion. Dambar cannot be Iomted on the lower radius or the f,o&~’: ;F ~$J:.,$,,i*:>N R 0,13 0.30 .!:.:l. s 16.20 16.60 .. MOTOROU MECHANICAL DATA AND ‘ORDERING INFORMATION MC68HCd5i8 12-2 12.2 ORDERING INFORMATION This section describes the information needed to order the MCU. To initiate a ROM pattern for the MCU, it is necessav to first contact your local field service office, local sales person or Motorola representative. Please note that YOUwill need to supply details such as: mask option selections; temperature range; oscillator frequency; package type; el~~;~ test requirements; and device marking details so that an order can be processed, and a &~+w’er .. ‘‘;\:,,. ‘ >>***,..+..,:,., ~*:h~,) The EPROM should be clearly Iabelled, placed in a conductivq~$:egpfiier and securelypacked. >*-, t:<$, ‘“.,*, ,+ ,:SS*> ~, : .~.”:.$ ,,\$~’ ,.,Ji~Y*: f‘ 12.2.2 Verificationmedia “’!::>, ~$$)::,‘“ All original pattern media (EPROMs) are filed f~~~%ractual purposes and are not returned. A computer listing of the ROM code will be gen~{&@@ and returned with a listing verification form. The listing should be thoroughly checked’$~~~ the verification form completed, signed and returned to Motorola. The signed ve,r~fica%n form constitutes the contractual agreement for creation of the custom mask. If des\{~t,Motorola will program blank EPROMs (supplied by the customer) from the data file usej ~i*ate the custom mask, to aid in the verification process. . ‘~:J?> $::,,8.’”,. .>,+, “.’:,,<,\” 12.2.3 ROM Verificati,~~~ti$s (RVUS) ,\\ ,,3”” .,*, , ‘:+,$,, .,*., Ten MCUS containingf~acustomer’s ROM pattern will be provided for program verification. These units will he~~~n made using the custom mask but are for ROM verification only. For expediency, tw.~~s’usually unmarked and are tested only at room temperature (25°C) and at 5 Volts. Th$se’’R~Ws are included in the mask charge and are not production parts. They are neither b~w~d. nor guaranteed by Motorola QualiW Assurance. }$, w.,.* ,~..,~ .!,~t-?-:.>..$$ . ‘.+,$ , ,, l~k> MC Order Numbers MC68HC05i8 MECHANICAL DATA AND ORDERING INFORMATION MOTOROM 12-3 MOTOROU MEC AND ORDERING INFORMATION MC68HC05i8 CUSTOMER FEEDBACKQUESTIONNAIRE — MCWHC05i8 Motorola wishes to continue to improve the quafity of its dwumentation. We would welcome your feedback on the pubhcation you have just received. Having used the document, pleaae mmplete this form (or a photocopy of it, if you prefer), How would you rate the quality of the document? Check one kx in each category. Ex-llent Poor Excellent Poor ~:t.,,,, Organisation ❑ oon Tables ❑ ❑ ❑ ❑ .J~$$%+ Readability ❑ oon Table of contents ❑ ~ ❑ ❑ > .f:., :$*:\~,..i\ >$$; System design ❑ .l~. $, +,!~.< ‘ Training purposes ❑ ,,$:,. ,,,,:., .,,“i\\+,$,, . ..0. ~,t.$ *, y:? \ How well does this manual enable you to perform the task(s) outhned i~q~$:~an 2? .,,..\,,i.\- Completely Not at all Comm@nt*.% ,. Q ❑ ❑ ❑ ,{$’:,. .8~’ ..,, ?.). How eaay is it to find the information you are looting for? ?k ‘.,>,$ .,.....:,~. Easy Difficult ““$qp~~ment~ ❑ ❑ ❑ ❑ ,, ,, ~,;}t.>,, IS the level technical detail in the followiW,~~{o~s of auffident to allow you to understand how the device functions? <-<.,..~.! ~,ijii~ *,’ . $,1, Too little detail Too much detail ..’$! s, .(* ~,. ~,~..,,ii‘ Section 1: Introduction S*?:?.,, ~f,, ,\$, !\;, .. ~,.,,.,. .... .~:t*.., ❑ 0000 Section 2: Functional Pin Descri~Q$:/! ❑ nnnn $?. .,: Section 3: CPU Core and l~@~U~~,#Set ❑ nnnn Section 4 Resets, lnter$W:&$~#h Low Power Modes ~,.,’ ‘\/. ❑ nnnn Section 5 Memo~c~@kQ,@isters Dnnnn Section 6 ParalleF3sp*/Output ,, :,,:$ ,k POtis ❑ 0000 Section 7: P@~ammable Tmer ❑ nunn SectionQ; ‘@2&*f~mer $:’$.\? ❑ nnnn Sea&: Serial Communications Interface ❑ nnnn , ,;,~ “*!?’ .l&,,j,{> Section 12: Mechanical Data and Ordering Information ❑ 0000 .\~ Comments: .-. ,,, 6. Have you found any errors? [f so, please comment 7. From your point of view, is anything missing from the document? [f so, please say what 8. 9. 10. 11. 12. CUSTOMER FEEDBACK QUESTIONNAIRE — MCWHCOH8 Motorola wishes to continue to improve the quah~ of its documentation. We would welcome your feedback on the publication you have just received. Having used the document, please mmplete this form (or a photocopy of it, if you prefer). How would you rate the quality of the document? Check one box in each catego~, Excellent Poor hcellent Poor Organisation ❑ oun Tables ❑ ❑ ❑ ❑ ,~:$i,. Readability ❑ 000 Table of contents ❑ ❑ ❑ ❑ ,fr;?y Understandability ❑ODD Index ❑ ❑ ❑ Qt>$,.F Accuracy ‘ODDO Page sizefinding ❑ ❑ ❑ ...: 5$ Illustrations ❑ 000 Overall impression ❑\@#’@’”’ ❑ ,$ ‘1$.. Comments: ~~:. ;L< ~:~,: i,. .. ~ .~:$, ,,’~1 What is your intended use for ttis document? If more than one option applies, please ran$~~~$%, 2, 3). Selection of device for new application ❑ Othern Please spec~~$~i’ ,,.-”; ~.f,.~ System design ❑ .\.,,.,. ,,. . : ... ~..+*.L ~~:... Training purposes ❑ ,8,/;,, $?:.\\,,\>, \:Xi. s How well does this manual enable you to perform the task(s) outhned in qfles~~~ 2? ,. .4!,:.. ,,,.:,,, >* Completely Not at all Comme*;~ “ ~+.l, ❑ oun ~,;?~ ~ ., .}%$$, .$+’: i:y..i How easy is it to find the information you are looking for? ~ ~, ,? Easy Diffmult ~$~~~rn”ments ❑ 000 ,,$” ,,:t’ Is the level of technical detail in the following-~{~ns sufficient to allow you to understand how the device fundions? .i:*:$*i. ,1~, Too little detail Too much detail ,,: ,,,.. *’.? Section 1: Introduction ;~~ :R..,. ,, %,, ~$$ ..\\,.,!, ❑ DOOD Section 2: Functional Pin Descripi~~,~i >, ..$$. .-,! ❑ 0 DUO Section 3: CPU Core and lnst~~$~ ,$?.. -!s,$ set ❑ OOOU Section 4 Resets, Interru#s a~&low Power Modes ❑ OOOD Section 5 Memo~ a~’<~~~ers ❑ DDDU Sedion 6 Parall*~~@?~tput .:, Ports ❑ nnna Section 7: Pf@ra%~~le Tmer ❑ 0000 Section 8~$~#~mer ❑ 0000 Sedi~~*.~~;al Communimtions Interface ❑ 0000 SAF*~Q M6BOO0 Interface Module ❑ norm ##e~n ~t,. 11: Electfiml specifications ❑ nnnn ,,:,.. ‘N* ~dion 12: Mechanical Data and Ordering Information ❑ OODD \,+,‘~:;]+, ,**, Comments: i.. .. ..... , 6. Have you found any errors? If so, please comment 7. From your point of view, is anything missing from the document? If so, please say what: ,. ..q :, ;% E: l% 0, ‘ti*PONsE PAYEE ,Ir g. 2: ,,~,, 6RANDE-BRETAGNE ~; $;. *<,*,* :15>,;, >:,, , m, +t~~y ... Id $: ,,, ~.? ,,*:> ~.>+ ,*.$ , Motorola Ltd. I ~. -I :\.\\j,\,..;”~,, ,.~ ,:, :! ‘.:,,..;, ~\. Colvilles Road ,%. -j;y,j$:,ly $, ,$, i., ,. Kelvin Industrial Estate II ,.!; -a}k“i. 1, .,$.q?, EAST KILBRIDE I Vb,<>* GREAT BRITAIN I ,,~ . .. @ ~.., ‘$? I . ,,’..,, G758BR . “.’’~><>~”~~)~) - I MOTOROLA LTD$ $ I Semiconductor Products6&WJ~ Attn: Technical Publications Manager I ~v ‘~:“(.,R.F\# I -a ,*:. ,,.3 ‘s I .*;;. ~.+’,$:k,>:$~’ I -——— ———— —— —~*\~’*’—— —————— ————— ————— ———:: ————— ————— ————— ,—— —— - —+ *.\x.%,.. .s.hv* - Third fo/d back a/ong th)s /me - .. . ‘ ‘ ~~.>,‘“ 1’ 13. Recentl~{h~$Jbs been some discussion in the semicondudor indust~ regarding a move towards providing I data @e~Jn elearonic form. If you have any opinion on this subjed, please comment: ‘1 ‘ ~i..<,.,,[ ~~~;t,.i:\= t! ,:,. ,1 >i..,:{{,.>, I -*fii\ I l~~~e’would be grateful if you would supply the following information (at your discretion), or attach your mrd, I I ~’Name Phone No I Position: FM No: I I Depatiment: I Company: I I Address: I I I Thank you for helping us to improve our documentadon. 1 Graham Livey, Technics/ Pub/icstions Manage~ Motorola Ltd., Scot/and, I I I I I I I - Last tuck thjs edge into opposite f/ap – Literature Distribution Centrer: EUROPE: Motorola Ltd., European Literature Centre. 88Tanners Dwe, Blakelands. Mtlton Keynes. MK14 SEP. England. ASIA PACIFIC: Motorola Semxconductors (l4.K.l Ltd., Silicon Harbour Center. No. 2, Da, K,ng Street. Tat Pa lndustr,al Estate. Ta, PO. N.T.. Hong Kong JAPAN: Ntppan Motorola Ltd.. 4-32-l. N,sh,Cotanda Shmgawa-ku. Tokyo 141. Japan. USA: Motorola Literature D~stnbutm. P.O. Box 20912. Phaenu. Aruo~ 85036. MOTOROLA P”“lec /n maa, Bnmn b/Ta.,rloc* Pmll(8tdbre) Lid ---- --