how to enable internal pull ups resistors ?
-
- Posts: 94
- Joined: 05 May 2009 18:31
- Location: Somewhere in Europe
how to enable internal pull ups resistors ?
I read the mikroC for AVR documentation and saw an example for the PIC MCU, but I can't figure out how I could do that with the mikroC for AVR. For example, in the case of an Atmega328 I would like to activate the pull-up resistors at the PD2 and PD3 pins and I don't know how to do that !! Please, can you give me an example code?
Re: how to enable internal pull ups resistors ?
Hi,
Please have a look at the ATmega328 datasheet (http://ww1.microchip.com/downloads/en/D ... asheet.pdf), section 13. :
Filip.
Please have a look at the ATmega328 datasheet (http://ww1.microchip.com/downloads/en/D ... asheet.pdf), section 13. :
Regards,If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. To switch the
pull-up resistor off, PORTxn has to be written logic zero or the pin has to be configured as an output pin. The port pins are
tri-stated when reset condition becomes active, even if no clocks are running.
Filip.
-
- Posts: 94
- Joined: 05 May 2009 18:31
- Location: Somewhere in Europe
Re: how to enable internal pull ups resistors ?
Thanks. I've seen this in the datasheet in the meantime.