# AVR Input not reading correct value

I feel like this is a true beginners problem, but I fail to see what I am doing wrong here:

I have a SIP switch connected to port A of an Atmega32 and I cannot read correct values from the port. Here is the relevant part of the circuit diagrm:

Now in code, I configure port A as input and activate the internal pullups, however I always read the data word I write to the port when configuring the pullups. Measuring the voltage at the pins with a multimeter I read the correct highs and lows according to the position of the single switches.

The rest of my circuit works, SPI communication and all. Still I reproduced the problem with a minimalist example, what could possibly go wrong here?

#include <avr/io.h>

int main(void)
{
PORTA = 0xff;
DDRA = 0xff;
while(1)
{
char bla = PORTA;
}
}


I cannot rule out, that I have damaged the port, through misconfiguration and the resulting short circuit. So should my next step be to exchange the controller?

The input available at port <x> is read from PINx. PORTx contains the latched values last set there.

char bla = PINA;

• There is a saying here in Germany that roughly translates to he who can read has clear advantages in life :). Thanks for spotting my mistake so quickly. – Herr von Wurst Sep 11 '14 at 11:33
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.183041512966156, "perplexity": 2167.271147906516}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579250597458.22/warc/CC-MAIN-20200120052454-20200120080454-00488.warc.gz"}