11-12

\documentclass[UTF8]{ctexart}

%\documentclass{article}

\title{2019 年 10 月 23 日---{\today}实习总结}

\author{雷贻山}

\usepackage[utf8]{inputenc}

\usepackage{ctex}

\date{\today}

\usepackage{geometry}

\geometry{a4paper,left=1cm,right=2cm,top=2cm,bottom=1cm}

\usepackage{graphicx}

\usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,urlcolor=black]{hyperref}

\begin{document}

\maketitle

\tableofcontents\

 

\section{10月23日}

\subsection{安装了keil软件,st-link驱动}

\subsection{阿波罗板子是程序只能烧录F429的例程}

\subsection{keil串口下载只能一次打开一个,否则串口被占用}

\subsection{学习结构体构造类型}

\includegraphics[scale=0.6]{struct.png}

\subsection{学习位操作基本运算}

\subsection{e.g 1 \textless \textless3意思是把1左移3位,右边补0,得到1*2*2*2=8}

\subparagraph{int m = 1 \textless\textless3; //二进制形式:1到1000}

 

\section{10月24日}

\subsection{inc ,arc,mise.c文件含义}

\subparagraph{inc里面装的是外设头文件, src里面装的是库函数源文件,中断文件是 mise.c}

\subsection{学习了GPIO常见库函数}

\subparagraph{I/O 引脚可以被软件设置成各种 不同的功能 ,如输入或输出,所以被称为 GPIO(General-purpose I/O)。而 GPIO 引脚又被分为GPIOA、GPIOB,GPIOG 不同的组,每组端口分为 0到15}

\subsection{GPIO函数的三个参数}

\begin{center}

\includegraphics[scale=0.8]{gpio.png}

\end{center}

\subsection{串口}

\subparagraph{串口通信(Serial Communications)的概念非常简单,串口按位(bit)发送和接收字节的通信方式

串行接口是一种可以将接收来自CPU的并行数据字符转换为连续的串行数据流发送出去,同时可将接收的串行数据流转换为并行的数据字符供给CPU的器件。可以串转并,并转串}

\subsection{串口初始化}

\begin{center}

\includegraphics[scale=0.6]{uart_init.png}

\end{center}

 

\section{10月25日}

\subsection{使用串口助手能打印printf里面的函数是因为,调用了usart.h头文件}

\includegraphics[scale=0.5]{usart_able.png}

\subsection{keil不能使用中文注释}

\includegraphics[scale=0.6]{mess_code.png}

\subparagraph{点击edit,找到最下方的configuration,在Editor页面,可以看到General Editor Setting 下方有一个Encoding,这里有许多的选项,选择Chinese GB2312(Simplified).点击OK即可输入中文注释}

\subsection{串口调试注释要数据位必须是8位才能接收到汉字,否则是乱码}

\includegraphics[scale=0.6]{tiaoshi.png}

\subsection{定时器实验中,while 0 只闪一次,不再循环}

\includegraphics[scale=0.5]{only_one.png}

\subsection{查看pin引脚复用,搜索alternate function}

\includegraphics[scale=0.5]{alternate.png}

\section{10月26日}

\subsection{Keil无法展开HALLIB里面的.c文件里面的.h文件}

\includegraphics[scale=0.5]{build.png}

\subparagraph{重新build 一下就好}

\subsection{keils文件消失不见}

\includegraphics[scale=0.5]{filehide.png}

\section{10月26日-11月1日}

\subsection{以体积,精度,价格三个指标来寻找pm2.5的模块}

\subparagraph{对比了6种pm2.5模块最终确定了sps30}

\subsection{仔细阅读了sps30重要参数}

\section{sps30重要参数}

\subsection{working principle}

\subparagraph{Laser scattering}

\subsection{life span}

\subparagraph{More than eight years}

\subsection{size}

\subparagraph{41 x 41 x 12 mm}

\subsection{Important parameters}

\begin{center}

\begin{tabular}{ p{5cm} p{2cm}p{2cm}p{5cm}p{1cm}}

\hline

parameter & value & unit & Remarks \\

\hline

voltage& 4.5-5&V & -- \\

Idle current & <8 & mA & Idle mode \\

Average current & 60 & mA & -- \\

Precision & $\pm$ 10 & ug/m & 0-100ug/ m \\

concentration & $\pm$ 10 & $\%$ & 100-1000ug/ m \\

I/Opin (RX/SDA,TX/SCL) & -0.3-5.5 & V & \\

max IO pin current & 16 & mA & \\\hline

\end{tabular}

\end{center}

\subsection{Pin parameter}

\begin{center}

\begin{tabular}{ p{1cm} p{2cm}p{5cm}p{6cm}p{1cm}}

\hline

pin & name & description & remark \\

1 & VDD &Support voltage & 5V $\pm$ 10$\%$ \\

2 & RX & UART Communication acceptance pin & TTL 5V and LVTTL 3.3V compatible \\

& SDA & I2CSerial data output pin & TTL 5V and LVTTL 3.3V compatible \\

3 & TX & UART Communication transmit pin & TTL 5V and LVTTL 3.3V compatible \\

& SCL & I2C Serial clock input & TTL 5V and LVTTL 3.3Vcomatible \\

4 & SEL & Interface selection & Floating mode selsection UART \\&&&Grounding mode selection I2C \\

5 & GND & Grounding mode selection & -- \\

\hline

\end{tabular}

\end{center}

 

 

 

 

 

 

 

\subsection{ Typical UART application circuit.}

 

\subparagraph{Both SCL and SDA lines are open drain I/Os. They should be connected to external pull-up resistors (e.g. Rp = 10 $ \Omega $).}

 

\subparagraph{in order to correctly select I2C as interface, the interface select (SEL) pin must be pulled to GND before or at the same time the sensor is powered up.}

 

\begin{center}

 

\includegraphics[scale=0.6]{uart.png}

 

\subsection{Set Pointer Read Data}

 

\subsection{Set Pointer Write Data}

 

\subsection{Checksum Calculation}

 

\subsection{I 2 C Commands}

 

\subsection{Read Measured Values}

 

\end{center}

 

 

 

\section{11月1日}

\subsection{u32强制转换成8字节位32位数}

\includegraphics[scale=0.8]{u32trans.png}

\subparagraph{SCB-\textgreater AIRCR 是一个整体,是结构体SCB中的一个元素地址等于0x05FA0000}

\subsection{MODER,OSPEEDR,PURDR,寄存器每两位控制一个IO端口}

\includegraphics[scale=0.4]{twocontrol.png}\\

\includegraphics[scale=0.5]{move11chen2.png}

\subparagraph{每个寄存器控制一组GPIO16个管脚,所谓管脚的状态 体现在 位运算平移的位置与平移的值,平移的值不同确定状态不同,平移的位置不同决定管脚不同}

\subsection{GPIO端口设置函数}

\includegraphics[scale=0.5]{pinsetfuc.png}

\subparagraph{注意BITx是待测端口pinpos是程序顺序检测的端口}

\subparagraph{嵌入式就是与或非操作寄存器的0和1}

\subparagraph{复用AF是四位一组,寄存器一共32位控制8个IO,IO模式寄存器是2位一组控制16个IO}

 

\subsection{管脚AF复用状态的设置}

\includegraphics[scale=0.5]{affuc.png}

\subparagraph{GPIO-\textgreater AFR[1]是一个结构体,~取反的意思就是把第12位寄存器全部变成4个0}

\subparagraph{0x0f\textless \textless12是把1111送到高8位15送到15\textless3等于pin11的位置去}

\subparagraph{12\textless \textless 12 是要把AF第12个复用状态SDIO送给第12管脚pin11}

 

\subsection{管脚AF复用状态的库函数}

\includegraphics[scale=0.5]{AFFF.png}

\subparagraph{bit-\textgreater \textgreater 3是为了 分组,只有15-8,1111-1110,右移是1}

\subparagraph{只有7-0,1110-0000,右移是0,于是分成了两组AFR[0],AFR[1]}

\subparagraph{BITx\&0X07分组,取BITx=0001可以验证公式的正确性}

\subparagraph{BITx是引脚亮的位置标志,只可以取0-15}

 

\subsection{中断, AIRCR执行写操作必须向[31:16]写入秘钥0xFA05}

\includegraphics[scale=0.4]{aircr.png}

\includegraphics[scale=0.5]{aircr-registers.png}\\

\includegraphics[scale=0.6]{aircrcode.png}

\subsection{中断使能,中断清除位}

\includegraphics[scale=0.6]{NVIC_type.png}

\includegraphics[scale=0.4]{aircr-registers.png}

\subsection{NVIC-INIT中断初始化函数}

\includegraphics[scale=0.6]{NVIC-INIT.png} \\

\includegraphics[scale=0.4]{IPRF.png}

\subparagraph{ISER[0],表示第0---31个中断ISER[1],表示第32---63个中断.如果要打开54号中断:显示应该在ISER[1]里的第22位置1}

 

\section{11月2日}

\subsection{EXTICR外部中断定时器}

\subparagraph{不同的GPIO端口对应不同的EXTICR的组别,先找到对应的GPIO对应控制位EXTICR}

\subparagraph{EXTICR[0]负责0--3号中断线,EXTICR[1]负责4--7号中断线}

\subparagraph{以用PB7举例,PB7在EXTICR 0001的位置上 ,7模4等于3 ,再乘4刚好左移12位到 }

\subparagraph{.}

\includegraphics[scale=0.5]{PB7.png}

\subparagraph{7模4等于3 ,再乘4刚好左移12位到 如下位置}

\subparagraph{.}

\includegraphics[scale=0.5]{pb7add.png}

\subparagraph{用Pb3举例}

\subparagraph{.}

\includegraphics[scale=0.5]{pb3.png} \\

 

\includegraphics[scale=0.5]{PB7.png}

 

\subsection{systick ctrl 寄存器第二位决定时钟是否为外部时钟}

\includegraphics[scale=0.5]{external_clock.png}

\subsection{rcc cr寄存器}

\includegraphics[scale=0.37]{rcc_rc.png}

\subsection{apb1enr寄存器}

\includegraphics[scale=0.5]{apb1enr.png}

 

\section{11月12日}

\subsection{sensirion shdlc函数}

\includegraphics[scale=0.5]{sensirion_shdlc.png}

\subsection{sps30-measurement函数}

\includegraphics[scale=0.65]{sps30-measurement.png} \\

\subparagraph{get和set分别对应的是可读和可写}

\subsection{pm2.5-主函数}

串口\\

\includegraphics[scale=0.65]{pm2dot5-main-func.png}

----------------\\

探测颗粒 清理风扇\\

 

\includegraphics[scale=0.65]{probe-clean.png}

-\\

-\\

-\\

开始测量 误差函数\\

 

\includegraphics[scale=0.65]{measure-error.png}

 

 

 

 

 

 

 

 

\end{document}

 

 

posted @ 2019-11-12 18:47  丹心静居  阅读(218)  评论(0编辑  收藏  举报