title: Lpc1347 pwm duty cycle issue
body: <p>I'd like to write aplication to control PWM with 50Hz frequency and 1ms duty cycle using 16 bit timer. This is my code.</p>
  
  <pre><code>#include "board.h"
  
  #include "../../static/inc/ct.h"
  #include &lt;cr_section_macros.h&gt;
  
  #define PRESCALE_VAL 36000 /* f = 72MHz, output T = 0.5ms =&gt; output f = 2kHz, 72MHz / 2kHZ = 36000 */
  
  #define TIMER LPC_TIMER16_0
  #define SYSCTL LPC_SYSCTL
  #define IOCON LPC_IOCON
  
  #define PWM_GPIO_PORT 0 /* PWM output port */
  #define PWM_GPIO_PIN 8 /* PWM output pin */
  #define IOCON_FUNC_PWM IOCON_FUNC2
  
  #define PWM_MATCH_CHANNEL 0
  #define PWM_RESET_CHANNEL 3
  
  int main(void) {
   // Generic initialization
   SystemCoreClockUpdate();
   Board_Init();
  
  
  
   IOCON-&gt;PIO0[PWM_GPIO_PIN] = IOCON_FUNC_PWM;
   SYSCTL-&gt;SYSAHBCLKCTRL |= CT16B0_CLOCK_MASK;
   Timer_Reset(TIMER);
   TIMER-&gt;PR = PRESCALE_VAL - 1;
   TIMER-&gt;MR[PWM_MATCH_CHANNEL] = 38; // 38 * 0.5 = 19ms
   TIMER-&gt;MR[PWM_RESET_CHANNEL] = 40; // 40 * 0.5 = 20ms
   TIMER-&gt;MCR |= TIMER_RESET_ON_MATCH(PWM_RESET_CHANNEL);
   TIMER-&gt;EMR |= _BIT(PWM_MATCH_CHANNEL);
   TIMER-&gt;PWMC |= _BIT(PWM_MATCH_CHANNEL) | _BIT(PWM_RESET_CHANNEL);
   TIMER-&gt;TCR |= TIMER_ENABLE_MASK;
  
   while(1) {}
   return 0 ;
  </code></pre>
  
  <p>}</p>
  
  <p>I'm using logic states analyzer connected to the pwm pin. As a result I see that high state takes exactly 1.5ms (?) and low state takes 19ms (that's ok). My question is why duty cycle takes 1.5ms instead of 1ms?</p>