打印
[STM32F4]

Nucleo-144-stm32F413开发板测评

[复制链接]
1548|19
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
本帖最后由 21ic小管家 于 2017-1-12 16:07 编辑

当然了,先来晒个板子,后面慢慢更







更多精彩可登录ST官网
沙发
mintspring|  楼主 | 2016-12-18 14:47 | 只看该作者
大家发现没,这个板子预留了网口,但是没有焊接,这是为何,因为这个开发板属于阉割版本,我们发现,如果是Nucleo-144开发板,那就是PCB是一样的,就是上面焊接的芯片不同而已,如果这个芯片支持网络,那就会焊接网口芯片和网口。

使用特权

评论回复
板凳
mintspring|  楼主 | 2016-12-18 14:58 | 只看该作者
STM32F413/F423 – Extends STM32F412 features with higher RAM and Flash memory density and an enhanced peripheral set including 10 UARTs, 3 CANs, SAI interface, a low-power timer, 2 DACs, 2 DFSDM with up to 6 filters. The STM32F423 includes AES encryption.
这是官方给的这个芯片的片上外设的配置,绝壁两个DAC,这点没想到啊,太给力了。

使用特权

评论回复
地板
mintspring|  楼主 | 2016-12-18 15:00 | 只看该作者
  • The STM32F413/F423 devices carry 1024 to 1536 Kbytes of Flash memory and up to 320 Kbytes of SRAM.
    Available packages range from 48 to 144 pins.
    • 10x USARTs running at up to 12.5 Mbit/s
    • 5x SPI (multiplexed with the I²S) running at up to 50 Mbit/s
    • 4x I²C interfaces up to 1 Mbit/s
    • 3x CAN interfaces (2.0B Active)
    • 1x SDIO interface running at up to 48MHz and available on all packages
    • 1x USB 2.0 OTG Full-speed (FS) interface
    • 2x full-duplex I²S interfaces up to 32-bit/192 kHz
    • 3x simplex I²S interface up to 32-bit/192 kHz
    • 2x digital filters for sigma delta modulator
    • 6x PDM interfaces, stereo microphone support
    • 2x 12-bit ADC reaching 2.4 Msample/s
    • 14x 16- and 32-bit timers running at up to 100 MHz
    • 1 low-power timer available in Stop mode
    • True random number generator


使用特权

评论回复
5
mintspring|  楼主 | 2016-12-18 15:01 | 只看该作者
[size=14.1176462173462px]
Key Features
  • Dynamic Efficiency Line with eBAM (enhanced Batch Acquisition Mode)
    • 1.7 V to 3.6 V power supply
    • -40 °C to 85/105/125 °C temperature range
  • Core: ARM[size=14.1176462173462px]® 32-bit Cortex[size=14.1176462173462px]® -M4 CPU with FPU, Adaptive real-time accelerator (ART Accelerator™) allowing 0-wait state execution from Flash memory, frequency up to 100 MHz, memory protection unit, 125 DMIPS/ 1.25 DMIPS/MHz (Dhrystone 2.1), and DSP instructions
  • Memories
    • Up to 1.5 Mbytes of Flash memory
    • 320 Kbytes of SRAM
    • Flexible external static memory controller with up to 16-bit data bus: SRAM, PSRAM, NOR Flash memory
    • Dual mode Quad-SPI interface
  • LCD parallel interface, 8080/6800 modes
  • Clock, reset and supply management
    • 1.7 to 3.6 V application supply and I/Os
    • POR, PDR, PVD and BOR
    • 4-to-26 MHz crystal oscillator
    • Internal 16 MHz factory-trimmed RC
    • 32 kHz oscillator for RTC with calibration
    • Internal 32 kHz RC with calibration
  • Power consumption
    • Run: 112 μA/MHz (peripheral off)
    • Stop (Flash in Stop mode, fast wakeup time): 42 μA Typ.; 80 μA max @25 °C
    • Stop (Flash in Deep power down mode, slow wakeup time): 15 μA Typ.; 46 μA max @25 °C
    • Standby without RTC: 1.1 μA Typ.; 14.7 μA max at @85 °C
    • VBAT supply for RTC: 1 μA @25 °C
  • 2x12-bit D/A converters
  • 1×12-bit, 2.4 MSPS ADC: up to 16 channels
  • 6x digital filters for sigma delta modulator, 12x PDM interfaces, with stereo microphone and sound source localization support
  • General-purpose DMA: 16-stream DMA
  • Up to 18 timers: up to twelve 16-bit timers, two 32-bit timers up to 100 MHz each with up to four IC/OC/PWM or pulse counter and quadrature (incremental) encoder input, two watchdog timers (independent and window), one SysTick timer, and a low-power timer
  • Debug mode
    • Serial wire debug (SWD) & JTAG
    • Cortex[size=14.1176462173462px]® -M4 Embedded Trace Macrocell™
  • Up to 114 I/O ports with interrupt capability
    • Up to 109 fast I/Os up to 100 MHz
    • Up to 114 five V-tolerant I/Os
  • Up to 24 communication interfaces
    • Up to 4x I[size=14.1176462173462px]2 C interfaces (SMBus/PMBus)
    • Up to 10 UARTS: 4 USARTs / 6 UARTs (2 x 12.5 Mbit/s, 2 x 6.25 Mbit/s), ISO 7816 interface, LIN, IrDA, modem control)
    • Up to 5 SPI/I2Ss (up to 50 Mbit/s, SPI or I2S audio protocol), out of which 2 muxed full-duplex I2S interfaces
    • SDIO interface (SD/MMC/eMMC)
    • Advanced connectivity: USB 2.0 full-speed device/host/OTG controller with PHY
    • 3x CAN (2.0B Active)
    • 1xSAI
  • True random number generator
  • CRC calculation unit
  • 96-bit unique ID
  • RTC: subsecond accuracy, hardware calendar
  • All packages are ECOPACK[size=14.1176462173462px]® 2

