Author Topic: Switching between tri-state (input,no pull-up) and output high without tmp state  (Read 2048 times)

0 Members and 1 Guest are viewing this topic.

Offline eneuroTopic starter

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Hello,
I'd like to ensure that by enabling PUD bit in the MCUCR register in AVR (ATTiny85 Ports I/O part datasheet attached) I will be able to switch between tri-state (input, no pull-up) and output high without temporary intermediate state with either pull-up enabled or output low.

If  trying to switch to output high while in tri-state input and no pull-up (DDxn,PORTxn): (0,0) I can do it this way I hope:
(0,0): set PUD to 1 im MCUCR - I should be in tri-state while this X mark in table 10-1 shows something like this
(0,1): set PORTxn to 1 - there should be no pull-up while PUD is enabled
(1,1): set direction bit to 1, so now I have this pin configured as output high.

(0,1) When I clear direction bit to 0 (with PUD still enabled) I should swith to input tri-state and no pull-up, so this means if it were any external pull down on this pin it will stop source current?

It is not clear for me this sentence from this datasheet with PUD seting in MCUCR to disable all pull-ups in all ports.
I can do it, while there is a point in program flow, where all pins can be in tri-state input (no internal pull-up), and then I need 2 of them set to either output high or low, but without any internal pull-up or low state on one of them going high.
Of course I will test it, but in theory this sequence with PUD enabled should do the trick or I missed something?  :o

« Last Edit: April 24, 2014, 06:36:04 pm by eneuro »
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf