Making PORT A an input

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

Making PORT A an input

1,115件の閲覧回数
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

ラベル(1)
0 件の賞賛
返信
1 返信

611件の閲覧回数
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 件の賞賛
返信