电路原理图

使用特权

评论回复
6
mintspring|  楼主 | 2016-12-18 15:05 | 只看该作者
其实支持STM32F413开发的工具是非常非常多的,官方有证


使用特权

评论回复
7
mintspring|  楼主 | 2016-12-18 15:07 | 只看该作者
官方提供了硬件开发入门的,大家做之前一定要看。比如复位电路,供电电路,以及PCB做的时候要考虑哪些。
STM32F4xxxx MCU 硬件开发入门 .pdf (1.24 MB)



使用特权

评论回复
8
mintspring|  楼主 | 2016-12-18 15:09 | 只看该作者




使用特权

评论回复
9
mintspring|  楼主 | 2016-12-18 15:10 | 只看该作者
DMA是另外一种重要的应用。
官方给了像个的教程
使用 STM32F2 和 STM32F4 DMA 控制器.pdf (1.47 MB)



使用特权

评论回复
10
mintspring|  楼主 | 2016-12-18 15:30 | 只看该作者
官方的BSP开发包提供了丰富的例程的
STM32F413ZH-Nucleo.rar (3.52 MB)



使用特权

评论回复
11
mintspring|  楼主 | 2016-12-18 15:34 | 只看该作者
不少人通过那个cubeMX软件图形化配置,我觉得此乃不妥啊,不如先通过例程掌握流程,做好笔记,比如某个外设怎么用,都有哪些可选的配置项目,都是什么意思,搞清楚了,才行,比直接用cubeMX配置要学的扎实。

使用特权

评论回复
12
mintspring|  楼主 | 2016-12-18 15:36 | 只看该作者

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

/** @addtogroup STM32F4xx_HAL_Examples
  * @{
  */

/** @addtogroup GPIO_IOToggle
  * @{
  */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
static GPIO_InitTypeDef  GPIO_InitStruct;

/* Private function prototypes -----------------------------------------------*/
static void SystemClock_Config(void);


/* Private functions ---------------------------------------------------------*/

