Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
|
I have written the following subroutine to initiate the SPI interface. In the end of the routine I am writing $54 to SPOCR2 register. But when I debug the program and check the register location, $54 does not get written to SPOCR2 location. Any body knows the reason. Why I can not see the $54 on SPOCR2 location. The code is shown below SPOCR1 equ $D0 SPOCR2 equ $D1 SPOBR equ $D2 SPOSR equ $D3 SPODR equ $D5 PORTS equ $D6 DDRS equ $D7 Upper_Byte equ $0B00 Lower_Byte equ $0B01 org $0800 DATA FCB 00,01 MAIN BSR INIT BSR SAMPLE INIT BSET DDRS, #%11101100 BSET SPOBR, #%00000001 BSET SPOCR2, #%01010100 MOVB #$00, Upper_Byte MOVB #$00, Lower_Byte rts __________________________________________________ |
|
|
|
At 01:27 PM 11/12/02 -0800, Baljit Singh wrote: >[...] $54 does not get written to SPOCR2 location. On the older HC12 I use (812A4), SP0CR2 has only three bits that can be written. The other bits are read-only zeros. Perhaps you meant to write to SP0CR1? Stephen -- Stephen Trier Technical Development Lab Cleveland FES Center / CWRU / KG8IH |
|
|
|
Sorry yes, it is SPOCR1. I have MC68HC912B32 microcontroler. When I write to SPOCR1 register. Why I cannot see the value being written in debuger. I have the same problem with PortS. When I write $80. In the memory it shows $03 being written. Thank you Baljit --- Stephen Trier <> wrote: > At 01:27 PM 11/12/02 -0800, Baljit Singh wrote: > >[...] $54 does not get written to SPOCR2 location. > > On the older HC12 I use (812A4), SP0CR2 has only > three bits that can be > written. The other bits are read-only zeros. > Perhaps you meant to write > to SP0CR1? > > Stephen > > -- > Stephen Trier > Technical Development Lab > Cleveland FES Center / CWRU > / KG8IH __________________________________________________ |
|
|
|
I have written the following subroutine to initiate the SPI interface. In the end of the routine I am writing $54 to SPOCR1 register. But when I debug the program and check the register location, $54 does not get written to SPOCR1 location. Any body knows the reason. Why I can not see the $54 on SPOCR1 register memory location. The code is shown below SPOCR1 equ $D0 SPOCR2 equ $D1 SPOBR equ $D2 SPOSR equ $D3 SPODR equ $D5 PORTS equ $D6 DDRS equ $D7 Upper_Byte equ $0B00 Lower_Byte equ $0B01 org $0800 DATA FCB 00,01 MAIN BSR INIT BSR SAMPLE INIT BSET DDRS, #%11101100 BSET SPOBR, #%00000001 BSET SPOCR2, #%01010100 MOVB #$00, Upper_Byte MOVB #$00, Lower_Byte rts __________________________________________________ |