Loading ...
Sorry, an error occurred while loading the content.

Re: [booksbybibin,www.booksbybibin.tk] Problem in programming the Timers?

Expand Messages
  • Hojakhan Erhanat
    hi you have to use timer/counter(n) register. this is ATMEGA8535 s PWM duty cycle 50%example program. you can write like this. TCCR1A = 0X83; TCCR1B =
    Message 1 of 4 , Jul 31, 2008
    • 0 Attachment
      hi
      you have to use timer/counter(n) register. this is ATMEGA8535's PWM duty cycle 50%example  program. you can write like this.
      TCCR1A = 0X83;
         TCCR1B = (1<<CS11);                           // | (1<<CTC1); /* setup the CK/8 frescalar */
         OCR1AH=0X02;                                  //   using for output PWM OCCR1A
         OCR1AL=0x00;
      while(1);

      ----- Original Message ----
      From: joinmahsan <joinmahsan@...>
      To: booksbybibin@yahoogroups.com
      Sent: Friday, August 1, 2008 4:34:17 AM
      Subject: [booksbybibin,www.booksbybibin.tk] Problem in programming the Timers?

      Hi,

      I am having problem in programming the timer of ATmega16 in
      compare mode. I am trying it with AVRGCC in AVR studio. Some one give
      any idea or example of programming compare mode of any timer to create
      a PWM as output.


    • duonghhoang
      ... hi joinmahsan, i write in AVR studio 4.14 and WinAVR 20080430, use timer in Phase corect PWM mode. watch in this link for example. have fun !!!
      Message 2 of 4 , Aug 1, 2008
      • 0 Attachment
        --- In booksbybibin@yahoogroups.com, "joinmahsan" <joinmahsan@...> wrote:
        >
        > Hi,
        >
        > I am having problem in programming the timer of ATmega16 in
        > compare mode. I am trying it with AVRGCC in AVR studio. Some one give
        > any idea or example of programming compare mode of any timer to create
        > a PWM as output.
        >

        hi joinmahsan,
        i write in AVR studio 4.14 and WinAVR 20080430, use timer in Phase
        corect PWM mode. watch in this link for example. have fun !!!

        http://www.caibanghoi.net/forum/showthread.php?t=676
      • nandan amar
        hi you have to use timer/counter(n) register. this is ATMEGA16 s PWM there are alltogether 4 pwm ports OC0- PB3 OC1A- PD4 OC1B- PD5 0C2- PD7 FOR duty
        Message 3 of 4 , Aug 2, 2008
        • 0 Attachment
          hi
          you have to use timer/counter(n) register. this is ATMEGA16's PWM
          there are alltogether 4 pwm ports
          OC0-    PB3
          OC1A-  PD4
          OC1B-  PD5
          0C2-     PD7
           
          FOR duty cycle X %
          example  program. you can write like this.
           
           
          TCCRX=OXVV ; // VV YOU HAVE TO SET FROM DATA SHEET NORMALLY IT IS 0X6B;IN COMPARE MODE
          OCRX = 0XUU; //UU=255* X%
              
           
           
           
           
           
            NANDAN
                                   

           
           
        Your message has been successfully submitted and would be delivered to recipients shortly.