/**
  * [url=home.php?mod=space&uid=247401]@brief[/url]  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* This sample code shows how to use GPIO HAL API to toggle LED1 and LED2 IOs
    in an infinite loop. */

  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch
       - Systick timer is configured by default as source of time base, but user
         can eventually implement his proper time base source (a general purpose
         timer for example or other time source), keeping in mind that Time base
         duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
         handled in milliseconds basis.
       - Set NVIC Group Priority to 4
       - Low Level Initialization
     */
  HAL_Init();

  /* Configure the system clock to 100 MHz */
  SystemClock_Config();
  
  /* -1- Enable GPIO Clock (to be able to program the configuration registers) */
  LED1_GPIO_CLK_ENABLE();
  LED2_GPIO_CLK_ENABLE();

  /* -2- Configure IO in output push-pull mode to drive external LEDs */
  GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull  = GPIO_PULLUP;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;

  GPIO_InitStruct.Pin = LED1_PIN;
  HAL_GPIO_Init(LED1_GPIO_PORT, &GPIO_InitStruct);
  GPIO_InitStruct.Pin = LED2_PIN;
  HAL_GPIO_Init(LED2_GPIO_PORT, &GPIO_InitStruct);

  /* -3- Toggle IO in an infinite loop */
  while (1)
  {
    HAL_GPIO_TogglePin(LED1_GPIO_PORT, LED1_PIN);
    /* Insert delay 100 ms */
    HAL_Delay(100);
    HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);
    /* Insert delay 100 ms */
    HAL_Delay(100);
  }
}

/**
  * @brief  System Clock Configuration
  *         The system Clock is configured as follow :
  *            System Clock source            = PLL (HSE)
  *            SYSCLK(Hz)                     = 100000000
  *            HCLK(Hz)                       = 100000000
  *            AHB Prescaler                  = 1
  *            APB1 Prescaler                 = 2
  *            APB2 Prescaler                 = 1
  *            HSE Frequency(Hz)              = 8000000
  *            PLL_M                          = 8
  *            PLL_N                          = 200
  *            PLL_P                          = 2
  *            PLL_Q                          = 7
  *            PLL_R                          = 2
  *            VDD(V)                         = 3.3
  *            Main regulator output voltage  = Scale1 mode
  *            Flash Latency(WS)              = 3
  * @param  None
  * @retval None
  */
static void SystemClock_Config(void)
{
  RCC_ClkInitTypeDef RCC_ClkInitStruct;
  RCC_OscInitTypeDef RCC_OscInitStruct;
  HAL_StatusTypeDef ret = HAL_OK;

  /* Enable Power Control clock */
  __HAL_RCC_PWR_CLK_ENABLE();

  /* The voltage scaling allows optimizing the power consumption when the device is
     clocked below the maximum system frequency, to update the voltage scaling value
     regarding system frequency refer to product datasheet.  */
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

  /* Enable HSE Oscillator and activate PLL with HSE as source */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = 8;
  RCC_OscInitStruct.PLL.PLLN = 200;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 7;
  RCC_OscInitStruct.PLL.PLLR = 2;
  ret = HAL_RCC_OscConfig(&RCC_OscInitStruct);
  
  if(ret != HAL_OK)
  {
    while(1) { ; }
  }

  /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
     clocks dividers */
  RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;  
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;  
  ret = HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3);
  if(ret != HAL_OK)
  {
    while(1) { ; }  
  }
}


#ifdef  USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t *file, uint32_t line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}
#endif

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

使用特权

评论回复
13
mintspring|  楼主 | 2016-12-18 15:51 | 只看该作者
根据这个例程,我们可以看出来,第一步就是初始化,这里用了个HAL_Init();
大家可以编译后定位一下看看,其实里面没多少需要用户写的,直接用就行了。

使用特权

评论回复
14
mintspring|  楼主 | 2016-12-18 16:00 | 只看该作者
然后就是配置时钟,这个如果不会确实可以通过cubeMX很轻的配置好的

使用特权

评论回复
15
mintspring|  楼主 | 2016-12-18 16:01 | 只看该作者
而后面两个LED的时钟的配置其实就是重复了,因为我们知道,这个板子的两个LED都是GPIOB上的
#define LED1_PIN                                GPIO_PIN_0
#define LED1_GPIO_PORT                          GPIOB
#define LED1_GPIO_CLK_ENABLE()                  __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED1_GPIO_CLK_DISABLE()                 __HAL_RCC_GPIOB_CLK_DISABLE()  

#define LED2_PIN                                GPIO_PIN_7
#define LED2_GPIO_PORT                          GPIOB
#define LED2_GPIO_CLK_ENABLE()                  __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED2_GPIO_CLK_DISABLE()                 __HAL_RCC_GPIOB_CLK_DISABLE()  

使用特权

评论回复
16
mintspring|  楼主 | 2016-12-18 16:03 | 只看该作者
可以看出来吧,实际上是宏替换的,而后面的被替换的内容是一样一样的。其实分析这些例程代码很有趣。

使用特权

评论回复
17
mintspring|  楼主 | 2016-12-18 16:13 | 只看该作者
/* -2- Configure IO in output push-pull mode to drive external LEDs */
  GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull  = GPIO_PULLUP;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;

  GPIO_InitStruct.Pin = LED1_PIN;
  HAL_GPIO_Init(LED1_GPIO_PORT, &GPIO_InitStruct);
  GPIO_InitStruct.Pin = LED2_PIN;
  HAL_GPIO_Init(LED2_GPIO_PORT, &GPIO_InitStruct);

这是配置模式,配置完好后,用指针传递后完成配置。

使用特权

评论回复
18
mintspring|  楼主 | 2016-12-18 16:19 | 只看该作者
STM32F413/423 Cortex-M4入门级高性能微控制器

STM32F413/423微控制器为高性能STM32F4系列单片机的入门级产品,实现了运行模式下的动态功耗和处理器性能之间的最佳平衡,即使在3.951 x 4.039 mm的小封装内也集成了大量的增值性能。
STM32F413/423 MCU基于支持浮点运算单元的Cortex®-M4内核,它的工作频率可达到100 MHz,在运行和停机模式下实现出色的低功耗性能。STM32F413/423性能更加出色,配备2个RAM,其中一个RAM(64-KB SRAM2)可通过I/D连接。
STM32F413/423单片机利用批量数据采集模式(BAM)将批量数据处理进行功耗优化,将动态功耗效率提升到了一个新的水平。 BAM允许通信外设实现批量数据交换,同时器件的其它部分(包括CPU)可保持在省电模式。
性能: 在100 MHz频率下,借助意法半导体的ART加速器,STM32F413/423 MCU能够实现125 DMIPS/339 CoreMark性能,并实现了从Flash存储器零等待执行。 DSP指令和浮点运算单元扩大了产品的应用范围。
功效: STM32f413/423采用意法半导体90 nm工艺,使用ART加速器和动态功耗调整功能,从Flash存储器执行指令,运行模式下可实现低至112 µA/MHz的电流消耗。停机模式下,功耗低至18 µA。
集成度:STM32F413/F423单片机内置高达1024至1536 KB的Flash存储器和高达320 KB的SRAM。
具备从48到144引脚各类封装。
10x USART,速率可高达12.5 Mbit/s
5x SPI(与I²S复用 ),速率高达50 Mbit/s
4x I²C,高达1Mbps
3x CAN(2.0B有效)
所有封装都带1个SDIO,频率高达48MHz
1x 全速USB 2.0 OTG
2x 全双工I²S,最高32-bit/192 kHz
3x 单工I²S,最高32-bit/192 kHz
2x 数字滤波器,用于∑Δ调制器
6x PDM接口,支持立体声麦克风
2x 12位ADC,速度高达2.4 MSPS
14x 16和32位定时器,频率高达100 MHz
1x 在停机模式下的低功耗定时器
真随机数发生器

使用特权

评论回复
19
mintspring|  楼主 | 2016-12-18 16:20 | 只看该作者
配置好了上拉输出模式后,就可以使用了,通过翻转指令加上延时函数,就能闪烁了。

使用特权

评论回复
20
mintspring|  楼主 | 2016-12-18 17:10 | 只看该作者
__weak void HAL_Delay(__IO uint32_t Delay)
{
  uint32_t tickstart = 0U;
  tickstart = HAL_GetTick();
  while((HAL_GetTick() - tickstart) < Delay)
  {
  }
}

这个就是那个Delay函数的原型,我们可以看出来其实采用的是 HAL_GetTick(); 实现的。而该函数是这样的
_weak uint32_t HAL_GetTick(void)
{
  return uwTick;
}




使用特权

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

本版积分规则

295

主题

4884

帖子

24

粉丝