Contents of the VB.NET host computer source code package for the single-chip programmable field effect tube control board:
Data directory
1 Introduction to the functions of the 8-input and 8-output effect tube industrial control development board
1.1 Introduction to the 8-input and 8-output FET industrial control development board
1.2 Hardware connection labeling instructions
1.3 Introduction to STC12C5A60S2 Series 1T MCU
1.4 Introduction to N-channel Irf1205 field effect transistor
2 Development Board Programming Tutorial
2.1 Introduction to Keil uVision4
2.2 Build a simple project using Keil software
2.3 Download program method
3 Development Board Application Examples
3.1 Example of controlling a certain delay on and off
3.2 Random Output Control Use Case
3.5. Example of eight-way output water lamp
3.4 One-to-one input and output jog control program
3.5 One-to-one input and output self-locking control example
3.6 One-to-one input and output interlocking control example
3.7 Host computer serial port control test
3.8 Host computer 485 interface control test
3.9 Host computer 232 or 485 interface control test
3.10 Encrypted settings for power-on times memory
3.11 Power-off memory test procedure
3.12 PWM Control of DC Motor
Appendix: Schematic
1.4 Introduction to N-channel Irf1205 field effect transistor
IRFR1205 N-channel Chinese data description: MOSFET N-CH 55V 44A DPAK
1 Introduction to the functions of the 8-input and 8-output effect tube industrial control development board 1.1 Introduction to the 8-input and 8-output effect tube industrial control development board
Size: 115mmX77mmX25MM
Power supply: board power supply DC 6 to 40V
Eight-way digital input optocoupler (PC817) isolation
Octal FET output with optocoupler (PC817) isolation
Expansion port eight io
Input and output indication
Crystal oscillator 11.0592Mhz
Field effect tube (IRF1205) output can control 55V44A load
Function: Eight inputs can be connected to eight NPN sensors, or limit switches, start and stop switches of control equipment, etc., and can realize programming of any control equipment (imitating Siemens s7-200 switch tube type), and can control DC 12V to 55V, 107w load
1.2 Hardware connection labeling instructions
Full page annotation:
485 Connection
Note: RS485 is recommended to be connected by twisted pair cables, shielded twisted pair cables, and the shielding layer should be grounded. When multiple modules are hung on the bus, a hand-in-hand connection method should be used.
Connection method for collecting external dry contact switch signal
The source program of the microcontroller is as follows:
/********************************************************************
Huicheng Technology
Function: 1 to 1 input and output self-locking control program
Chip used: AT89S52 or STC89C52
Crystal: 11.0592MHZ
Compilation environment: Keil
Author: zhangxinchunleo
[Statement] This program is for learning and reference only. Please indicate the copyright and author information when quoting!
*************************************************************************/
/********************************************************************
Program Description:
When the IN0 port is connected to the GND port, the corresponding relay K8 is energized (i.e., COM7 is connected to CK and CB is disconnected);
When the IN1 port is connected to the GND port, the corresponding relay K7 is energized (i.e., COM6 is connected to CK and CB is disconnected);
When the IN2 port is connected to the GND port, the corresponding relay K6 is energized (i.e., COM5 is connected to CK and CB is disconnected);
When the IN3 port is connected to the GND port, the corresponding relay K5 is energized (i.e., COM4 is connected to CK and CB is disconnected);
When the IN4 port is connected to the GND port, the corresponding relay K4 is energized (i.e., COM3 is connected to CK and CB is disconnected);
When the IN5 port is connected to the GND port, the corresponding relay K3 is energized (i.e., COM2 is connected to CK and CB is disconnected);
When the IN6 port is connected to the GND port, the corresponding relay K2 is energized (i.e., COM1 is connected to CK and CB is disconnected);
When the IN7 port is connected to the GND port, the corresponding relay K1 is energized (i.e., COM0 is connected to CK and CB is disconnected);
*************************************************************************/
#include
//library file #define uchar unsigned char //macro definition of unsigned character type
#define uint unsigned int //macro definition of unsigned integer
/********************************************************************
Initial Definition
*************************************************************************/
/*Define eight-bit input as MCU P1 port*/
sbit IN0=P0^0;
sbit IN1=P0^1;
sbit IN2=P0^2;
sbit IN3=P0^3;
sbit IN4=P0^4;
sbit IN5=P0^5;
sbit IN6=P0^6;
sbit IN7=P0^7;
/*Define eight-bit output as MCU P2 port*/
sbit K1=P2^6;
sbit K2=P2^7;
sbit K3=P5^1;
sbit K4=P5^0;
sbit K5=P4^6;
sbit K6=P4^1;
sbit K7=P4^5;
sbit K8=P4^4;
/********************************************************************
Delay function
*************************************************************************/
void delay(uchar t)
{
uchar i,j;
for(i=0;i
{
for(j=13;j>0;j--);
{ ;
}
}
}
/********************************************************************
Main function
*************************************************************************/
void main()
{
P4SW|=0x70; //Configure P4.5 as IO port
while(1)
{
if(IN0==0){delay(100);while(!IN0);K8=0;} //Relay K8 is closed
if(IN1==0){delay(100);while(!IN1);K7=0;} //Relay K7 is closed
if(IN2==0){delay(100);while(!IN2);K6=0;} //Relay K6 is closed
if(IN3==0){delay(100);while(!IN3);K5=0;} //Relay K5 is closed
if(IN4==0){delay(100);while(!IN4);K4=0;} //Relay K4 is closed
if(IN5==0){delay(100);while(!IN5);K3=0;} //Relay K3 is closed
if(IN6==0){delay(100);while(!IN6);K2=0;} //Relay K2 is closed
if(IN7==0){delay(100);while(!IN7);K1=0;} //Relay K1 is closed
}
}
/********************************************************************
Finish
*************************************************************************/
Previous article:51 MCU fan driver source program
Next article:STC MCU source program for servo pwm control (both single and multiple speed control)
Recommended ReadingLatest update time:2024-11-23 10:54
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- KA5Q1265RFTU
- Research on Self-Compiled ISP Code for P89LPC922
- Consumer electronics section highlights
- In the EMC-related experiments of circuits, there are some voltage pulse experiments. How should the withstand voltage value of the capacitor be considered?
- Start with LoRa and learn more about the Internet of Things
- Modern power modules
- Bored at home? Learn about oscilloscopes. 200M Tektronix LCD oscilloscope for 1580 yuan including express delivery
- Ask about the udealy function of Liunx
- How to modify the AT32F4xx SRAM space size
- About software testing of commercial appliances