I'm currently trying to connect a 7×5 dot matrix to an AVR ATMega328p. I'm already using port B/D and I would like to use port C so that I have extra output pins. My question is, can I use port C as digital output pins without ruining the microcontroller? I know that this port is normally used for analog-digital conversion. If so, do I need to add additional configurations inside my C program?
Electronic – AVR atmega328p – Can I use port C as digital output pins
atmega328pavravr-gcc
Related Topic
- Electronic – LED remains off on ATmega16
- AVR IO Alternative Functions Priority
- Electronic – Arduino Nano ISP turns into the target program (as well as target MCU)
- Electronic – Due to overcurrent, shouldn’t I be extremely cautious when setting an I/O pin as Output
- Electronic – Getting started with AVR programming concepts
Best Answer
Yes you can.
Below table describes about Sink and source capabilities: VOH is when you try to output a high signal. The current should be less than a particular value which you can find in the same table. VOL is when you output a logic zero. Microcontroller can sink current and you should also care about limiting the current. Excess current may lead to damage of the IO Pin or the whole MCU.
Below are some notes about the analog function rich port C (in some packages, other ports) describing the GPIO capabilities and precautions to be taken.
Follow the normal routine as configuring other pins.