📄 kdv200-b.asm
字号:
mov r2,#ia_adc_len_data ;填充电流ad采样的电压缓冲区
main_adc_ia_next:
lcall ia_sampling_data_save_dispose ;
djnz r2,main_adc_ia_next
setb ea
lcall resvol_range_count ;计算电位器100%范围的电压值(满开电压-满关电压)
lcall refresh_watchdog_timer ;更新看门狗时间
lcall resvol_lingmindu_count ;电位器(开度)灵敏度计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall res_sampling_data_save_dispose ;电位器采样处理
lcall refresh_watchdog_timer ;更新看门狗时间
mov resvolhold_reg,resvolh_new_reg
mov resvollold_reg,resvoll_new_reg
lcall res_sampling_data_count ;计算电位器平均值
lcall refresh_watchdog_timer ;更新看门狗时间
lcall resvolreg_update_dispose ;根据电位器灵敏度更新电位器数据
lcall refresh_watchdog_timer ;更新看门狗时间
lcall res_vol_to_percent_dispose ;电位器百分比计算
lcall refresh_watchdog_timer ;更新看门狗时间
;- - - - - - - - - - - -
lcall iavol_range_count ;计算电流100%范围的电压值(20ma电压-4ma电压)
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iapercent_lingmindu_count ;4~20ma百分比灵敏度计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iavol_lingmindu_count ;4~20ma电压灵敏度计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall ia_sampling_data_save_dispose ;电流采样处理
lcall refresh_watchdog_timer ;更新看门狗时间
lcall ia_sampling_data_count ;计算电流平均值
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iavolreg_update_dispose ;根据电流灵敏度更新ia电流数据
lcall refresh_watchdog_timer ;更新看门狗时间
lcall ia_vol_to_percent_dispose ;4~20ma电流百分比计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iapercent_update_dispose ;根据电流百分比灵敏度更新ia电流百分比数据
lcall refresh_watchdog_timer ;更新看门狗时间
mov r6,iah_percent_reg
mov r7,ial_percent_reg
mov z1,r6
mov z2,r7
lcall percent_display
lcall read_xiaozero_dispose
lcall refresh_watchdog_timer ;更新看门狗时间
;-----------------------
;-----------------------
main_loop:
lcall resvol_range_count ;计算电位器100%范围的电压值(满开电压-满关电压)
lcall refresh_watchdog_timer ;更新看门狗时间
lcall resvol_lingmindu_count ;电位器(开度)灵敏度计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall res_sampling_data_save_dispose ;电位器采样处理
lcall refresh_watchdog_timer ;更新看门狗时间
lcall res_sampling_data_count ;计算电位器平均值
lcall refresh_watchdog_timer ;更新看门狗时间
lcall resvolreg_update_dispose ;根据电位器灵敏度更新电位器数据
lcall refresh_watchdog_timer ;更新看门狗时间
lcall res_vol_to_percent_dispose ;电位器百分比计算
lcall refresh_watchdog_timer ;更新看门狗时间
;- - - - - - - - - - - -
lcall iavol_range_count ;计算电流100%范围的电压值(20ma电压-4ma电压)
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iapercent_lingmindu_count ;4~20ma百分比灵敏度计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iavol_lingmindu_count ;4~20ma电压灵敏度计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall ia_sampling_data_save_dispose ;电流采样处理
lcall refresh_watchdog_timer ;更新看门狗时间
lcall ia_sampling_data_count ;计算电流平均值
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iavolreg_update_dispose ;根据电流灵敏度更新ia电流数据
lcall refresh_watchdog_timer ;更新看门狗时间
lcall ia_vol_to_percent_dispose ;4~20ma电流百分比计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iapercent_update_dispose ;根据电流百分比灵敏度更新ia电流百分比数据
lcall refresh_watchdog_timer ;更新看门狗时间
;- - - - - - - - - - - -
lcall iavol_diaoxian_count ;4~20ma掉线计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall iavol_diaoxian_dispose ;4~20ma掉线处理
lcall refresh_watchdog_timer ;更新看门狗时间
lcall key_huamian_dispose ;显示画面及按键处理
lcall refresh_watchdog_timer ;更新看门狗时间
lcall ia_res_percent_comp_dispose ;在自动控制状态下,电流百分比控制电位器百分比
lcall refresh_watchdog_timer ;更新看门狗时间
lcall res_res_percent_comp_dispose ;在手动控制状态或err2状态下,手动设置百分比控制电位器百分比
lcall refresh_watchdog_timer ;更新看门狗时间
lcall dianji_dir_dispose ;电机控制处理
lcall refresh_watchdog_timer ;更新看门狗时间
lcall resvol_duzhuan_count ;电位器堵转计算
lcall refresh_watchdog_timer ;更新看门狗时间
lcall alarm_out_dispose ;告警输出处理
lcall refresh_watchdog_timer ;更新看门狗时间
lcall dongzuo_man_gao_di_dispose ;动作到100%或0%
ljmp main_loop ;
;::::::::::::::::::::::::::::::::::|---------|:::::::::::::::::::::::::::::::::::::::::::::
;::::::::::::::::::::::::::::::::::| 子程序 |:::::::::::::::::::::::::::::::::::::::::::::
;::::::::::::::::::::::::::::::::::|---------|:::::::::::::::::::::::::::::::::::::::::::::
;* * * * * * * * * * * * * * * * * * * * * *
; 标号 :watchdog_timer_set
; 功能 :
; 入口条件:
; 出口信息:
watchdog_timer_set:
mov wdcon,#0e0h
setb wde
setb wdr1
setb wdr2
ret
;* * * * * * * * * * * * * * * * * * * * * *
; 标号 :t0_set
; 功能 :定时1S
; 入口条件:
; 出口信息:
t0_set:
mov time_1s_reg,#time_1s_data
mov th0,#th0_data ;
mov tl0,#tl0_data ;
anl tmod,#11110000b ; T0:16位定时方式
orl tmod,#00000001b ;
clr tf0 ;清定时器 0 溢出标志
setb tr0 ;启动T0运行
setb et0 ;允许T0中断
setb pt0 ;T0中断优先级为“低”
ret
;* * * * * * * * * * * * * * * * * * * * * *
; 标号 :t1_set
; 功能 :
; 入口条件:
; 出口信息:
t1_set:
mov th1,#th1_data ;
mov tl1,#tl1_data ;
anl tmod,#00001111b ; T1:16位方式
orl tmod,#00010000b
clr tf1
setb tr1 ;启动T1运行
setb et1 ;允许T1中断
setb pt1 ;中断优先级为“低”
ret
;* * * * * * * * * * * * * * * * * * * * * *
; 标号 :sys_set
; 功能 :
; 入口条件:
; 出口信息:
sys_set:
mov x1,#00h
mov x2,#00h
mov y1,#00h
mov y2,#00h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -