[Graduation project] 18-Digital DC power supply design based on single-chip microcomputer (source code project + simulation project + answer essay + answer PPT)


typora-root-url: ./

[Graduation project] 18-Digital DC power supply design based on single-chip microcomputer (source code project + simulation project + answer essay + answer PPT)

mission statement

1. Main research content:

Design a switching regulated power supply to meet the power supply needs of small electronic equipment. The main indicators of the power supply design are: the input voltage is AC220V, the input frequency is 50HZ, the input voltage range is AC165V-265V, the output voltage is adjustable from DC 0-10V, the maximum output current is 150mA, and the maximum output power is 2.25W.

2. Methods and requirements:

1. Read a large number of relevant literature on regulated DC power supply systems, master its technical principles and circuit structures, and understand the core ideas of program realization;

2. Accumulate relevant materials to determine the main content of the paper, and focus on research;

3. Report the progress of the thesis once a week, and guide the teacher to answer the problems encountered;

Grasp the progress of the dissertation, and complete the goals of each stage according to the requirements of the school.
Data links
Simulation model engineering files
Simulation screenshots
Low repetition rate documents for defense essays
English literature and translation
Defense PPT

design manual

Summary

In the design of this system, the system is first studied to understand that the current output accuracy of the DC power supply is not high enough. This problem is used to design the digital DC power supply, and the system design plan is determined by analyzing the functions that the system needs to realize. Then design the hardware and software of the system, and finally use the simulation software to test whether the function of the whole system meets the design requirements. This design system takes into account many reasons, including anti-interference ability, output accuracy and output range, etc., and Taking into account the production cost of the entire system, the system is guaranteed to be cost-effective and stable.

Design framework

Foreword... 1

Chapter 1 Introduction... 2

Section 1 Research Background... 2

Section 2 Research Significance... 2

Section 3 Research Status... 3

The main research content of the fourth section... 4

Chapter Two DC Digital Power System Scheme Analysis... 5

The first section system design function analysis... 5

Section 2 Comparison and selection of DC power system solutions... 5

1. Traditional DC regulated power supply... 5

2. Numerically controlled DC stabilized power supply... 6

3. Program selection... 7

Section 3 Overall System Design Scheme and System Structure... 7

1. System design plan... 7

2. Digital DC power supply structure... 8

The fourth section introduces the main components... 9

1. ADC0832 Analog-to-Digital Converter... 9

2. TCL5615 digital-to-analog converter... 9

Section 5 Anti-jamming Design... 10

Summary of this chapter... 11

Chapter 3 Hardware Design of DC Digital Power Supply... 13

The first section MCU minimum system design... 13

Section 2 Auxiliary power supply circuit design... 14

Section 3 ADC0832 Circuit Design... 16

Section 4 TLC5615 Circuit Design... 16

Section 5 Amplifying Circuit Design... 17

Section 6 shows circuit design... 18

Section 7 General Circuit Design... 19

Summary of this chapter... 20

Chapter 4 Software Design of DC Digital Power Supply... 21

Section 1 Development Tool Keil Software Introduction... 21

Section 2 The overall process of system software design... 21

Section 3 ADC0832 software design process... 22

Section 4 TLC5615 software design process... 24

The fifth section shows the circuit software design process... 25

Summary of this chapter... 26

Chapter 5 DC Digital Power Supply Simulation... 27

The first section introduces the simulation software Proteus... 27

Section 2 System Debugging... 28

Section 3 System Function Test... 29

Summary of this chapter... 33

Summary and Outlook… 34

Thanks… 35

References... 36

Appendix... 38

1. Original English text... 38

2. English translation... 40

3. General circuit diagram... 42

4. Source code... 43

Design instructions and design documents

insert image description here
insert image description here
insert image description here
insert image description here

Source code display

