Contents
Reset and Initialisation .....................................................................52
Reset Functions ...................................................................................................52
Reset Initial Conditions .........................................................................................54
Input/Output Ports.............................................................................57
Pull-high Resistors................................................................................................57
Port A Wake-up ....................................................................................................58
I/O Port Control Registers.....................................................................................58
Port B NMOS Open Drain Control Register ..........................................................59
I/O Pin Structures .................................................................................................59
Programming Considerations ...............................................................................60
Timer/Event Counters .......................................................................61
Configuring the Timer/Event Counter Input Clock Source .....................................61
Timer Registers - TMR0, TMR1L, TMR1H ...........................................................61
Timer Control Registers - TMR0C, TMR1C..........................................................63
Configuring the Timer Mode .................................................................................63
Configuring the Event Counter Mode....................................................................64
Configuring the Pulse Width Measurement Mode.................................................64
Programmable Frequency Divider - PFD .............................................................65
Prescaler ..............................................................................................................66
I/O Interfacing.......................................................................................................68
Timer/Event Counter Pins Internal Filter ...............................................................68
Programming Considerations ...............................................................................68
Timer Program Example.......................................................................................69
Pulse Width Modulator .....................................................................70
PWM Operation....................................................................................................70
6+2 PWM Mode ...................................................................................................71
7+1 PWM Mode ...................................................................................................72
PWM Output Control ............................................................................................73
Analog to Digital Converter..............................................................74
A/D Overview .......................................................................................................74
A/D Converter Register Description ......................................................................74
A/D Converter Data Registers - ADRL, ADRH .....................................................75
A/D Converter Control Registers - ADCR, ACSR, ADPCR ..................................75
A/D Operation.......................................................................................................77
A/D Input Pins ......................................................................................................78
Summary of A/D Conversion Steps ......................................................................79
Programming Considerations ...............................................................................79
A/D Transfer Function...........................................................................................80
A/D Programming Example ..................................................................................81
Serial Interface Module - SIM...........................................................82
SPI Interface.........................................................................................................82
SPI Registers .......................................................................................................83
Rev. 1.20
4
September 15, 2011