Home > Back-end >  Can someone to STC12C5A60S2 have to understand the MCU? Want to write a formaldehyde detection based
Can someone to STC12C5A60S2 have to understand the MCU? Want to write a formaldehyde detection based

Time:10-08

Want to write a formaldehyde detection based on the microcontroller program, requirements to fixed value will call the police, can record test data and flip for many times, with lcc1602
Please everyone a great god help!!!!!!!!!!

CodePudding user response:

With what kind of data transmission, block a EEPROM program, a display program, you one by one

CodePudding user response:

EEPROM and LCD, you next document, formaldehyde detection sensor data lines connected to the circuit boards, according to the agreement to read it

CodePudding user response:

Mainly is the single chip microcomputer is partial, can't write it's built-in AD converter,

CodePudding user response:

The MCU AD version, specific and didn't try, you can consult STC51 AD program, check the DataSheet

# include
# define uint unsigned int
# define uchar unsigned char
Sbit adwr=P3 ^ 6;
Sbit adrd=P3 ^ 7;
Sbit dula=P2 ^ 6;
Sbit wela=P2 ^ 7;
Sbit csda=P3 ^ 2;
Uchar temp.

Void delay (uchar z)
{
Uchar x, y;
For (x=z; X> 0; X -)
For (y=110; Y> 0; Y -);
}

Void init ()
{
temp=0;
P0=0;
}

Void the start ()
{
P0=0;
Adwr=0;
Adwr=1;
P0=0 XFF;
}

Void admode ()
{
Csda=0;
Adwr=0;
//temp=p;
Delay (1);
P0=temp;
Csda=1;
delay(10);
}

Void main ()
{
The init ();
While (1)
{
Start ().
delay(10);
P1=0 XFF;
P0=0;
Adrd=0;
Temp=p;
Adrd=1;
P0=0 XFF;
Delay (20);
P1=temp;
Admode ();
}
}

CodePudding user response:

STC51 microcontroller is not wide, general 889 c52 is ok, on the other hand, in a variety of specifications for example should say is quite comprehensive, direct copy can be used, including some set tools like website, 1206 driver search on the net, a lot of, can use directly, E2ROM drive is very much also, down can be used directly,

CodePudding user response:

I used to be the MCU
  • Related