Is it possible to influence port-initialisation on startup (S12XF512)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to influence port-initialisation on startup (S12XF512)

841 Views
jedi82
Contributor I

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

Labels (1)
0 Kudos
Reply
2 Replies

542 Views
kef
Specialist I

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;

0 Kudos
Reply

542 Views
jedi82
Contributor I

to be more precise. the short peak is only visible on Port J.

Don't find any information in the datasheet!

 

0 Kudos
Reply