打印
[STM32F4]

stm32F429开发板学习经验分享

[复制链接]
976|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
一代掌门|  楼主 | 2016-8-31 19:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式


开发板初识
最近时间比较的紧,拿到开发板首先做的第一件事就是要去熟悉了解F429这块开发板的资源
硬件上了解:
开发板正面看有:
1.开发板的TFT屏为2.4‘’QVGA TFT LCD  分辨率 320*240
2个用户按键,RESET,user

3板载3轴数字陀螺仪 L3GD20
6个LED指示灯
– LD1 (red/green) for USB communication
– LD2 (red) for 3.3 V power-on
– Two user LEDs:
LD3 (green), LD4 (red)
– Two USB OTG LEDs:
LD5 (green) VBUS and LD6 (red) OC(over-current)
板载ST-LINK/V2调试下载工具

开发板反面看有:
2.左边的接口为OTG接口,可以连接U盘等外部设备,这个需要使用OTG线,右边的接口为USB供电接口
3.中间那个大的芯片为stm32F429芯片,芯片系列为STM32F429ZIT6 MCU(144脚封装),小的为STM32F429的外部RAM存贮芯片,大小为64Mbit,它的内部flash大小为2Mbit,内部RAM为256kb

沙发
一代掌门|  楼主 | 2016-8-31 19:32 | 只看该作者
自己之前做的一个示波器,只用了LCD的底层驱动,没用系统及GUI
将C文件替换到固件包的STM32F429I-Discovery_FW_V1.0.1\Projects\Template下,运行即可
代码贴上看看:
/**
  ******************************************************************************
  * @file    ADC_TripleModeInterleaved/main.c
  * @author  MCD Application Team
  * @version V1.0.1
  * @date    11-November-2013
  * @brief   This example provides a short description of how to use the ADC
  *          peripheral to convert a regular channel in Triple interleaved mode
  *          using DMA in mode 2 with 8.4Msps .
  ******************************************************************************
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include

/** @addtogroup STM32F429I_DISCOVERY_Examples
  * @{
  */

/** @addtogroup ADC_TripleModeInterleaved
  * @{
  */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
  #define MESSAGE1   "  Triple ADC Interleaved      "
  #define MESSAGE1_1 "  DMA mode2 example           "
  #define MESSAGE2   " ADC Ch13 Conv "
  #define MESSAGE2_1 "    8.4Msps      "
  #define MESSAGE3   "Connect voltage "
  #define MESSAGE4   "to ADC Ch13   "
  #define MESSAGE5   " ADC1 = %d,%d V"
  #define MESSAGE6   " ADC2 = %d,%d V"
  #define MESSAGE7   " ADC3 = %d,%d V"
  #define LINENUM            0x15
  #define FONTSIZE         Font8x12


uint8_t aTextBuffer[50];        
int ADC_Value[4096];
int ADC_ValueSec[4096];
int i=0;
int Zero[8] = {0,0,0,0,0,0,0,0};
int ZeroFlag = 1;


/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
__IO uint32_t uhADCTripleConvertedValue[3];
  
/* Private function prototypes -----------------------------------------------*/


#ifdef USE_LCD
static void Display_Init(void);
static void Display(void);
void gridon(void);
#endif /* USE_LCD */




void DAC_Ch1_Config(void)
{
        GPIO_InitTypeDef  GPIO_InitStructure;//
        DAC_InitTypeDef DAC_InitStructure;
        RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE); //?? DCA ??
        
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; //DAC_OUT1=PA.4
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; //??? AN ??
        GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; //??????
        GPIO_Init(GPIOA, &GPIO_InitStructure); // ? ? ? ? ? ?GPIOA
        
        DAC_InitStructure.DAC_Trigger = DAC_Trigger_Software ; //????
        DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None; //?????
        DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude= DAC_TriangleAmplitude_2047;//???
        DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable; //????
        DAC_Init(DAC_Channel_2, &DAC_InitStructure); // ?????? DAC1
        DAC_Cmd(DAC_Channel_2, ENABLE); // ?? DAC1 ??
        
        DAC_SetChannel2Data(DAC_Align_12b_R, 1000); //????? 0
        DAC_SoftwareTriggerCmd(DAC_Channel_2, ENABLE); ///??????
}


void DAC1_SET(unsigned int date)
{
        DAC_SetChannel2Data(DAC_Align_12b_R, date ); //????
        DAC_SoftwareTriggerCmd(DAC_Channel_2, ENABLE); //??????
}
/* Private functions ---------------------------------------------------------*/

/**
  * @brief   Main program
  * @param  None
  * @retval None
  */


/**
  * @brief  ADC configuration
  * @note   This function Configure the ADC peripheral  
            1) Enable peripheral clocks
            2) Configure ADC Channel 13 pin as analog input
            3) DMA2_Stream0 channel0 configuration
            4) Configure ADC1 Channel 13
            5) Configure ADC2 Channel 13
            6) Configure ADC3 Channel 13
  * @param  None
  * @retval None
  */
static void GPIO_Configuration(void)
  {               
  GPIO_InitTypeDef GPIO_InitStructure;        
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC,ENABLE);        
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
  GPIO_Init(GPIOC, &GPIO_InitStructure);
}

void Gyro_ADC_Configuration(uint8_t ADC_SampleTime_Cycles)
{
          ADC_InitTypeDef       ADC_InitStructure;
          ADC_CommonInitTypeDef ADC_CommonInitStructure;               
          RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC2, ENABLE);        
        /* ADC Common Init **********************************************************/
          ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent;
          ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2;
          ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled;
          ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles;
          ADC_CommonInit(&ADC_CommonInitStructure);

        /* ADC2 Init ****************************************************************/
          ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;
          ADC_InitStructure.ADC_ScanConvMode = ENABLE;
          ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
          ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None;
          ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
          ADC_InitStructure.ADC_NbrOfConversion = 1;
          ADC_Init(ADC2, &ADC_InitStructure);        
          ADC_ITConfig(ADC2, ADC_IT_EOC, ENABLE);


        ADC_RegularChannelConfig(ADC2, ADC_Channel_13, 1, ADC_SampleTime_Cycles);
        /* Enable ADC2 */
          ADC_Cmd(ADC2, ENABLE);
          /* Start ADC2 Software Conversion */
        ADC_SoftwareStartConv(ADC2);


}
/* Functions --------------------------------------------------------------------------------*/

void ADC_Config(uint8_t ADC_SampleTime_Cycles)
{
  GPIO_Configuration();
        Gyro_ADC_Configuration(ADC_SampleTime_Cycles);
}


uint16_t Get_ADC_Data(void)
{
   while(!(ADC_GetFlagStatus(ADC2, ADC_FLAG_EOC)==SET));
         return(ADC_GetConversionValue(ADC2));
}
#ifdef USE_LCD
/**
  * @brief  Display ADCs converted values on LCD
  * @param  None
  * @retval None
  */


使用特权

评论回复
板凳
feiqi1| | 2016-8-31 19:33 | 只看该作者
并没看见开发板呢?不知道可以在哪里下载相关资料??

使用特权

评论回复
地板
一代掌门|  楼主 | 2016-8-31 19:39 | 只看该作者
改了官方的F407的例子,使其能在F429上运行,两灯闪
顺便说下  支持国产 哈哈


RT-Thread_2.0.0alpha.z01-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z02-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z03-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z04-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z05-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z06-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z07-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z08-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.z09-删掉后面这些.zip (2 MB)
RT-Thread_2.0.0alpha.zip (1.05 MB)

使用特权

评论回复
5
一代掌门|  楼主 | 2016-8-31 19:40 | 只看该作者
feiqi1 发表于 2016-8-31 19:33
并没看见开发板呢?不知道可以在哪里下载相关资料??

去这里下,很多的
http:// www . stmcu . org/

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

69

主题

191

帖子

4

粉丝