Start Timer; Stop Timer; Change Interval Interrupt At Run-Time - Samsung S5PC110 Manual

Risc microprocessor
Table of Contents

Advertisement

S5PC110_UM

2.6.4 START TIMER

1. Reset tick generation logic (by setting TCFG[16] as 1). And TCFG[16] is auto-cleared.
2. Set TCFG SFR to make appropriate TCLK.
A. Select clock source.
B. Set pre-scaler and divider value.
3. Set tick counter by writing appropriate values to TICNTB and TFCNTB (if you use fractional divider) SFR.
4. Wait until TICNTB write interrupt occurs, and write 1 to INT_CSTAT[2] to clear interrupt status bit.
5. If you use fractional divider, additionally wait TFCNTB write interrupt occurs, and write 1 to INT_CSTAT[3]
to clear interrupt status bit.
6. Set interrupt counter by writing to ICNTB SFR.
7. Wait until ICNTB write interrupt occurs, and write 1 to INT_CSTAT[4] to clear interrupt status bit.
8. Write (TCON[4] = 1'b1 or ICNTB[31] = 1'b1) and TCON[0] = 1'b1 to update wanted value to internal interrupt
counter at that time.
9. Wait until TCON write interrupt occurs, and write 1 to INT_CSTAT[5] to clear interrupt status bit.
10. Write both TCON[3] = 1 to run interrupt and tick timer. And also set interrupt type by TCON[5]
at this time.
11. Wait until TCON write interrupt occurs, and write 1 to INT_CSTAT[5] to clear interrupt status bit.

2.6.5 STOP TIMER

1. Write INT_CSTAT[6] = 1'b0 to disable Interrupt counter expired (INTCNT=0) interrupt.
2. Write TCON[3] = 1'b0 to stop internal interrupt counter.
3. Write TCON[0] = 1'b0 To stop internal timer counter.

2.6.6 CHANGE INTERVAL INTERRUPT AT RUN-TIME

To run system timer as shown in
1. Set new interrupt counter value by writing to ICNTB SFR.
2. Wait until ICNTB write interrupt occurs, and write 1 to INT_CSTAT[4] to clear interrupt status bit.
3. Write TCON [4] = 1'b1 or ICNTB[31] = 1'b1 to update new value to internal interrupt counter at that time.
4. Wait until TCON write interrupt occurs, and write 1 to INT_CSTAT[5] to clear interrupt status bit.
And the new value is updated after interrupt counter is expired.
Figure 2-4.
2 SYSTEM TIMER
2-7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents