Esempio n. 1
0
/* init configures LED's for vumeter and initializes LCD / ATD / PWM / RTI*/
void init(void) {
  
  DDRB = 0xFF;
  PORTB = 0x00;
  DDRJ = 0x02;
  PTJ = 0x00;
  DDRT = 0x20;
  
  DDRP = 0xFF;
  PTP = 0xFF;
  
  PWMPRCLK = 0x03;   // 4MHz / 8 = 500kHz
  PWMSCLA = 0x0A;    // 500kHz / (2*10) =25kHz
  PWMCLK = 0x20;     // PWM source channel 5
  PWMPOL = 0x20;     // High then low
  PWMCAE = 0x00;     // Left aligned
  PWMCTL = 0x0F;     // 8-bit, 15 cycle wait
  PWME = 0x20;       // Enable PWM5
  //PWMCNT5 = 0x00;    //Clear PWMCNT05
  
  ATDinit();
  LCDinit();
  RTIinit();
}
Esempio n. 2
0
void initAll(void){
    ATDinit();
    LCDinit();
    RTIInit(0x13);
}