AnsweredAssumed Answered

9S12E256

Question asked by Ingo_Michael on Feb 7, 2016
Latest reply on Feb 23, 2016 by lama

Hello,

 

I´ve made this board below and I have testet the IO with the following code on each port (I used different Register names for each port):

 

                    LDAA #$00FF

                    STAA DDRB

 

Main:

                    LDAA #$00FF

                    STAA PORTB

                    JSR DELAY

                    LDAA #$0000

                    STAA PORTB

                    JSR DELAY

                    BRA Main

 

 

This works great but If I use bset or bclr instruction then it does not work. I am not able to toggle the led on my breadboard with the following code.)

Example:

 

                    BSET 0, DDRB                         ;also tried BSET DDRB, %00000001 without success and also the rest of the code in that way without success

 

Main:        

                    BSET 0,PORTB                      

                    JSR DELAY

                    BCLR 0,PORTB

                    JSR DELAY

                    BRA Main

 

Can anyone help me?

 

I have to say, I am new to the 16Bit HCS MCU´s but I have a good knowledge on the HCS08. I always write my code in Assembly language.

 

-BR Ingo

 

 

 

 

 

MC9S12E256.jpg

Outcomes