📄 sensor.asm
字号:
*
.mmregs
.include constant.inc
.include c54.inc
.def sensor_init
.ref sensor_map
.ref io_map
.sect "progsys"
*********************** sensor_init *********************
sensor_init:
*CTLRB=0x0f 使用12M晶振,=0x0d使用内部振荡器,不用12M晶振
ST Sensor_CTRLB,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x0d,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*CTLRC=0x60
ST Sensor_CTRLC,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x40,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*ICR=0x00
ST Sensor_ICR,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x0,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*ISR=0x00
ST Sensor_ISR,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x03,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*THR=0x48
ST Sensor_THR,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x10,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*DTR=0x0A
ST Sensor_DTR,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x0b,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*DCR=0x04
ST Sensor_DCR,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x04,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*PGC=0x0f
ST Sensor_PGC,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x7,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
*ICR=0x41
ST Sensor_ICR,*(sensor_map)
PORTW *(sensor_map),Sensor_index
ST #0x41,*(sensor_map)
PORTW *(sensor_map),Sensor_data
RPT #3000
NOP
RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -