Analog pins vs Digital pins for VGA

Is there any diffirence between using Digital or Analog pins? Is one faster than the other or something?
I’m in a pretty tight pin situation where i must take up only 3 pins for RGB. Would stuff like charlieplexing work?

Flamore: Is there any diffirence between using Digital or Analog pins? Is one faster than the other or something?

Arduino wise not really. See the wiring_digital.h:

void digitalWrite(uint8_t pin, uint8_t val)
{
    uint8_t timer = digitalPinToTimer(pin);
    uint8_t bit = digitalPinToBitMask(pin);
    uint8_t port = digitalPinToPort(pin);
    volatile uint8_t *out;

    if (port == NOT_A_PIN) return;

    // If the pin that support PWM output, we need to turn it off
    // before doing a digital write.
    if (timer != NOT_ON_TIMER) turnOffPWM(timer);

    out = portOutputRegister(port);

    uint8_t oldSREG = SREG;
    cli();

    if (val == LOW) {
        *out &= ~bit;
    } else {
        *out |= bit;
    }

    SREG = oldSREG;
}

What you're basically implying is that i could use analog pins, but would it work on a bare ATMega though? And why doesn't anyone use that method in their projects?

“analog pins” are digital pins that are also connected to the internal analog to digital multiplexer. You can use them like any other digital pin. You can even reference them as digital pins 14 to 19 if that helps make things more clear in your code. (A0 is 14, thru A5 is 19).

Looks at their description in the data sheet - analog input feature is not even mentioned to start, not until much later.

All pins on a UNO are identical digital pins. Pins 14 to 19 happen to have the additional ability to be used as ADC inputs. Pins 18 and 19 (Also Known As “A4” and “A5” of course) have yet another available and very important function, as they connect the hardware I2C interface.

The Nano and Pro Mini, using a different package of essentially the same processor, also make available A6 and A7 which are only ADC inputs with no digital functionality. The Nano is far more practical than the UNO for most purposes. The Pro Mini is of course, when you do not need USB.

Flamore:
And why doesn’t anyone use that method in their projects?

Whatever makes you think that? :roll_eyes: Have you not seen any serious projects at all?

Why on earth would you want to use a “bare ATMega”? A Pro Mini (clone) is dead cheap and puts it all together for you , ready to use! :grinning:

Why on earth would you want to use a "bare ATMega"? A Pro Mini (clone) is dead cheap and puts it all together for you , ready to use! :grinning:

I'm making my own board, and board on a board isn't that efficent.

Lots of projects incorporate say the '328P chip, and build up around it. Here's one of mine for example, the 328P is in the lower left corner. You can recognize the crystal, 22pF caps (lighter color), 0.1uF decoupling caps, pullup resistor, ICSP header and FTDI header for bootloading and Serial downloads. And then everything else was added to make the project. All IO was used as digital IO. |500x440