没有Megawin的汇编的,以下是其他IC写的汇编。
该程序置于定时器中断中:
//=============LED驱动=================
JSI Dmot_SpdCnt,Emot_Max,LB_00 //小于跳, Emot_Max为PWM级数
clrr Dmot_SpdCnt
movr Dmot_Speed1,0
btrss FZ
bsr IOLedRed //红灯
movr Dmot_Speed2,0
btrss FZ
bsr IOLedGreen //绿灯
movr Dmot_Speed3,0
btrss FZ
bsr IOLedBlue //蓝灯
LB_00:
movr Dmot_Speed1,0
subar Dmot_SpdCnt,0
btrsc FC
bcr IOLedRed //红灯
movr Dmot_Speed2,0
subar Dmot_SpdCnt,0
btrsc FC
bcr IOLedGreen //绿灯
movr Dmot_Speed3,0
subar Dmot_SpdCnt,0
btrsc FC
bcr IOLedBlue //蓝灯
LB_01:
incr Dmot_SpdCnt,1
|