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

數字電位器如何編程

發布時間: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);}
}
}

閱讀全文

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

熱點內容
ug編程刀路怎麼復制不用滑鼠選取 瀏覽:97
excel文件打開擴展名錯誤 瀏覽:10
阿里巴巴怎麼做數據包 瀏覽:442
無線網路連接一直顯示未連接 瀏覽:25
windows7如何自動激活工具下載 瀏覽:57
天語救磚工具 瀏覽:839
網路體育課程有哪些 瀏覽:19
蘋果微信怎麼查看文件 瀏覽:165
安卓nba2k14面補替換 瀏覽:450
路由器密碼定時換 瀏覽:626
aicc恢復文件在哪裡 瀏覽:167
怎麼查無線網路屬性 瀏覽:874
只狼的聲音文件放在哪裡 瀏覽:219
lol盒子修復在哪個文件夾 瀏覽:308
表格里的公章怎麼導入到pdf文件上 瀏覽:844
怎樣刪除u盤不能刪除的文件 瀏覽:712
軟體編程崗位怎麼找 瀏覽:120
數字編程工程師是什麼專業 瀏覽:489
ios開發文件管理 瀏覽:877
文件名如何轉化到excel表內 瀏覽:63

友情鏈接