Making PORT A an input

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

Making PORT A an input

847 Views
Cliffyballs
Contributor I

Is it possible to make Port A an input for the push button componet. If so how would I go about doing this?  Port A is set up as the input and the value never changes in the address. This is the code i am working with.

 

 

XDEF          Entry

ABSENTRY   Entry

ROMStart     EQU $4000

        PORTA EQU 0

        PORTB EQU 1

        DDRA   EQU 2

        DDRB    EQU 3

        ORG ROMStart

Entry:

         LDAA    #$00

         STAA    DDRA

         LDAB     #$FF

         STAB     DDRB

         MOVB     #0,PORTB

Loop:

 

         BRCLR    PORTA,#$FF,Loop

         LDAA     PORTA

         STAA     PORTB

         BRA       Loop

         RTS

;*****************************************

;* Interrupt Vectors *

;*****************************************

        ORG $FFFE

       DC.W Entry

Labels (1)
0 Kudos
Reply
1 Reply

343 Views
CompilerGuru
NXP Employee
NXP Employee

It might help to mention what architecture (guessing S12 from the assembly code) and which setup (debug connection or Simulator?) you are using. Which derivative?

 

Also what "push button componet" are you refering too, a real button on the HW or some simulator component? With the simulator (and actually also with HW) you may want to have a look at the Visualization component in the HIWAVE debugger.

 

Daniel

0 Kudos
Reply