antonio echeverria

Output pin problem

Discussion created by antonio echeverria on Dec 8, 2009
Latest reply on Dec 8, 2009 by bigmac

Hello, i have a "simple" problem, im setting and clearing an output pin (PTB0) in my program but it doesn´t change, i have changed the output to PTB6 but it neither works (output initialization included), I have other 2 output pins int PTBA and they work well, i dont find the reason of failure... Can anyone help please?

 This is my code:

 

;*** port Init 

        LDA     #$0C    ; PTA0 and PTA1 as input       

        CLR     PTAD    ; PTA2 and PTA3 outputs (this 2 are working)
        STA     PTADD   ;                             
       
        LDA     #$03    ; PTB0 and PTB1 outputs
        CLR     PTBD    ; the rest inputs
        STA     PTBDD   ;    

 

;***port def ***

 

SalFRE EQU    6   ;Out in (PTB0)

 

;*** main ***

 

FRE_DI  BCLR     SalFRE,PTBD    ; 2 ms pulse
           JSR      DLY2
           BSET     SalFRE,PTBD
           RTS

 

;**** Then added a bigger pulse duration to appreciate the change in a LED 

 

FRE_DI  BCLR     SalFRE,PTBD    ; 402 ms total pulse duration
           JSR      DLY100
           JSR      DLY100
           JSR      DLY100
           JSR      DLY100

           JSR      DLY2
           BSET     SalFRE,PTBD
           RTS

Outcomes