Problem w/ PORTA & B after RESET

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

Problem w/ PORTA & B after RESET

3,355 Views
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.
Labels (1)
0 Kudos
Reply
1 Reply

420 Views
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 Kudos
Reply