Timers16-Bit Timer Setup ExamplesPanasonic Semiconductor Development Company MN102H75K/F75K/85K/F85K LSI User Manual96Panasonic4.11.2 Setting Up a Single-Phase PWM Output Signal UsingTimer 4In this example, timer 4 is used to divide BOSC by 5 and generate a five-cycle,single-phase PWM signal. The duty of this signal is 2:3. To accomplish this, theprogram must load the divide-by ratio of 5 (actual setting: 4) into compare/capture register A and a cycle count of 2 (actual setting: 1) into compare/captureregister B.n To set up the output port:Set the P2MD[13:12] bits of the port 2 output mode register (P2MD) to b’01’(selecting the TM4IOA pin) and set the P2DIR6 bit of the port 2 I/O controlregister (P2DIR) to 1 (selecting output direction). This step selects the TM4OApin (P26) as the timer output port.P2MD (example) x’00FFF4’A. Chip LevelB. Block LevelFigure 4-29 Block Diagram of Single-Phase PWM Output Using Timer 4TM4OAP3P6PCP4P5COREInterruptsTimers 0-3Timers 4-5ROM, RAMBus ControllerSerial I/FsADCP2BOSC/4upTM4BCTimer 4TM4CATM4CAXTM4CBTM4CBXTM4OAT QT QRS QControllerBit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0— P2MD14P2MD13P2MD12P2MD11P2MD10P2MD9P2MD8P2MD7P2MD6P2MD5P2MD4P2MD3P2MD2P2MD1P2MD0Setting: 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0