SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By KamPutty
Hi all,

Well, I've been thrown a atmega32 problem (a friend is doing some programming).

I've not used a atmega32 before, and he is using the iar compiler, so my knowledge on that uP is limited at best.

Here it is, simple I'm sure...

I have 4 io pins, lets say:


I want these pins to be

#1. High
#2. Low
#3. Float - High-Z

From what I can see, I can adjust the direction of the ports by adjusting the DDRx register


A "1" bit means output for that pin
A "0" bit means input for that pin

How do I do a float or high-Z state?

Any Thoughts?

~Kam (^8*
By Lajon
Table 20 "Port Pin Configurations" in the data sheet explains this. The short answer is that pins are hi-z when configured as inputs.
By stevech
Config as inputs and with a 0 in the output register to disable the weak pull-up