導航:首頁 > 編程知識 > 數字電位器如何編程

數字電位器如何編程

發布時間:2023-05-12 21:19:08

『壹』 數字電位器mcp4018怎麼編程

Microchip 公司的MCP4017/18/19是通用的數字電位器,具有7位電阻網路解析度,有127個電阻,具有低的溫度系數:絕對值(0-70度C)為50ppm,比值為10ppm,工作電壓1.8V到5.5V. MCP4017/18/19可應用在設定電或失調調整,感測器校準,替代機械式電位計和可選擇增益和失調放大器設計.本文介紹了MCP4017/18/19的主要特性, 方框圖, 和微控制器(MCU) 典型連接框圖, 採用MCP4017調整非反相放大器失調和增益方框圖以及採用MCP4018的可編濾波器和採用MCP4017的惠斯通電橋調整框圖.

The MCP4017/18/19 devices are general purpose digital potentiometers intended to be used in applications where a programmable resistance with moderate bandwidth is desired.

This Data Sheet covers a family of three Digital Potentiometer and Rheostat devices. The MCP4018 device is the Potentiometer configuration, while the MCP4017 and MCP4019 devices are the Rheostat configuration.

MCP4017/18/19主要特性:

Potentiometer or Rheostat configuration options

7-bit: Resistor Network Resolution

127 Resistors (128 Steps)

Zero Scale to Full Scale Wiper operation

RAB Resistances: 5 kΩ, 10 kΩ, 50 kΩ, or 100 kΩ

Low Wiper Resistance: 100Ω (typical)

Low Tempco:

Absolute (Rheostat): 50 ppm typical (0℃ to 70℃)

Ratiometric (Potentiometer): 10 ppm typical

Simple I2C Protocol with read & write commands

Brown-out reset protection (1.5V typical)

Power-on Default Wiper Setting (Mid-scale)

Low-Power Operation:

2.5 μA Static Current (typical)

Wide Operating Voltage Range:

2.7V to 5.5V - Device Characteristics Specified

1.8V to 5.5V - Device Operation

MCP4017/18/19應用:

Applications generally suited for the MCP401X devices include:

Set point or offset trimming

Sensor calibration

Selectable gain and offset amplifier designs

Cost-sensitive mechanical trim pot replacement

『貳』 怎麼用單片機控制數字電位器啊拜託大家,最好有程序啊,盡量是自己編寫的

數字電位器我用的是X9C103,接4個按鍵,每個按鍵輸出不同的電阻值,程序如下,請參考
#include<reg51.h>
#include<stdio.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int

//設定四個按鍵
sbit X9C102=P2^0;
sbit X9C202=P2^1;
sbit X9C302=P2^2;
sbit X9C402=P2^3;

sbit X9C103_CS=P1^0;
sbit X9C103_INC=P1^1;
sbit X9C103_UD=P1^2;

void delay_nus(uint i)
{
while(i--);
}

void delay_nms(uchar i)
{
for(i;i>0;i++)
{
delay_nus(1000);
}
}

void set_x9c103(uchar num,uchar ud,uchar save)
{
X9C103_CS=0;
delay_nus(1);
if(ud==1)
{
X9C103_UD=1;
}
else
{
X9C103_UD=0;
}
delay_nus(4);
for(num;num>0;num--)
{
X9C103_INC=1;
delay_nus(2);
X9C103_INC=0;
delay_nus(2);
}
delay_nus(2);
if(save==1)
{
X9C103_INC=1;
delay_nus(2);
X9C103_CS=1;
delay_nms(22);
}
X9C103_CS=1;
delay_nus(10);
}

void clear_down()
{
set_x9c103(100,0,1);
}

void main_init()
{
X9C103_CS=0;
clear_down();
}

void main()
{
main_init();
set_x9c103(70,1,1);
while(1)//掃描按鍵,對應不同倍數的輸出
{
if (X9C102==0){
clear_down();
set_x9c103(10,1,1);}
if (X9C202==0){
clear_down();
set_x9c103(30,1,1);}
if (X9C302==0){
clear_down();
set_x9c103(60,1,1);}
if (X9C402==0){
clear_down();
set_x9c103(90,1,1);}
}
}

閱讀全文

與數字電位器如何編程相關的資料

熱點內容
隱藏網路為什麼別人可以連我不行 瀏覽:355
超級終端發送文件超時 瀏覽:24
文件多少m有什麼意思 瀏覽:63
microsoftword2010 瀏覽:773
國務院通信大數據行程卡在哪裡 瀏覽:581
列印機和電腦數據線連好怎麼操作 瀏覽:877
iphone打開html文件 瀏覽:63
java操作excel之poi 瀏覽:700
java集合同步 瀏覽:861
軟工大數據軟考考什麼 瀏覽:190
受控體系文件的封面有什麼內容 瀏覽:778
夢幻錦衣是哪個文件夾 瀏覽:811
raid模式不能黑蘋果 瀏覽:859
如何優化網站推廣方案 瀏覽:40
編程怎麼入門去極客時間 瀏覽:504
查看oracle資料庫字元集編碼 瀏覽:658
pscc恢復文件 瀏覽:245
釘釘怎麼上網路直播課 瀏覽:595
怎麼用手機qq掃描文件在哪裡 瀏覽:17
微信瓶子怎麼提示用完了 瀏覽:288

友情鏈接