Serial InterfacesSerial Interface Setup ExamplesMN102H75K/F75K/85K/F85K LSI User Manual Panasonic Semiconductor Development Company135Panasonic5.6.3 Setting Up the Serial Interface ClockThis example demonstrates how to set up a 19,200 bps transfer clock for theUART interface by using timer 1 to divide B OSC/4 by 39. The example uses thefollowing settings:© B OSC = 24 MHz© Clock source = timer 1 underflow x 1/8© Transfer clock = baud rate x 8The serial interface determines the baud rate from the 8-bit underflow. Set up thetransfer clock by making the timer 1 underflow either two or eight times thedesired baud rate. The serial interface divides the timer underflow by two oreight. (Always select divide-by-eight for UART transactions.) For a baud rate of19,200, since BOSC /4 = 6 MHz,6 MHz/39/8 = 19230.77 bpsThis means that the timer 1 underflow must be divided by 39.n To set timer 1:1. Disable timer 1 counting in the timer 1 mode register (TM1MD). This step isunnecessary immediately after a reset, since TM1MD resets to 0.TM1MD (example) x’00FE21’2. Set the divide-by ratio for timer 1. To divide B OSC /4 by 39, write x’26’ to thetimer 1 base register (TM1BR). (The valid range for TM1BR is 0 to 255.)TM1BR (example) x’00FE11’Figure 5-11 Block Diagram of Serial Interface ClockP0P2P4P6COREInterruptsTimers 0-1Timers 2-3Timers 4-5P1P3P5ROM, RAMBus ControllerSerial I/FsADCBit: 7 6 5 4 3 2 1 0TM1ENTM1LD — — — — TM1S1TM1S0Setting: 0 0 0 0 0 0 0 0Bit: 7 6 5 4 3 2 1 0TM1BR7TM1BR6TM1BR5TM1BR4TM1BR3TM1BR2TM1BR1TM1BR0Setting: 0 0 1 0 0 1 1 0