title: Understanding TC interrupts in a measurement function
body: <p>I am trying to understand the use of the interrupt for LDRBS in this specific pseudocode.
  Our task is to measure the temperature using a temp sensor.</p>
  <p>Here is the pseudocode steps:</p>
  <p>Initialization</p>
  <pre><code>1) Don’t forget the PMC
  2) Select Timer_Clock1 as TCCLK
  3) Enable counter and make a sw_reset in TC0_CCR0
  4) Load counter to A when TIOA falling in (TC0_CMR0)
  5) Load counter to B when TIOA rising in (TC0_CMR0)
  6) Enable the pin
  7) Create init puls
  8) Enable the interrupt (NVIC) with the inline declared function
  </code></pre>
  <p>Starting the measurement</p>
  <pre><code>1) Create a startpuls with a Delay(25); and make a sw_reset in TC0_CCR0
  2) Clear old interrupt by read statusreg
  3) Enable interrupt for LDRBS
  </code></pre>
  <p>Interrupt Handler</p>
  <pre><code>1) Disable interrupt LDRBS
  2) Set a global flag.
  </code></pre>
  <p>The steps that I don't really understand is nr 8 in the initialization and nr 3 in the measurement function.
  I know for step 3 I am supposed to use</p>
  <pre><code>*AT91C_TC0_IER = (0x1 &lt;&lt; 6); // or (AT91C_TC_LDRBS) instead of (0x1 &lt;&lt; 6)
  </code></pre>
  <p>But I don't understand why this step is necessary, I want to know what function the interrupt for LDRBS has in TC0</p>