IBM EM78M611E manual Pulse Width Modulation PWM, R10 PWM1 Duty Cycle Register

Page 32

EM78M611E

Universal Serial Bus Series Microcontroller

After the PDA function is enabled (by setting IOCA[2] to 1), user can write a default value to the High Pattern counter register and Low Pattern counter register. Then set the corresponding interrupt enable bit (IOCF[5]). When the counting value of one “H” pattern is bigger than the default value of R11, the Pattern Detecting interrupt will be generated. Similarly, if the counting value of one “L” pattern is bigger than the default value of R10, Low Pattern Detecting interrupt will occur. Thus, the EM78M611 is notified and aware that one effective pattern is received from P.92.

If user does not need these two interrupts, they can be masked. The new value of counting a pattern will still be loaded to the R10 and R11. The firmware must poll and determine whether the value of these two registers has changed or not.

8.10 Pulse Width Modulation (PWM)

8.10.1 Function Description

In PWM mode, both PWM1 (P.92) and PWM2 (P.93) produce plus programmable signal of up to 8 bits resolution.

The PWM Period is defined as 0xFF Timer Counter Clock. The Timer Counter clock source is controlled by an extra control register, ERE. For example; if the Clock source is 1MHz, then the Period will be 255 µseconds.

Period = 255 (1/Timer Counter Clock)

Period

(0xFF * Clock)

Duty Cycle

 

Fig. 8-2 The PWM Output Timing

8.10.2 Duty Cycle

The PWM duty cycle is defined by writing to the R10/R11 Register for PWM1/PWM2.

Duty Cycle = ( R10 / 255 ) 100% for PWM1 ( R11 / 255 ) 100% for PWM2

8.10.3 Control Register

R10 (PWM1 Duty Cycle Register)

A specified value keeps the output of PWM1 to remain at high for a Period.

R11 (PWM2 Duty Cycle Register)

A specified value keeps the output of PWM2 to remain at high for a Period.

ERE(PWM Control Register) Default Value: (0B_0000_0001)

 

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

 

 

 

 

 

 

 

 

 

 

 

 

PEN2

PEN1

-

-

-

PS2

PS1

PS0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

28

 

 

 

Product Specification (V1.1) 11.22.2006

(This specification is subject to change without further notice)

Image 32
Contents EM78M611E Trademark Acknowledgments 2.1 Product Specification V1.1 AppendixUniversal Serial Bus Series Microcontroller FeaturesGeneral Description Product Specification V1.1 Original With Both Type DefinitionApplication Pin Assignment VNNEM78M611EXBP/BM/DM 20-Pin DIP/SOP/SSOP Symbol Function Pin DescriptionBlock Diagram ALU ACC Data & Control BUSFunction Description Program MemoryData Memory Special Purpose RegisterOperation Registers 2.2 R1 Timer / Clock Counter Default Value 0B000000002.3 R2 Program Counter & Stack Default Value 0B00000000 Bit 2.4 R3 Status Register Default Value0B00011XXXR3 0 Carry/Borrow Flag Condition Program Memory Page Address2.5 R4 RAM Select Register Default Value 0B00XXXXXX EP0Busy Stall Default Value 0B00000000 RF Interrupt Status RegisterControl Registers AccumulatorControl Register Default Value 0B00111111 TCC Rate WDT RateOperation Mode PS/2PH95 PH93 DualFrq.1 DualFrq.0 FrequencyBit P96 P95 P94 P93 P92 P91 P90 PU8 PU6 PU5 Extra Control Register USB Application FIFOsUSB Application USB Device ControllerReset Saving Power ModeDual Clock Mode InterruptPattern Detect Application PDA Function DescriptionControl Register Sampling Rate and Debounce LengthDB.2 DB.1 DB.0 Debounce Time SR.2 SR.1 SR.0 Sampling RateErepwm Control Register Default Value 0B00000001 Pulse Width Modulation PWMDuty Cycle R10 PWM1 Duty Cycle RegisterClock Hz Period/255 s ERA AD Channel Select Register Default Value 0B00011111Analog-To-Digital Converter ADC ERB AD LSB Data Register Default Value 0B00000000 Channel PortCommand Value Action Execution Time ERC AD MSB Data Register Default Value 0B00000000ERD AD Control Register Default Value 0B00000000 DC Electrical Characteristic Symbol Min Max UnitSymbol Parameter Condition Min Type Max Unit Absolute Maximum RatingsUSB Interface Application Circuit Operation Registers Address Name Bit Bit1 Default ValueSpecial Register Map Address Name Bit Default Value Extra Register IOCA3 =Instruction Set Binary Instruction Hex Mnemonic Operation Status AffectedThis instruction is not recommended for RE, RF operation 11 16ms Bits 4~12 User ID Address Code Option RegisterAddress EM78M611E