avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #41502] TWI Library changes TIMSK2


From: anonymous
Subject: [avr-libc-dev] [bug #41502] TWI Library changes TIMSK2
Date: Fri, 07 Feb 2014 13:01:26 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0

URL:
  <http://savannah.nongnu.org/bugs/?41502>

                 Summary: TWI Library changes TIMSK2
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Fr 07 Feb 2014 13:01:25 UTC
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Header files
                  Status: None
        Percent Complete: 0%
             Assigned to: None
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.7.1
           Fixed Release: None

    _______________________________________________________

Details:

TWI_Init changes the Timer/Counter Interrupt Mask Register of Timer 2 (TIMSK2)
as you can see here:

TWI_Init (void)
{
  // Port Setup
  DDRC &= ~((1 << PC0)|(1 << PC1));
  PORTC |= (1 << PC0)|(1 << PC1);
  
  // Setup TWI Speed to 400kHZ (TWPS = 1)
  TWBR = 3;
  
  // Using TIMER2 to detect timeout
  TCCR2B = (7 << CS20);
  TIMSK2 = (1 << OCIE2A);
  
  OCR2A = 125;
  
  // Interrupts REQUIRED!
  sei();
}





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fr 07 Feb 2014 13:01:25 UTC  Name: twi.c  Size: 1kB   By: None

<http://savannah.nongnu.org/bugs/download.php?file_id=30480>
-------------------------------------------------------
Date: Fr 07 Feb 2014 13:01:25 UTC  Name: twi.h  Size: 244B   By: None

<http://savannah.nongnu.org/bugs/download.php?file_id=30481>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?41502>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]