Sie sind auf Seite 1von 3

GENERAL PURPOSE TIMERS:

GPTMCFG configuration of 16/32 bit wide counters


GPTMTAMR what mode to operate the timer A e.g. one shot, periodic, capture mode etc.
GPTMIMR Interrupt mask registerset to enable interrupts to the NVIC controller
GPTMICR Clear the interrupt by setting it to one
GPTMRIS Raw interrupt status of the interrupts
GPTMCTL Enable timers

So, a sequence of what to do:

1) Enable clock to the timer module selected
2) Enable clock to the GPIO port pin that is to be used as a timer
3) Select AFSEL, DEN and in PTCL select the timer mode
4) Disable the timer A/B you are about to use by going to GPTMCTL
5) Then go to that GPTMTnMR and select what type of mode it will operate on, and enable other
stuff like interrupt on matching
6) To enable the interrupt go to the GPTMIMR and enable those interrupts
7) You will also have to then go and enable the timer modules interrupts in NVIC and also set its
priority.
8) Load the values of pre scale, interval, interval match and pre scale match etc. in their respective
registers
9) During the routines whether it is polling based (use of GPTMRIS) or interrupt based always
acknowledge the interrupt by writing to the respective bit in the GPTMICR register.
10) GPTMCTL is also used to set modes like PWM or ADC trigger.
SYSTICK TIMER:
There are three registers:
1) Systick control and status register Enabling of the systick, interrupt
enable & clock source
2) Systick Reload Value Register
3) Systick Current Value Register

Steps to use Systick:
1) Disable Interrupts
2) Disable the systick before configuration
3) Load the reload and the current values
4) Set the priority of the Systick in PRI3
5) Enable the systick
6) Enable Interrupts

ADC:
Steps:
1) Enable clock for the ADC module and the GPIO port pins
2) Set AFSEL for the pins, clear the DEN, and set the AMSEL for the pins to be
used.
3) Set the sampling frequency for the ADC module
4) Set the priority sequence
5) Disable the ADC sequencer that is to be used in ADCACTSS
6) In ADCEMUX select how the ADC will be triggered like from software or
analog comparators etc.
7) In ADCSSMUXn select which sample of the sequence is from which input
8) In ADCSSCTLn select the properties or config of each sample in the
sequence like whether its differential, interrupt enabled, temperature
sensor or end of sequence
9) If the interrupts are to be enable i.e. sent to the NVIC controller enable the
sample sequencer interrupts in the ADCIM. Also globally enable the ADC
module.
10) If using polling based techniques then use ADCRIS to check for
interrupts
11) Always acknowledge the interrupts by setting the bits in ADCISR
12) If using software as the trigger mode as selected in ADCEMUX then in
the routine called by software must set the ADCPSSI register to start the
ADC conversion.
13) To get the data read from the ADCSSFIFOn register.
UART:

Steps :

1) Enable the clock for the UART module and the GPIO port pins
2) Set the AFSEL, DEN and PCTL configs to use the pins as UART_Rx and
UART_Tx
3) Disable the UART module in UARTCTL before configuration
4) Set the baud rate by loading values in UARTIBRD and UARTFBRD
5) Set the WLEN and FEN in the UARTLCRH
6) Enable the UART by enabling the Tx, Rx and Enable pins in the UARTCTL.
7) For condition checking use the UARTFR
8) For reading or writing to the data use the UARTDR

Das könnte Ihnen auch gefallen