利用电位计替代旋转开关设计方案
x curve value since overflow
P2S2: ;read lower and upper thresholds using switch position value
MOV A, SWPOS ;multiply switch position value by 2
MOV B, #02H
MUL AB
MOV B, A ;save multiplied value as table offset
MOV DPTR, #HYSTBL;load base address of table pointer
MOVC A, @A+DPTR;look up table value from base address + offset
MOV LWRVAL, A;read lower threshold value
MOV A, B
INC DPTR ;increment base address
MOVC A, @A+DPTR
MOV UPRVAL, A;read upper threshold value
RET
HYSTBL:;TABLE OF LOWER & UPPER THRESHOLDS FOR SEVEN POSITION SWITCH
DB00D,41D;Switch state 0
DB34D,77D;Switch state 1
DB70D,113D;Switch state 2
DB106D,149D;Switch state 3
DB142D,185D;Switch state 4
DB178D,221D;Switch state 5
DB214D,255D;Switch state 6
电位计开关设计方 相关文章:
- 电源设计小贴士 1:为您的电源选择正确的工作频率(12-25)
- 用于电压或电流调节的新调节器架构(07-19)
- 超低静态电流电源管理IC延长便携应用工作时间(04-14)
- 电源设计小贴士 2:驾驭噪声电源(01-01)
- 负载点降压稳压器及其稳定性检查方法(07-19)
- 电源设计小贴士 3:阻尼输入滤波器(第一部分)(01-16)