naxviewer.blogg.se

Attiny wire library
Attiny wire library









attiny wire library
  1. #Attiny wire library how to#
  2. #Attiny wire library software#
  3. #Attiny wire library code#

To switch the pull-up resistor off, PORTxn has to be written logic zero or the pin has to be configured as an output pin. If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. Section 10.2.1 of the ATtiny85 data sheet states:

#Attiny wire library code#

This means that the above code enables the SDA/SCL pin internal pull-ups, then sets the SDA/SCL pins as outputs, which automatically disables the internal pull-ups. However, from my reading of the ATtiny85 data sheet it seems to me that the internal pull-ups are disabled when a pin direction is set to output. USISR = (1<

#Attiny wire library software#

(1<Disable Interrupts. USIDR = 0xFF // Preload dataregister with "released level" data.

attiny wire library

PORT_USI |= (1<

#Attiny wire library how to#

I've imported an Arduino sketch into Atmel Studio to get an understanding of how to use TWI to communicate with peripheral devices - the sketch is simple communication between an ATtiny85 and an MCP23008 I/O expander. The details of why I'm asking this question: Is it possible to enable the internal pull-up resistors on the PortB pins of an ATtiny85 when the direction of those pins is set as "output"?











Attiny wire library