Download User`s Manual 08.97 8-Bit CMOS Microcontroller http://www.siemens
Transcript
On-Chip Peripheral Components C517A 6.3.3.1 Compare Mode 0 In mode 0, upon matching the timer and compare register contents, the output signal changes from low to high. lt goes back to a low level on timer overflow. As long as compare mode 0 is enabled, the appropriate output pin is controlled by the timer circuit only, and not by the user. Writing to the port will have no effect. Figure 6-17 shows a functional diagram of a port circuit when used in compare mode 0. The port latch is directly controlled by the timer overflow and compare match signals. The input line from the internal bus and the write-to-latch line of the port latch are disconnected when compare mode 0 is enabled. Compare mode 0 is ideal for generating pulse width modulated output signals, which in turn can be used for digital-to-analog conversion via a filter network or by the controlled device itself (e.g. the inductance of a DC or AC motor). Compare mode 0 may also be used for providing output clocks with initially defined period and duty cycle. This is the mode which needs the least CPU time. Once set up, the output goes on oscillating without any CPU intervention. Figure 6-18 illustrates the function of compare mode 0. Port Circuit Read Latch VCC Compare Register Circuit Compare Reg. 16 Bit Comparator 16 Bit Compare Match S D Q Port Latch CLK Q R Internal Bus Write to Latch Port Pin Timer Register Timer Circuit Timer Overflow Read Pin MCS02661 Figure 6-17 Port Latch in Compare Mode 0 Figure 6-18 shows a typical output signal waveform which is generated when compare mode 0 is selected. Semiconductor Group 6-37 1997-08-01