IBM EM78M611E manual DB.2 DB.1 DB.0 Debounce Time, SR.2 SR.1 SR.0 Sampling Rate

Page 31

EM78M611E

Universal Serial Bus Series Microcontroller

high state, then the “high pattern counter“ will increase; otherwise the “low pattern counter” increases. As long as the signal state changes, the PDA will debounce signal and load the value of pattern counter into the respectively register for the firmware to read. For example, if the signal in P.92 is in “low” state, the low counter of P.92 will count continuously until the state of the input signal in P.92 changes. When a state change occurs (in this case, the signal changes from “low” to “high” state), the PDA will take a time break (which is equal to the result of sampling interval multiplied by the debounce length), to avoid possible noise. After the debounce length time, if the signal remains in high state, the high pattern counter will start to count and load the low pattern counter’s value into R10. At the same time, RB[6] is cleared to indicate that low pattern is over.

The correlation between the control register value and debounce time are as follows:

DB.2

 

DB.1

 

DB.0

0

 

0

 

0

 

 

 

 

 

0

 

0

 

1

 

 

 

 

 

0

 

1

 

0

 

 

 

 

 

0

 

1

 

1

 

 

 

 

 

1

 

0

 

0

 

 

 

 

 

1

 

0

 

1

 

 

 

 

 

1

 

1

 

0

 

 

 

 

 

1

 

1

 

1

 

 

 

 

 

Debounce Time

0

Sampling clock

Sampling clock 2

Sampling clock 3

Sampling clock 4

Sampling clock 5

Sampling clock 6

Sampling clock 7

On the other hand, when the signal of P92 always remains “low”, the low pattern counter of P92 will eventually overflow. Once the counter overflows, the content of the counter will also be loaded into R10, that is, the register is written to 0xFF, and the counter is reset to count from zero again.

If the hardware interrupt of PDA function is enabled, (IOCF[5] is equal to “1”), then the program will go to 0x0001 to execute interrupt routine while the content of a pattern counter is loaded into the register.

The correlation between the value of control register and actual sampling rate are as shown below:

 

SR.2

 

SR.1

 

SR.0

Sampling Rate

Sampling Rate

 

 

 

(External oscillator frequency = 6MHz)

(External oscillator frequency = 12MHz)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

0

 

0

N.A.

N.A.

 

 

 

 

 

 

 

 

 

0

 

0

 

1

N.A.

N.A.

 

 

 

 

 

 

 

 

 

0

 

1

 

0

1500 (Count / mSec)

N.A.

 

 

 

 

 

 

 

 

 

0

 

1

 

1

750 (Count / mSec)

1500 (Count/ mSec)

 

 

 

 

 

 

 

 

 

1

 

0

 

0

375 (Count / mSec)

750 (Count / mSec)

 

 

 

 

 

 

 

 

 

1

 

0

 

1

188 (Count / mSec)

375 (Count / mSec)

 

 

 

 

 

 

 

 

 

1

 

1

 

0

94 (Count / mSec)

188 (Count / mSec)

 

 

 

 

 

 

 

 

 

1

 

1

 

1

47 (Count / mSec)

94 (Count / mSec)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Product Specification (V1.11) 04.20.2007

27

(This specification is subject to change without further notice)

Image 31
Contents EM78M611E Trademark Acknowledgments 2.1 Appendix Product Specification V1.1General Description FeaturesUniversal Serial Bus Series Microcontroller Product Specification V1.1 Application Type DefinitionOriginal With Both VNN Pin AssignmentEM78M611EXBP/BM/DM 20-Pin DIP/SOP/SSOP Pin Description Symbol FunctionALU ACC Data & Control BUS Block DiagramProgram Memory Function DescriptionSpecial Purpose Register Data Memory2.3 R2 Program Counter & Stack Default Value 0B00000000 2.2 R1 Timer / Clock Counter Default Value 0B00000000Operation Registers R3 0 Carry/Borrow Flag 2.4 R3 Status Register Default Value0B00011XXXBit Program Memory Page Address Condition2.5 R4 RAM Select Register Default Value 0B00XXXXXX EP0Busy Stall RF Interrupt Status Register Default Value 0B00000000Accumulator Control RegistersTCC Rate WDT Rate Control Register Default Value 0B00111111PS/2 Operation ModeBit P96 P95 P94 P93 P92 P91 P90 DualFrq.1 DualFrq.0 FrequencyPH95 PH93 PU8 PU6 PU5 USB Application FIFOs Extra Control RegisterUSB Device Controller USB ApplicationSaving Power Mode ResetInterrupt Dual Clock ModeFunction Description Pattern Detect Application PDASampling Rate and Debounce Length Control RegisterSR.2 SR.1 SR.0 Sampling Rate DB.2 DB.1 DB.0 Debounce TimeR10 PWM1 Duty Cycle Register Erepwm Control Register Default Value 0B00000001Pulse Width Modulation PWM Duty CycleAnalog-To-Digital Converter ADC ERA AD Channel Select Register Default Value 0B00011111Clock Hz Period/255 s Channel Port ERB AD LSB Data Register Default Value 0B00000000ERD AD Control Register Default Value 0B00000000 ERC AD MSB Data Register Default Value 0B00000000Command Value Action Execution Time Absolute Maximum Ratings DC Electrical CharacteristicSymbol Min Max Unit Symbol Parameter Condition Min Type Max UnitUSB Interface Application Circuit Special Register Map Address Name Bit Bit1 Default ValueOperation Registers Extra Register IOCA3 = Address Name Bit Default ValueBinary Instruction Hex Mnemonic Operation Status Affected Instruction SetThis instruction is not recommended for RE, RF operation Address Code Option Register11 16ms Bits 4~12 User ID Address EM78M611E