0
\$\begingroup\$

As the ports are connected to pull-up resistors; the port pin values should be at level 1 when not connected to the outside world.I wrote the below code to set the lower half of PORTA as input and the upper half as output. As I wrote 0xFF on PORTA, i was expecting to get 0xFF with the last IN instruction. Instead, I get with the simulator 0xF0, only the output pins got updated, what about the pull-up resistors? Actually, the initial value of PINA is 0. is it a software bug?

LDI R16, 0xF0
OUT DDRA, R16
SER R16
OUT PORTA,R16
NOP
NOP
IN R16, PINA 

Thank you.

\$\endgroup\$
1

1 Answer 1

0
\$\begingroup\$

Based on Link to discussion about the same topic i would say:

The pull-ups are not "used" in the simulator. Therefore, the observed behaviour is as expected.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the confirmation. I don't have access to a hardware board otherwise I would have tested it. \$\endgroup\$
    – KM23
    Jan 24 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.