当前位置:网站首页>DC motor control system based on DAC0832
DC motor control system based on DAC0832
2022-07-29 08:11:00 【Half life fireworks I blurred】
Use DAC0832 To control the DC motor
Input digital quantity 0X00~0XFF Corresponding output 0~5V The voltage value of
Use the knowledge of analog circuit to design the circuit to realize the forward and reverse rotation of the motor , The nixie tube displays the speed value and positive and negative rotation in real time .
The first digit of the four digit nixie tube shows positive and negative 、1 Indicates forward rotation 、0 Indicates inversion , The last three digits show the speed value
DAC0832 Adopt bipolar control ,D0~D7 Data input port ,IOUT1、IOUT2 Complementary output port ,RFB Feedback port 、
VREF Reference voltage value ( It's usually 5V).
The triode part is simulated through two I/O Mouth to control to achieve positive and negative , If there is no triode, the part can only rotate in one direction
The main function
#include <REGX52.H>
#include "Delay.h"
#include "Key.h"
#define DAC0832 P1//DAC0832 Data port definition
sbit zz=P2^0;// Positive and negative definitions
sbit fz=P2^1;
sbit we1=P3^0;// Bit selection definition
sbit we2=P3^1;
sbit we3=P3^2;
sbit we4=P3^3;
unsigned char NixieTable[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};// Common cathode segment code table
unsigned char KeyNum;
unsigned int Speed=70;// Define send to DAC0832 Initial speed value of
void Nixie();// Nixie tube display function
void main()
{
DAC0832=0x00;
while(1)
{
KeyNum=Key();// Get key value
switch(KeyNum)
{
case 0:
break;
case 1:
zz=0;
fz=1;
break;
case 2:
zz=1;
fz=0;
break;
case 3:
Speed=Speed+5;
KeyNum=0;
break;
case 4:
Speed=Speed-5;
KeyNum=0;
break;
}
DAC0832=Speed;// Digital input conversion voltage value
Nixie();
}
}
void Nixie()
{
unsigned int x=0,y=0,z=0,peed;
peed=Speed;
x=peed/100;
y=(peed-x*100)/10;
z=peed%10;// Take the number of each bit of the speed and display it
if(zz==1&&fz==0)
{
we1=0;
P0=NixieTable[1]; // The nixie tube shows 1, Positive rotation
Delay(5);
we1=1;
}
if(zz==0&&fz==1)
{
we1=0;
P0=NixieTable[0]; // The nixie tube shows 0, reverse
Delay(5);
we1=1;
}
we2=0;
P0=NixieTable[x];
Delay(5);
we2=1;
we3=0;
P0=NixieTable[y];
Delay(5);
we3=1;
we4=0;
P0=NixieTable[z];
Delay(5);
we4=1;
}
Press to get
#include <REGX52.H>
#include "Delay.h"
unsigned char Key()// Get the key value , Key shake elimination and release detection
{
unsigned char KeyNumber=0;
if(P3_4==0){Delay(20);while(P3_4==0);Delay(20);KeyNumber=1;}// Positive rotation
if(P3_5==0){Delay(20);while(P3_5==0);Delay(20);KeyNumber=2;}// reverse
if(P3_6==0){Delay(20);while(P3_6==0);Delay(20);KeyNumber=3;}// Speed up
if(P3_7==0){Delay(20);while(P3_7==0);Delay(20);KeyNumber=4;}// Slow down
return KeyNumber;
}
Here it is explained that the partial simulation of triode is given by a senior , The seniors are still good

边栏推荐
- C language problems
- Detailed explanation of two modes of FTP
- Implementation of simple cubecap+fresnel shader in unity
- Use the cloud code to crack the problem of authentication code encountered during login
- Mqtt server setup and mqtt.fx testing
- Research on autojs wechat: the final product of wechat automatic information sending robot (effective demonstration)
- Official tutorial redshift 01 basic theoretical knowledge and basic characteristics learning
- [lecture notes] how to do in-depth learning in poor data?
- In an SQL file, a test table and data are defined above, and you can select* from the test table below
- (Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
猜你喜欢

MySQL rownum implementation
![[beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?](/img/db/ef33a111bcb543f9704706049bccc2.png)
[beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?

Character shader exercise

An Optimal Buffer Management Scheme with Dynamic Thresholds论文总结

Arduinoide + stm32link burning debugging

阿里巴巴政委体系-第四章、政委建在连队上

Unity beginner 4 - frame animation and protagonist attack (2D)
![[beauty of software engineering - column notes]](/img/90/658f4d954c876bed2fccb431232e52.png)
[beauty of software engineering - column notes] "one question and one answer" issue 2 | 30 common software development problem-solving strategies

Dp1332e multi protocol highly integrated contactless read-write chip

STM32 detection signal frequency
随机推荐
Ws2812b color lamp driver based on f407zgt6
Intelligent shelf safety monitoring system
sql判断语句的编写
[beauty of software engineering - column notes] "one question and one answer" issue 2 | 30 common software development problem-solving strategies
[lecture notes] how to do in-depth learning in poor data?
Stm32ff030 replaces domestic MCU dp32g030
Dynamically load data
Unicode私人使用区域(Private Use Areas)
Use the cloud code to crack the problem of authentication code encountered during login
阿里巴巴政委体系-第四章、政委建在连队上
Inclination monitoring solution of Internet of things
Network Security Learning chapter
下推分析的限制
Preparation of SQL judgment statement
What is Amazon self support number and what should sellers do?
Taiyuan bus route crawling
20 hacker artifacts
C language interview preparation I (about understanding Department)
How to connect VMware virtual machine to external network under physical machine win10 system
Tle5012b+stm32f103c8t6 (bluepill) reading angle data