A 16-bit hardware timer (Timer16) is implemented in the PMC234/PMS234, the clock sources of Timer16 may come from system clock (CLK), clock of external crystal oscillator (EOSC), internal high RC oscillator (IHRC), internal low RC oscillator (ILRC) and PA0, a multiplex is used to select clock output for the clock source. Before sending clock to the counter16, a pre-scaling logic with divided-by-1, 4, 16, and 64 is used for wide range counting.
16-bit Timer (Timer16)
The 16-bit counter performs up-counting operation only, the counter initial values can be stored from memory by stt16 instruction and the counting values can be loaded to memory by ldt16 instruction. A selector is used to select the interrupt condition of Timer16, whenever overflow occurs, the Timer16 interrupt can be triggered. The hardware diagram of Timer16 is shown as Fig. 10. The interrupt source of Timer16 comes from one of bit 8 to 15 of 16-bit counter, and the interrupt type can be rising edge trigger or falling edge trigger which is specified in the bit 4 of integs register (IO address 0x0C).
8-bit Timer (Timer2) with PWM generation
An 8-bit hardware timer (Timer2) with PWM generation is implemented in the PMC234/PMS234, please refer to Fig. 11 shown its hardware diagram, the clock sources of Timer2 may come from system clock, internal high RC oscillator (IHRC), internal low RC oscillator (ILRC), PA0, PA3, PA4 and comparator output, bit [7:4] of register tm2c are used to select the clock of Timer2. Please notice that external crystal oscillator is NOT to be the clock of Timer2 because of possible clock glitch. If IHRC is selected for Timer2 clock source, the clock sent to Timer2 will keep running when using ICE in halt state. The output of Timer2 can be sent to pin PA1, PA2 or PA3, depending on bit [3-2] of tm2c register. A clock pre-scaling module is provided with divided-by-1, 4, 16, and 64 options, controlled by bit [6:5] of tm2s register; one scaling module with divided-by-1~31 is also provided and controlled by bit [4:0] of tm2s register. In conjunction of pre-scaling function and scaling function, the frequency of Timer2 clock (TM2_CLK) can be wide range and flexible. TM2_CLK can be selected as system clock in order to provide special frequency of system clock, please refer to clkmd register.
Application industry
The products can be used in the following industries: power plant, paper making, steel, mining, rubber, water supply, cement, chemical industry, glass, printing
Textile, machinery, plastics, coatings, medicine, hospitals, food, hotels, scientific research institutions
This article from the temporal Ming sheng automation equipment co., LTD., reproduced please attach this link: http://www.stockdcs.com/