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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,163 次查看
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

标签 (1)
0 项奖励
回复
2 回复数

864 次查看
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 项奖励
回复

864 次查看
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 项奖励
回复