bugAVR C Runtime Library - Bugs: bug #41502, TWI Library changes TIMSK2

 
 

bug #41502: TWI Library changes TIMSK2

Submitted by:  None
Submitted on:  Fri 07 Feb 2014 01:01:25 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: Header files
Status: NonePercent Complete: 0%
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: OpenRelease: 1.7.1
Fixed Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 07 Feb 2014 01:01:25 PM UTC, original submission:

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();
}

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #30480:  twi.c added by None (1kB - application/octet-stream)
file #30481:  twi.h added by None (244B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 07 Feb 2014 01:01:25 PM UTCNoneAttached File-=>Added twi.c, #30480
      Attached File-=>Added twi.h, #30481

    Back to the top


    Powered by Savane 3.1-cleanup