#include <reg52.h>
#include <intrins.h>
#include "timer.h"
#include "global.h"
#define delay4us() {_nop_();_nop_();_nop_();_nop_();}
#define vout 1
#define vset 0
#define vmode
sbit RS = P2^0;
sbit RW = P2^1;
sbit EN  = P2^2;
sbit DACSCLK = P2^3;
sbit DACCS = P2^4;
sbit DACDIN  = P2^5;
sbit CS  = P1^0;
sbit CLK = P1^1;
sbit DIO = P1^2;
sbit KEY1 = P3^6;
sbit KEY2 = P3^7;
#ifdef vmode
uchar Display_Buffer[] = "00.00V           ";
uchar code Line1[] = "Current Voltage:";
#else
uchar Display_Buffer[] = "                ";
uchar code Line1[]     = "Current Speed:  ";
#endif
extern uint speed;
void Delayms(uint ms)
{
 	uchar i;
	while(ms--)
	{
	 	for(i=0;i<120;i++);
	}
}
uchar Busy_Check()
{
 	uchar LCD_Status;
	RS = 0;
	RW = 1;
	EN = 1;
	Delayms(1);
   	LCD_Status = P0;
	EN = 0;
	return LCD_Status;
}
void Write_LCD_Command(uchar cmd)
{
 	while((Busy_Check()&0x80)==0x80);
	RS = 0;
	RW = 0;
	EN = 0;
	P0 = cmd;
	EN = 1;
	Delayms(1);
	EN = 0;
}
void Write_LCD_Data(uchar dat)
{
 	while((Busy_Check()&0x80)==0x80);
	RS = 1;
	RW = 0;
	EN = 0;
	P0 = dat;
	EN = 1;
	Delayms(1);
	EN = 0;
}
void Initialize_LCD()
{
 	Write_LCD_Command(0x38);
	Delayms(1);	
	Write_LCD_Command(0x01);
	Delayms(1);	
	Write_LCD_Command(0x06);
	Delayms(1);	
	Write_LCD_Command(0x0c);
	Delayms(1);	
}
void ShowString(uchar x,uchar y,uchar *str)
{
 	uchar i = 0;
	if(y == 0)
		Write_LCD_Command(0x80 | x);
	if(y == 1)
		Write_LCD_Command(0xc0 | x);
	for(i=0;i<16;i++)
	{
	 	Write_LCD_Data(str[i]);	
	}
}
uchar Get_AD_Result(uchar ch)
{
 	uchar i,dat1=0,dat2=0;
	CS  = 0;
	CLK = 0;
	DIO = 1; _nop_(); _nop_();
	CLK = 1; _nop_(); _nop_();
	CLK = 0;
	DIO = 1; _nop_(); _nop_();
	CLK = 1; _nop_(); _nop_();
	CLK = 0;
	if(ch)
	DIO = 1;
	else
	DIO = 0;
	 _nop_(); _nop_();
	CLK = 1; _nop_(); _nop_();
	CLK = 0;
	DIO = 1; _nop_(); _nop_();
	for(i=0;i<8;i++)
	{
	 	CLK = 1; _nop_(); _nop_();
		CLK = 0; _nop_(); _nop_();
		if(DIO) dat1 |=0x80>>i;	
	}
	for(i=0;i<8;i++)
	{
		if(DIO) dat2 |=0x01<<i;
		CLK = 1; _nop_(); _nop_();
		CLK = 0; _nop_(); _nop_();
	}	 
	CS = 1;	
	if (dat1 == dat2)
		return dat1;
	else
		return 0x00;
}
void Set_DAC(uint dacvalue)
{
 	uchar i;
	uint dat;
	dat = dacvalue;
	dat &= 0x03ff;
	DACCS  = 0;
	DACSCLK = 0;
	for(i=0;i<12;i++)
	{
	 	if(dat & 0x0200)
			DACDIN = 1;
		else
			DACDIN = 0;
		DACSCLK = 1;
		dat <<= 1;
		DACSCLK = 0;
	}
	DACCS = 1;
}
void main()
{
 	uchar B;
	uint d,v;
	Initialize_LCD();
	InitTimer();
	Delayms(10);
	v = 0x0100;
	StartTimer(0);
	B = 0;
	while(1)
	{
	 	d = Get_AD_Result(vset);
		d &=0x00FF;	 
		Set_DAC(d*4);
		d = Get_AD_Result(vout);
		d &=0x00FF;	
		d = d*1000.0/255;
		#ifdef vmode
		if(d/1000)
		Display_Buffer[0]=d/1000+'0';
		else
		Display_Buffer[0]=' ';
		Display_Buffer[1]=d/100%10+'0';
		Display_Buffer[3]=d/10%10+'0';
		Display_Buffer[4]=d%10+'0';	 
		#else
		if(speed/1000)
		Display_Buffer[0]=speed/1000+'0';
		else
		Display_Buffer[0]=' ';
		Display_Buffer[1]=speed/100%10+'0';
		Display_Buffer[2]=speed/10%10+'0';
		Display_Buffer[3]=speed%10+'0';
		#endif
		ShowString(0,0,Line1);
		ShowString(0,1,Display_Buffer);	 
	}
}



Guess you like

Origin blog.csdn.net/qq_22592979/article/details/128108668