11.2.4 Programmable Clock-Out from Timer 2........................................................................................50
12 Serial Port .................................................................................................... 51
12.1 Standard UART Operation..................................................................................................... 51
12.1.1 Multiprocessor Communications...................................................................................................51
12.1.2 Serial Port Related Registers........................................................................................................51
12.1.3 Baud Rates....................................................................................................................................52
12.1.4 Using Timer 1 to Generate Baud Rates........................................................................................53
12.1.5 More About Mode 0.......................................................................................................................55
12.1.6 More About Mode 1.......................................................................................................................55
12.1.7 More About Modes 2 and 3...........................................................................................................56
12.2 Enhanced UART Functions.................................................................................................... 61
12.2.1 Framing Error Detection................................................................................................................61
12.2.2 Automatic Address Recognition....................................................................................................61
13 Secondary UART (UART2).......................................................................... 63
13.1 UART2 Related Registers...................................................................................................... 63
13.2 UART2 Baud Rates................................................................................................................64
13.2.1 Mode 0 ..........................................................................................................................................64
13.2.2 Mode 1 and Mode 3 ......................................................................................................................64
13.2.3 Mode 2 ..........................................................................................................................................64
13.3 UART2 Baud Rate Timer Used by the First UART ................................................................65
13.4 Programmable Clock-Out from UART2 Baud Rate Timer......................................................66
14 Programmable Counter Array (PCA) ........................................................... 67
14.1 PCA Overview........................................................................................................................67
14.2 PCA Timer/Counter................................................................................................................67
14.3 Compare/Capture Modules.................................................................................................... 69
14.4 Operation Modes of the PCA ................................................................................................. 70
14.4.1 Capture Mode...............................................................................................................................70
14.4.2 16-bit Software Timer Mode..........................................................................................................71
14.4.3 High Speed Output Mode..............................................................................................................71
14.4.4 PWM Mode....................................................................................................................................72
15 Serial Peripheral Interface (SPI) .................................................................. 73
15.1 Typical SPI Configurations.....................................................................................................75
15.1.1 Single Master & Single Slave........................................................................................................75
15.1.2 Dual Device, where either can be a Master or a Slave.................................................................75
15.1.3 Single Master & Multiple Slaves....................................................................................................76
15.2 Configuring the SPI................................................................................................................77
15.3 Additional Considerations for a Slave ....................................................................................77
15.4 Additional Considerations for a Master ..................................................................................77
15.5 Mode Change on /SS-pin....................................................................................................... 78
15.6 Write Collision ........................................................................................................................78
15.7 SPI Clock Rate Select............................................................................................................78
15.8 Data Mode..............................................................................................................................79
16 A/D Converter .............................................................................................. 81
16.1 ADC Control Registers...........................................................................................................81
16.2 ADC Operation.......................................................................................................................82
16.3 Sample Code for ADC............................................................................................................83
16.4 Notes on ADC ........................................................................................................................84
16.4.1 A/D Conversion Time....................................................................................................................84
16.4.2 I/O Pin Used with ADC Function...................................................................................................84
16.4.3 Idle and Power-Down Mode..........................................................................................................84
16.4.4 Requirements on VDD Power Supply...........................................................................................84
17 Keypad Interrupt........................................................................................... 85
18 Watchdog Timer........................................................................................... 86
18.1 WDT Control Register............................................................................................................86
18.2 WDT Operation ......................................................................................................................87
18.3 Sample Code for WDT........................................................................................................... 87
MEGAWIN
MPC82G516A Data Sheet
2