|
发表于 2009-11-6 14:12:44
|
显示全部楼层
是用Applilet生成的吗 -_-?! 我是直接用Applilet生成的程序 不过生成的程序是什么意思我就不知道了。。。。
![](http://cache.amobbs.com/bbs_upload782111/files_21/ourdev_500393.jpg)
(原文件名:1.jpg)
System_equ.INC
SystemClock EQU 00H
Sys_Half EQU 01H
Sys_Quarter EQU 02H
Sys_OneEighth EQU 03H
Sys_OneSixteen EQU 04H
Sys_SubClock EQU 05H
ST_Level0 EQU 00H
ST_Level1 EQU 01H
ST_Level2 EQU 02H
ST_Level3 EQU 03H
ST_Level4 EQU 04H
PS_HALT EQU 00H
PS_STOP EQU 01H
CG_X1STAB_SEL EQU 05H
CG_X1STAB_STA EQU 01fH
CG_CPU_CLOCKSEL EQU 00H
CG_Mainosc EQU 08H
system.asm
Clock_Init:
PUSH AX
SET1 PM12.1 ;p121 input mode
SET1 PM12.2
CLR1 EXCLK ;X1/X2 input mode
SET1 OSCSEL
CLR1 MSTOP
MOV A, #CG_X1STAB_STA ; CG_X1STAB_STA=0x01fH
MOV X, A
CLOCK_INIT_WAIT:
MOV A, OSTC
AND A, X
CMP A, X
BNZ $CLOCK_INIT_WAIT
MOV A, #CG_X1STAB_SEL ;CG_X1STAB_SEL=05H
MOV OSTS, A
SET1 MCM0 ;X1 Input clock operation
SET1 XSEL
CLR1 AMPH ;2MHz<=fx<=10MHz
SET1 XSEL
SET1 MCM0
SET1 PM12.4 ;P123/124 input mode
SET1 PM12.3
CLR1 EXCLKS ;XT1 input mode
SET1 OSCSELS
MOV A, #CG_CPU_CLOCKSEL ;CG_CPU_CLOCKSEL=00H
MOV PCC, A
POP AX
RET
END |
|