微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 电源设计 > 利用电位计替代旋转开关设计方案

利用电位计替代旋转开关设计方案

时间:12-08 来源:互联网 点击:

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

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top