M66240P MITSUBISHI | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 16
Technical content
MITSUBISHI <DIGITAL ASSP)> 4-CH 16-BIT PWM GENERATOR
DESCRIPTION
The M66240 is a programmable channel PWM generator PIN CONFIGURATION (TOP VIEW) produced using the silicon gate CMOS process. The M66240 can connect directly to the MPU data bus and | oH Vee consists ofa te prescaler and a PWM counter, The | ofa [es] pwarr eves output itput it e: Is = pulse output includes three kinds of modes, allowing the in poo STAG! Taggee put dependent control of each channel. Combining the A-D - o3s— [4] —* PWM2 PWM output 2 function and the timer function of the one-chip micro- ‘oan | pa z ba] y computer provides a software servo system me g ZO} TRG2 Trager input 2 os—[é]} RQ [19] Pwé3 PWM output 3 FEATURES Dé-> 3 [18]+-TRG3 Trigger input 3: © 4-channel independent control possible o-Bl 3 = PWM Pun output 4 © Three pulse output modes incorporated. Vena como WR [3] [16] TAGS Trigger input + © PWM repetitive frequency : 50kHz (max.) Sonat moat C/O — [ro] + RESET Reset input (Mode 0, 8-bit resolution, fxin/255 at prescaler setting= ci gelect cs—{i] -% Clock input 0) GND [13] x. Clock output © Output polarity selection possible @ External triggering possible 24P4D. © The output after reset is in the high impedance state. Outline 5 spow-a © Change of mode setting becomes effective after the current cycle. @ The RESET incorporates a negative-going noise elimi: FUNCTION nator and the TRG1-4 incorporates a positive-going Four separate 16-bit prescalers and 16-bit PWM counters noise eliminator can be separately programmed by the control instruction © High output current : Io=24mA from the MPU The output is made in one of three modes (Mode 0, Mode APPLICATION 1, and Mode 2). Control of DC motors and stepping motors, heater phase _ In Mode 0, setting only the value of H width repeatedly out- controllers, software servos for office automation equip- puts the set pulse width ment, and industrial equipment. In Mode 1, setting only the value of H width outputs one shot of the pulse width set by trigger input. In Mode 2, setting both H width and L width repeatedly outputs the set pulse width BLOCK DIAGRAM Vee a LY T RAG xIO@—1 3. | my 4 nae 3s 16-bit 16-bit, 8-bit PWM wa > 223 a 8 [H register c10 (9 55 3 | 02 Bs 45) 2 05) ra D6 & He ‘another channel Gnd
4 MITSUBISHI
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR PIN DESCRIPTIONS Pinname | Description | v0 Function RESET | Reset input Input | Clears the command register and tho flip-flop at “L” DO~D7 | Data bus input | Input | Inputs the data from MPU over the 8-bit data bus. Wr Write input | Input_| Writes the data bus data to the control register or data register when the state changes trom “L” to“H" C/D | Command/data Input | Data atthe data bus is regarded as a command at high level and as data at low level inout input xX Clock input Input | VO to the bult-In clock generator circuit. Providing a crystal resonator between X; and Xe sats the frequency. | To make extemal clock input, connect the clock source to X; pin and leave X; pin open. X2 Clock output | Output TRGI~ | Trigger input | Input | This is used when external trigger is selected in mode setting. Set to low level when not In use. TRGA PWM1~| PWM output Output | PWM output pins. Outputs become the high-impedance state alter reset or alter disable Is specified by command 3 Pwma | DO of command 1 aliows the selection of output polarity OPERATION To change the values of the upper byte, the values of all 16 Commands bits should be written. To change the values of H register The information on data bus inputs DO through D7 is loaded in Mode 2, the H register value should be written followed as command when command data control input C/D=1 and by the L register value. as data when C/D=0. When values are written to the lower byte (lower byte of L There are three kinds of commands. (See Figure 1.) register in Mode 2), the write cycle of data register is com- Command 1 selects the output mode and external trigger pleted. input of each channel and sets the output polarity of H If the data register value is changed during a PWM signal width. Command 2 specifies, on a byte basis, to which 16- output operation (exactly, after the end of the write bit register of the prescaler and PWM counter of each operation), the PWM output is updated starting with the cy- channel data is to be written. cle next to the current output cycle. The second and subsequent bytes of command 2 write pre- To change the mode (ie., to execute command 1), disable scaler value and PWM value. Depending on the location __ the output first (ie., execute command 3). specified by command 2, the data of the second and sub- —_ Figure 3 shows the flow chart of the basic operation. (The sequent bytes must be written in the order shown in Figure order of the prescater’s and PWM counter’s data setting is 2. not fixed.) Command 3 is used to start or stop the prescaler and PWM. counter operation. Data input At initialization, ali 16 bits of the prescaler value must be written. In mode 0 or 1, the PWM value must be written to all 16 bits of H register (In mode 0 at 8-bit resolution, only the lower byte of the H register is used.); in mode 2, the value must be written to all 16 bits of H and L registers. To change the values of all 16 bits in the prescaler or the PWM counter during operation, values should be written to the upper byte first and then to the lower byte. To change the values of the lower byte only, the values of only the lower byte should be written. MITSUBISHI oe SRS
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR Command 1 [er] pe [os ba [bg Toe bi] bo 7 fF 7 pwe External "HE Mode selection | | tesolution trigger widtn polarity PWM number selection Mode 0:8 bRs g: OFF ort 00: PWM1 00 : Mode 0 1: 16 bits TION ve 01: PWM2 01 Mode 1 (‘a 10: PWM3 10 : Mode 2
115 PWM4 11: Prohibition Mode 0/
07 os [os [pa Tos be oro) “o" t 0: prescaler x 0: For lower x Enable/numerical numeric value byte control selection —pyyaq . conols number . 1: For upper selection ; numerical byte 00: Pwr combolenabied ot PWM 1:PWM 0: For O:Forlower —|___ $0: PwMa numeric value wigth byte Prescaler value and tt: pwme 1: ForH 1: For upper PWM counter valve width byte ‘are set by the unit of byte after tho second byte. See Fig. 2 “1° is specified (See Fig. 2) for Mode 0 and Aa — Command 3 07 | be | os “Toa os Tbe 0 o x x 1: Enables PWM4 PWM3 pwm2 PWM Enable/numerical control 0 : Disabl ~ contro} selection enabled peaele cones 1: Enable attention @ Mode 0~2(atter Reset or Disable) : M=0 Prohibition @ Mode 1, External trigger on = M=0 Prohibition @ Mode 2 :M=N=0 Prohibition (Mwah set vate) (N= L width set value X : Don't care Fig. 1 Commands First byte (command 2) | Se oe or Second byte | Third byte Fourth byte Frith byte Remark 1 | oa | 7 UPperbre for ~~ Lower Byte for oO y PWM H register PWM H register oe — J when Moded or 1 1 bo Lower byte for i ‘When Moded oF 1 j 1 1 | Upper byte for Lower byte for Upper byte for Lower byte for | [| pm register | PWM register | PWM Leister | PM Lregister 1 | | Lower byte for Upper byte for Lower byte for | PWM H register PWM L register PWM Lregister _ | wen Mode 2 Te py Bape xt for ower byte or > | wer Moe oa | Pw U register PWM L rogister | j 6 9 | Lower byte for — ~ ~ | SO 0 } x 1 | Ueper byte for Lower byte for = prescaler register prescaler register i 0 « o | Lower byte for _ _ a _ rr prescaler register Fig. 2 Data-setting sequence for registers ——— MITSUBISHI ELECTRIC
MITSUBISHI (DIGITAL ASSP) 4-CH 16-BIT PWM GENERATOR No. C/B=1 | Mode setting (command 1) | p7=1 Yes _ D7=0 = a Da= Prescaler setling bee oibet Prescaler or PWM counter bao et o=1 (upper byte) 03=0 “TT setting change (Command 2)] p2=1 (Command 2) Dim Di=0 ot Prescaler value _ Upper byte for prescaler orD=0 upper byte o/D=0 or PWM counter _ Prescaler value _ Lower byte for prescaler cio=0 lower byte oB=0 or PWM counter al o7=0 PWM counter setting Da=0 c/D=1 (errer ene) D3=1 Yes Command 2 02=1 ~ Diet ‘Change setng PWM count No — outer “on — o7=0 | /D=1 | Output disable (Command 3) 4m PWM counter | emo lower byte | | Yes No Seting completed? No [ves C/B=1 | Output enable (Command 3) 519 Fig. 3 Flow chart in Mode 0 or 1 (for one channel) SSS MITSUBISHI ELECTRIC
MITSUBISHI (DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR PWM waveform output Figure 9 shows the block diagram (for one channel) in this The M66240 has a built-in 16-bit prescaler and a PWM mode. counter, The duty cycle of output pulse can be freely speci- The 16-bit PWM counter can be used as an 8-bit PWM fied by changing the values of the prescaler and the PWM. counter only in this mode (command 1 : D2=0Q). The set- counter. The output is made in one of three modes (Mode ting with PWM resolution=8 bits must be written to the low- 0, Mode 1, and Mode 2), The description of these modes is _er 8 bytes of H register. In this mode, the H output pulse given below. width is determined by the prescaler register value L and (1) Mode 0 PWM register value M. The PWM output cycle time is de- This mode is selected by writing "0" to D4 and D3 in com- _ termined by the prescaler register value L, irrespective of mand 1 the PWM register value M. (See Fig. 4) Oscillator boot) source [7 Prescaler | | output Internal signal JL ng PWM clock roy (when L=1) | Xm) | | * weg Eg i M=1 i i H i | | M=3 THT yy i — PWM output | Ce) | | 1 { M=65534 5 rs — (254) 1 1 M=65535 SS (258) k oe j ~ Thy) BP (_) ! When PWM resolution is 8 bits T(us) | Cycle time (Xm) (MHz) } Oscillator frequency L Prescaler set value M 1-H width set value A: PWM resolution (8 or 16) Fig. 4 (When H width polarity is “H”) MITSUBISHI ae NTRS
MITSUBISHI <DIGITAL ASSP) 4-CH 16-BIT PWM GENERATOR {2} Mode 1 @ External trigger selected (D1=1 in command 1): This This mode is selected by setting D4=0 and D3=1 incom- _ mode outputs, when a trigger pulse is applied to trigger in- mand 1 put TRG, one shot of output pulse. Therefore, cycle time T Figure 10 shows the block diagram in this mode (for one —_ becomes cycle time fn, of the trigger pulse to be applied to channel) trigger input TRG. This mode outputs, on the trigger signal, one shot of the The output pulse width is determined by the prescaler reg- pulse determined by value M of PWM register. The type of ister value L and PWM register value M. (See Fig. 5) this output operation is determined by whether the external trigger signal or the internal trigger signal is used. Opera- tion varies according to the choice of external and internal trigger signals. Kai ovate TUPLE LU Uo A source tw TRG K > Prescaler Internal eo signal (22m) 1X) L clock L=1 | I output | | tH | 1 i tat 1 a ns > Tus) 2 Cycle time 1(X)(MHz) : Oscillator frequency L_ | Prescaler set value fno(MHz) Trigger input frequency M :Hwidtn set value Fig. 5 (When H width polarity is “H") MITSUBISHI ae IES
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR @) Internal trigger selected (D1=0 in command 1) : oscillator source becomes the PWM counter clock and the In this mode, the trigger signal is generated by the prescal- output pulse width is determined by the PWM register er. Therefore, the cycle time T of output pulse is deter- value M. (See Fig. 6) mined by the prescaler register value L. In this case, the a 11100) oroues TULL ULL, source ut Prescaler 1) internet output] n n Internal 7 (internal signal ngge") (when L=11) | | PWM M=t output 1 | m=2 ! 1 M=3 a - 1 | 1X), \\ > ' Lt Ta). Tus) : Cycle time 1(Xy)(MHz) = Oscillator frequency L_ : Prescaler set value M —: H width set value Fig. 6 (When H width polarity is “H") In Mode 1, the retrigger state is caused when the cycle time of trigger pulse gets smaller than value M of PWM register. MITSUBISHI Palins
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR (3) Mode 2 pulse value M is set to the H register of PWM and the low- This mode is selected by writing D4=1 and D3=0 in com- _ level pulse value N is set to the L register of PWM. There- mand 1. Fig. 11 shows the block diagram of this mode (for __ fore, the pulse width and cycle time T of PWM output are ‘one channel). determined by value L of the prescaler register and values The high-level pulse value M is set to the H register of | Mand N of H and L registers of PWM (see Fig. 7). PWM in Modes 0 and 1, but, in this mode, the high-level eso (Xing) Oscillator [ Prescaler ot TLL en _n Internal} {PWM clock) ee] ignal | ka et “sn [neta cer) [ { Moo ya potnes | M=1 Colne SES ee a |) Mes ‘ws SO CULE C—C pwm | | M=65595 ‘output \\N=3 Mo EE or \\ net l J j M=o ne pees EE cece EE |p M=3 tty ( 1X) N=65535 uh Tay (MEN) Tus) : Cycle (Xi)(MHz) : Oscillator frequency L_ : Prescaler set value M High width set value N : Low width set value Fig. 7 (When H width polarity is “H") MITSUBISHI ae RRs
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR Initial state in TRG input for Mode 0 or Mode 2 or H pulse in TRG input When external trigger ON is selected in D1 in the case of in Mode 1 (see Fig. 8) Command 1, starting the operation of the internal circuit by Putting TRG input to L level during PWM output in Mode 0 writing enable by Command 3 does not output a pulse to or Mode 2 makes PWM output keep its state. Putting TRG PWM output, which is held in the high impedance state input back to H level starts the operation from that point. The pulse can be output to PWM output by entering H level veun 3 oo~or XFrable Xe ss —<— cD WR ae Oscillator [ Prescaler signal! (pwM / L etock) { External \\ trigger off \\ PwM 2" \\ | ua External trigger on i mo ——~—SOSOSSS | PWM “2 L output (L=1,M=3) Fig. 8 (When H width polarity is “H") SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSsSSSSSSsSsSssSsFSFSFMFMMMSFFeeee MITSUBISHI eines
MITSUBISHI <DIGITAL ASSP) 4-CH 16-BIT PWM GENERATOR ee a TAG 23 VH 85 7] present Q= = OF] sand ent 2 PHM iS Prescaler ‘s) e PWM counter [ease] 3 8 it 2 a Fig. 9 Block diagram in Mode 0 (for one channel) TRG S| 6 i Ee cc ee ee s a_i | Fig. 10 Block diagram In Mode 1 (for one channel) Be 33 vi 33 16-bit Q-- —O 16-bit ° PWM E rasta |S — BF am [outer] [Frese] : l g 8 s 8 a | Fig. 11 Block diagram in Mode 2 (for one channel) ee MITSUBISHI ae MERE
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR ABSOLUTE MAXIMUM RATINGS Symbol Parameter _ Conditions dS Ratings Unit Veo ___ | Power voltage i (=0.5~+7.0 Vv vw input voltage _ —0.5~Veo+0.5 v Vo Output voltage i =0.5~Voot0.5 v SSE |<< = ir Input protect diode current MSO 20 — WS Veo $20 oo . pel Parasitic @ ee (Vo>Veo _. +20 ma io Output curert C 50 mA] Power/GND current ~ [Wee GND R00 [oma [Pa Power sissipation 80 =65~150 i RECOMMENDED OPERATING CONDITIONS Limis symbol Parameter a Min | Typ. | Max | Voc | Powervattage a TO | 8 TV | GND | Power voltage re V___| input votage [of | Vee |v Vo | Outputvoltage | Voc {| Vv _ Topr ‘Ambient operating temperature —40 85 c ELECTRICAL CHARACTERISTICS (ta=—40~85°C, Vec=5v+10%) symbol Treat conditions mm | min. |" typ. | Max Vo™0.1, Veo—0. IV, lom 200A, i Vo™0.1, Veo—0. IV, Io= 20 A Vr- | Negative going threshold vot vom0. . sone sora tvomneevee RESET, rras~ a _” Vo=0. 1, Voo—0. IY, lo 20uA Va Hysteresis width newest ome 0.2 v RESET, TRGI~4 Vin Vo=0.1, Voo~9. W, tom 20 v Dy~D;, CS, WA, C/D Vo=0.1, Veo=0.1V, 1o=20uA Vie “L"input vot IN. v “ep eevee De~Dr, C8, WRC [el Vo™=0.1, Vec—0. 1V, lo=20uA Vow “H" input voltage ” oe VecX0. 8} Vv ai ~ Vo=O.1,Voc—0.1V.1o=200ASC*| i Viv =U" input voltage ” NVecX0.2] Vv v “H output vot ViVi Va lon 24m Veo—0.81 /j v om output votage ven vee eo 0. vi “L" output volt WV Vis Tour 2tma 055} ov OL output voltage _ Pw pwe ie tg H" input euerent We Vee |e] va] he SL’ input current Vi=GND _ =1.0 | uA loz Off-state “H” output current Vo=Vec {5.0 BA [loz | Ott-state"t* outputurent | Vo GND. =8.0 | uA Vie Vee, GND Io OuA || 100 | aa | Vir2. 4V, 0.4V (Note 1) [29 | ma] Note 1 : Set only one input to this value; fix other inputs to Vcc or GND.
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR SWITCHING CHARACTERISTICS (12=—40~85€, voo= 5 v+10%) | Limits ‘Symbol Parameter { Test conditions 1 — Unit, Sih ee min. [Typ | Max ‘Output enable time after write | 42 {42,1 Ai Pe 444 4110 PMH pode 0,2, external tigger OFF) t t rane ns Output enable time after write L+2 L+2 team evn] S443) +110) rm] (Mode 0,2, extemal tigger OFF) }— nie ie teoit-paan| OUtOUt enable time ater write | U3 y|B sil ns (Mode 1, external trigger OFF) | net Output enable time after write 43 43 tozHiw— | = mn +110) {ez pu (Mode 1, external trigger OFF) | { t +3 1 0} ns Output enable time after trigger AGH AGH) tezutr=s SH aur-remt| (Mode 0, 2, extemal tigger ON) al + tons Output enable time after trigger LH), [ALtI) teantt~ ew) 8 rm (Mode 0, 2, extemal tigger ON) _. CBs es Output enable time alter trigger mu), (aut. | tr 8 | (ayode 1. external trigger ON) _ cw tone Output enable time after trigger UL) U4} SezetT—pwea! ior Be li tens (Mode 1, external trigger ON) c.=50pF | Tay tas Output propagation time after clock " p 10 ‘howixr-o0) Cs modes) —_ - ; ns ‘Output propagation time alter clock wo | Nenuix1— pal (all modes) ns Ouiput propagation time ater trigger aH), faery ‘rxcr-rume| (agoge 1, extemal trigger ON) 7a tons t Output propagation time after trigger 21) 4 AH sg sutton | (Mode 1, external trigger ON) ee t t ns tnait-rau| Output disable tne ater ese | | 150 | ne tecztW—rvnai] Output disable tlme after write 150 | ns (MHz) : Clock input frequency L! Prescaler setting TIMING CONDITIONS (1a=—40~8°, voo= 5 v+10%) symbol Parameter | Test conditions fecxs _| Clock cycle — ee — 78.5 | ns twrixr) | Clock "H" pulse width a 38 a _ns_ twain) | Clock "L" pulse width 35 | 2 “ns troy Clock rise time 20 ns thor _| Glock fall ime 7 20 | ns tsu(n—w) | Address setup time betore write (CS, C/D) oy =n ns thiw—a) | Address hold time after write (CS, C/D) 0 [=n ~|_as tsuio—w) | Data setup time belore write _ | 100 {8 . {ns thiw—p) | Data hold time alter write o | —28 ns p)_; Data noid ume atter wit tw Write pulse width 4 100 | 12 ns trea | Wiiterecoverytime 100 12 twir) ___| Trigger pulse width _ | 100 23 twin) | Reset pulse wiath OO 100 | 30 | trecii-m | Recovery time betore write ii 100 ae Rs
MITSUBISHI {DIGITAL ASSP) M66240P/FP 4-CH 16-BIT PWM GENERATOR TIMING CHART (1) MCU interface © SNINIVNILI VIS buon — tsuia-W) | thiw-ap cD Isuiow ‘nnn wR teow J wi vo~or7 (cue XX Ses) teuo-W) thio) (External trigger=OFF) Internal signal (Presealer) leavin rane) output PwMI~4 Taira PWMI~4 (External trigger=ON) TRGI~4 teaw ypu) PWM1~4 | y Garapam pwMi~4 — ee ELECTRIC
MITSUBISHI (DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR (2) In operation Mode 0, 2 (external trigger ON, OFF) Vee 50% x1 ov Internal signal (Prescae) output Aruna —ron | You PwMI~4 50% 509% You towcoxreom 4 tauren \\ Vou PwMI~4 50% 50% You Mode 1 (extemal trigger ON) o> Veo x! 50% ow Internat signal (Preseae) two output) ov TRGI~4 1.3V hav ov Younir—ran Toncoa een PwMI~s 1.av 50% Tenet pwn teunva—pumar You Vou PwMi~4 1.34 50% 7. Vou Mode 1 (external trigger OFF) + Vee * 50% ov Internat signal (Prseaier (output <3) rrr y PwMi~4 0% soe on Vou Yeacx Poa) teunccrrwnn Von PwMi~4 50% 50% = Vou SSS MITSUBISHI PR
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR (3) Atreset a --3v RESET 1.3V 1.3V wm trecti~w) aod — av wr | K 13v touz ov Pwmi~4 10% tone Vou PwMi~4 90% “Vou (4) At disable ov wa y av 1.3v ov cD av | ov av [_taz ~ PwMI~4 10% tone Vou es
MITSUBISHI <DIGITAL ASSP> 4-CH 16-BIT PWM GENERATOR Measuring circuit Input Voe Output 2XVow Parameter Sw l trom tra = r=s00 aris Oper + sw ” Si: Element v4 eo Closed | PG under J fenz, | Open _ test | fez Closed _ 509 C.F R=5000 teen Open
9 GND i { (1) Characteristics of pulse generater (PG)(10%~90%)
rh ty=3ns, ty=3ns (2) C, includes stray probe and wiring capacitance APPLICATION EXAMPLE “uv - Puls He Ise cycle measuring copa 37450 Analog inet a ee 1 i i ' | Voltage | | i ROM M66240 | | | = 1 ! | tii =? Lamp i | | | \\ ight volume i id ' | } Temperature / RAM =— I ' I | Peripherat i I I ' Fixing heater 1 tod a oer Note) M37450 : ROM. 4KB~16KB RAM 128B~384B Timer Mulitunctional 16-bit type with pulse cycle measuring modeX3 A-D 8-bits, 8 channels PWM 20kH? cycle, 1 channel ART Glock syne and async, 1 channel —_)] MITSUBISHI ELECTRIC