AVR ATMega32 simple port question!

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:

PB0

PB1

PC0

PC1

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

DDRB and DDRC

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*

Table 20 “Port Pin Configurations” in the data sheet explains this. The short answer is that pins are hi-z when configured as inputs.

/Lars

Config as inputs and with a 0 in the output register to disable the weak pull-up