Making PORT A an input

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

Making PORT A an input

1,116 次查看
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 回复

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