Problem w/ PORTA & B after RESET

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem w/ PORTA & B after RESET

3,628件の閲覧回数
thesheriff
Contributor I
I am using the 9S12XDP512 from TechArts and connecting 3 Lynxmotion Tracker Sensors to PORTA[7:5], PORTA[2:0], and PORTB[7:5]. The Tracker Sensor outputs HI for WHITE light, and LO for BLACK light. I have configured the Data Direction registers for PORTA & B (i.e. DDRA = 0x14; DDRB = 0x1F; ). Also, the MCU provides the +5VDC to power the sensors.
 
The problem occurs when I switch the controller to 'Run' and press the 'Reset' button. Nothing happens, until I place a WHITE sheet of paper under the PORTA sensors. Only then does the program execute. Why does my program require an external event to start?
 
Thanks for your help.
ラベル(1)
0 件の賞賛
返信
1 返信

693件の閲覧回数
Lundin
Senior Contributor IV
Not sure if I understand what you mean. Here is something you should check though:

PORTA and PORTB doesn't have pull-up enabled out of reset. Unless you write to PUCR or have external pull resistors, you will get random values when the port is configured as input.
0 件の賞賛
返信