Hello,
I am preparing a automatic lightning solution, that controlls lots of LEDs. My problem is the following:
- when the MCU starts up on power-on, all port become high for a short period of time. This causes all LEDs to flash.
Can I prohibit or influence this behaviour?
thanks for your advices!
Jedi82
Do you mean pins are high until you initialize DDRx registers, or do you mean pins are driven high from the moment you write tto DDRx until the moment you write initial pins values to PORTx or PTx registers?
1) In the first case peraphs your circuit lacks pull down resisotrs.
2) Each output capable port pin must have some latch. To initialize these latches you should write initial pin states pattern to PORTx / PTx register before switching pin direction(s) to output(s).
PORTA &= ~1;
DDRA |= 1;
to be more precise. the short peak is only visible on Port J.
Don't find any information in the datasheet!