Motor Controller (MC10B8CV1)
MC9S12XHY-Family Reference Manual, Rev. 1.01
Freescale Semiconductor
695
;------------------------------------------------------------------------------------------
; Motor Controller (MC10B8C) setup example
;------------------------------------------------------------------------------------------
; Timer defines
;------------------------------------------------------------------------------------------
T_START EQU $0040
TSCR1 EQU $06
TFLG2 EQU $0F
;------------------------------------------------------------------------------------------
; Motor Controller defines
;------------------------------------------------------------------------------------------
MC_START EQU $0200
MCCTL0 EQU M$00
MCCTL1 EQU M$01
MCPER_HI EQU M$02
MCPER_LO EQU M$03
MCCC0 EQU M$10
MCCC1 EQU M$11
MCCC2 EQU M$12
MCCC3 EQU M$13
MCDC0_HI EQU M$20
MCDC0_LO EQU M$21
MCDC1_HI EQU M$22
MCDC1_LO EQU M$23
MCDC2_HI EQU M$24
MCDC2_LO EQU M$25
MCDC3_HI EQU M$26
MCDC3_LO EQU M$27
;------------------------------------------------------------------------------------------
; Port defines
;------------------------------------------------------------------------------------------
DDRB EQU $0003
PORTB EQU $0001
;------------------------------------------------------------------------------------------
; Flash defines
;------------------------------------------------------------------------------------------
FLASH_START EQU $0100
FCMD EQU FLAS$06
FCLKDIV EQU FLAS$00
FSTAT EQU FLAS$05
FTSTMOD EQU FLAS$02
; Variables
CODE_START EQU $1000
; start of program code
DTYDAT EQU $1500
; start of motor controller duty cycle data
TEMP_X EQU $1700
; save location for IX reg in ISR
TABLESIZE EQU $1704
; number of config entries in the table
MCPERIOD EQU $0250
; motor controller period
;------------------------------------------------------------------------------------------
;------------------------------------------------------------------------------------------
ORG CODE_START
; start of code
LDS #$1FFF
; set stack pointer
MOVW #$000A,TABLESIZE
; number of configurations in the table
MOVW TABLESIZE,TEMP_X
electronic components distributor