Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | Any body know the SPI interface

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Any body know the SPI interface - baljit singh - Nov 12 16:27:00 2002

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

__________________________________________________






(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: Any body know the SPI interface - Stephen Trier - Nov 12 17:16:00 2002

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



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Any body know the SPI interface - baljit singh - Nov 12 17:35:00 2002

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

__________________________________________________




______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

help with the SPI interface - baljit singh - Nov 12 17:41:00 2002

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
__________________________________________________



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )