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

數字電位器如何編程

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

閱讀全文

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

熱點內容
htc手機查詢代碼 瀏覽:757
蘋果手機激活碼忘記了怎麼辦 瀏覽:360
如何查看蘋果手機無線密碼 瀏覽:651
從零開始學網站怎麼學 瀏覽:38
qq10個g都是什麼文件 瀏覽:453
江蘇電信免費升級100m 瀏覽:10
哪些app買衣服買鞋 瀏覽:85
安卓最終幻想3隱藏人物 瀏覽:922
怎麼將一大堆圖片放進文件夾 瀏覽:355
net如何控制光碟機刻錄文件 瀏覽:350
未獲取ukey中的數據什麼意思 瀏覽:603
怎麼樣往app上沖錢 瀏覽:394
vb編程中聲明常量的語句是什麼 瀏覽:39
網購網站的廣告怎麼弄 瀏覽:640
word文件怎麼格式化 瀏覽:929
js驗證checkbox是否勾選 瀏覽:991
qq520紅包病毒是真的嗎 瀏覽:875
文件夾里的數字是什麼 瀏覽:118
us數據線怎麼連接車載音樂 瀏覽:320
撥號晶元程序寫入 瀏覽:847

友情鏈接