网络消费网 >  5G > > 正文
单片机可控0-30V可调电源
时间:2021-11-28 18:22:01
CPU电路图

显示电路控制板电路图程序#include // 包含型号头文件

本文引用地址:http://www.eepw.com.cn/article/201611/324014.htm//#include #include // 包含"位"操作头文件#include #include #include #include #include #include #define uchar unsigned char#define uint unsigned int#define TRUE 1#define FALSE 0#define ad_Temp_flag 0x03 // 温度转换通道#define ad_Vout_flag 0x04 // 电压转换通道#define ad_Iout_flag 0x05 // 电流转换检测#define FAN_ON (PORTB_Bit3 = 1) // FAN 开#define FAN_OFF (PORTB_Bit3 = 0) // FAN 关#define D1_ON (PORTA_Bit0 = 0) // D1 开#define D1_OFF (PORTA_Bit0 = 1) // D1 关#define D2_ON (PORTA_Bit1 = 0) // D2 开#define D2_OFF (PORTA_Bit1 = 1) // D2 关#define D3_ON (PORTA_Bit2 = 0) // D3 开#define D3_OFF (PORTA_Bit2 = 1) // D3 关#define D4_ON (PORTB_Bit2 = 0) // D4 开#define D4_OFF (PORTB_Bit2 = 1) // D4 关#define D5_ON (PORTA_Bit6 = 0) // D5 开#define D5_OFF (PORTA_Bit6 = 1) // D5 关#define D6_ON (PORTA_Bit7 = 0) // D6 开#define D6_OFF (PORTA_Bit7 = 1) // D6 关#define DATA164_ON (PORTB_Bit1 = 1) // 74HC164 DATA=1#define DATA164_OFF (PORTB_Bit1 = 0) // 74HC164 DATA=0#define CLK164_ON (PORTB_Bit0 = 1) //#define CLK164_OFF (PORTB_Bit0 = 0) //#define Temp_out_lo 0x339 // -5℃ 41.56K #define Temp_out_hi 0x10e // 50℃ 3.588Kuint ad_Temp_result; // 温度转换结果uint ad_Vout_result; // 电压转换结果uint ad_Iout_result; // 电流转换结果uint Vout_disp;uint Iout_disp;uint Iout_adj;uchar time_cnt1;uchar adc_get_flag;//#pragma vector=0x10;//__interrupt void TIMER2_OVF_Server(void);void mcu_init(void); // I/O初始化,PWM初始化void adc_init(void); // ADC初始化uint adc_get(uchar adc_ch); // 启动AD转换,并返回转换值void Vout_adc_get(void); // 电压检测void Temp_adc_get(void); // 温度检测void Iout_adc_get(void); // 电流检测//数码管显示代码定义__flash uchar disp_led[10] @0x0040 ={ 0x0a, // 0 0x7b, // 1 0x4c, // 2 0x58, // 3 0x39, // 4 0x98, // 5 0x88, // 6 0x5b, // 7 0x08, // 8 0x18, // 9};

关键词: 单片机可控可调电

版权声明:
    凡注明来网络消费网的作品,版权均属网络消费网所有,未经授权不得转载、摘编或利用其它方式使用上述作品。已经本网授权使用作品的,应在授权范围内使用,并注明"来源:网络消费网"。违反上述声明者,本网将追究其相关法律责任。
    除来源署名为网络消费网稿件外,其他所转载内容之原创性、真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考并自行核实。
热文

网站首页 |网站简介 | 关于我们 | 广告业务 | 投稿信箱
 

Copyright © 2000-2020 www.sosol.com.cn All Rights Reserved.
 

中国网络消费网 版权所有 未经书面授权 不得复制或建立镜像
 

联系邮箱:920 891 263@qq.com

备案号:京ICP备2022016840号-15

营业执照公示信息