当前位置:网站首页>First development of STC to stm32

First development of STC to stm32

2020-11-08 23:46:00 Hello, my name is Zheng


Preface

He jumped into another lab , The teacher looks like a strong man ( Strong hairstyles )
however yysy, Do this , It's soft and hard for me , And the professional foundation is not that OK Of , It's a little difficult

project

1. A / D conversion , And pass OLED The screen shows

demand :

Experimental equipment :

STM32F4、 Slide rheostat 、OLED screen (IIC)、 Breadboard 、 There are several DuPont lines

connection :

According to the schematic and routine , Go find Channel_5 Corresponding interface , You must learn to see the schematic diagram of the development board !

STM32 OLED
3.3V VCC
GND GND
PD6 SCL
PD7 SDA

Source program :

Blue clouds
Select the main program here , Incoming analog signal , Convert it into a digital signal , And in OLED Print it out .

'''
delay_ms(500);
adcx=Get_Adc_Avg(ADC_Channel_5,5);
temp=(float)adcx * (3.3/4096);

	printf("temp val:%d\n",adcx);
	printf("\n");
	printf("temp val:%f\n",temp);
	
	OLED_ShowString(0,0,"MyQQ:",16);
	OLED_ShowString(0,2,"1625098483",16);  
	OLED_ShowString(0,4,"Voltage:",16);
	OLED_ShowString(0,6,"0.00V",16);
	OLED_ShowNum(0,6,temp,1,16);
	delay_ms(5000);
	OLED_Clear();    

'''

finished product :

The project didn't take a few nights ( All the day out class ), And the official gave Read ADC data and OLED screen Routine for ,
But the official gave it OLED yes SPI Of , My is IIC Of , This is about two or three nights .

2. Simple frequency meter (0.1-10MHZ)

demand :

The frequency meter is used to detect the frequency of the signal , When making frequency meter, we can test with the signal from signal generator .

principle :

For sine waves / square wave , We look at it from a periodic point of view , Two rising edges in a row are the waves cycle . frequency =1/ cycle
Set the pin of external interrupt to rise edge detection and configure it to drop-down mode . Every time the rising edge is detected ,cnt++, The counter value in such a second is frequency .
External interrupt mode
System frequency --> The time delay function
Timer + Interrupter

Experimental equipment :

STM32、 Digital signal generator 、 There are several DuPont lines

connection :

You can see it in the source program , I won't repeat it here

Source program :

Frequency meter

Write at the end

I don't feel like I have any talent for hardware , Or prefer to play algorithms , Do back-end development a little bit
I think there are too many basic things in hardware , It's not friendly to get started to the novice , And see that a lot of embedded development has been transferred to the Internet .( Big guy light spray , I hope to leave your opinion in the comments area )
Maybe this time it turns hard to soft , I can't go back .
Of course , I am a professional in electronic information engineering , There may be a little more interesting hardware Posts later .
so what , Do some Java Articles like learning and algorithms .
emmm be it so , Enrich yourself for two years , What I do now is what I like , I hope there will be a good ending .

版权声明
本文为[Hello, my name is Zheng]所创,转载请带上原文链接,感谢