motorola 16 mcu的eeprom程序

来自「motorola 16 mcu的EEPROM程序」· 代码 · 共 101 行

TXT
101
字号
;****************************************
;*       HC12 Simple Assembly Program:  *
;****************************************

   XDEF Entry,main,_Startup
   ABSENTRY _Startup ; mark this as my application entry point


;****************************************
;*       HC12 Simple Assembly Program:  *
;****************************************

RamStart       EQU  $1000
RomStart       EQU  $4000
BankStart      EQU  $308000

; where to allocate stack pointer
STACK     EQU $10FF

; port/peripheral declarations
CRGFLG    EQU $0037
CRGINT    EQU $0038
RTICTL    EQU $003B

; external symbols
 XDEF Entry,main,_Startup

;DataSection:     SECTION
	ORG RamStart
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 R0:	DS.B	1
 R1:	DS.B	1
 R2:	DS.B	1
 R3:	DS.B	1
 R4:	DS.B	1
 R5:	DS.B	1
 R6:	DS.B	1
 R7:	DS.B	1

YEAR:     DS.B   1
MONTH:    DS.B   1
DAY:      DS.B   1
WEEK:     DS.B   1    	
HOUR:     DS.B   1
MINUTE:   DS.B   1
SECOND:   DS.B   1

TIMETX:   DS.B   1

TIMERX:   DS.B   1
	
TIME:     DS.B   1;;  TIMEBIT1:TIMEBIT0=TIME[1:0]	
FLAG:     DS.B   1;;  FLAG11:FLAG10=FLAG[1:0]

;
; Insert here your data definition
;


; CodeSection:	SECTION
  ORG BankStart
RTIInit:
  ; setup of the RTI interrupt frequency
  ; adjusted to get 1 millisecond (1.024 ms) with 16 MHz oscillator
  MOVB #$1F, RTICTL ; set RTI prescaler
  MOVB #$80, CRGINT ; enable RTI interrupts
  RTC

; CodeSection:	SECTION
  ORG RomStart
PORTB:   EQU   $01

;
; Insert here your source code
;
_Startup:
Entry:
main:
    LDS     #STACK     ; Initialize here your stack pointer
    ; Insert here your own code
    ;;CALL    RTIInit,PAGE(RTIInit) ; initialize RTI
    ;;CLI                            ; enable interrupts
;;/***************/SD2000数据读取程序/**************/
;;         SDA:SCL=PORTB[6:7]
;;





;;……………………………………ACKPRO…………………………………………
;;
  MOVB #$FF,TIME
  CLR  TIME
  BSET TIME,#$02
  JSR  ACKPRO
  LDAA TIME
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;/*****************************/
;;/*    从实时时钟读入当前时间数据,接收数据放在

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?