2431 views|6 replies

20

Posts

0

Resources
The OP
 

[N32L43X Review] 1. Breathing light [Copy link]

 This post was last edited by 805721366 on 2022-6-26 14:27

Thank you for being selected to evaluate the National Technology low-power N32L43x series chip development board

The N32L43x series uses a 32-bit ARM Cortex-M4 core with a maximum main frequency of 108MHz, supports floating-point operations and DSP instructions, integrates up to 128KB embedded encryption FLash, 32KB SRAM, integrates low-power peripherals for flow measurement, and rich high-performance analog devices. It has a built-in 12-bit 5Msps ADC, 2 independent rail-to-rail operational amplifiers, 2 high-speed comparators, and a 1Msps 12-bit DAC. It supports up to 24 channels of capacitive touch buttons, integrates up to 320 segments of Segment LCD drivers, integrates multiple U(S)ART, I2C, SPI, USB, CAN and other digital communication interfaces, and has a built-in cryptographic algorithm hardware acceleration engine.

1. Preliminary preparation

Download the official FTP database: Use the file explorer to enter ftp://58.250.18.138 anonymous user login, no password

Install the chip Keil support package

Pack Installer -> File -> Import... Select the support package Nationstech.N32L43x_DFP.0.1.0.pack to install

After successful installation

2. Create a new test project

Set Options for Target and select N32L436RB as the chip model

Check Create HEX File

Add .h header file path

Select the emulator model

The project is as follows

3. PWM initialization

Set LED2 drive pin PB4 to PWM output, PWM period 400us

PWM initialization code

/**
 * @brief PWM初始化
 */
void hal_pwmInit(void)
{
    GPIO_InitType GPIO_InitStructure;
    TIM_TimeBaseInitType TIM_TimeBaseStructure;
    OCInitType TIM_OCInitStructure;

    /* TIM3 clock enable */
    RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_TIM3, ENABLE);
    /* GPIOB clock enable */
    RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_GPIOB | RCC_APB2_PERIPH_AFIO, ENABLE);

    GPIO_InitStruct(&GPIO_InitStructure);
    GPIO_InitStructure.Pin = LED2_PIN;
    GPIO_InitStructure.GPIO_Current = GPIO_DC_4mA;
    //GPIO_InitStructure.GPIO_Pull = GPIO_No_Pull;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
    GPIO_InitStructure.GPIO_Alternate = GPIO_AF2_TIM3;
    GPIO_InitPeripheral(LED2_PORT, &GPIO_InitStructure);
    //GPIO_ResetBits(LED2_PORT, LED2_PIN);

    /* Time base configuration */
    TIM_TimeBaseStructure.Prescaler	= 108-1; 	//分频值108 108MHz/108 = 1MHz 1us
    TIM_TimeBaseStructure.Period = 400-1; 	//周期值400,定时周期400*1us = 400us
    TIM_TimeBaseStructure.CntMode	= TIM_CNT_MODE_UP;
    TIM_TimeBaseStructure.ClkDiv = 0;
    TIM_InitTimeBase(TIM3, &TIM_TimeBaseStructure);

    /* PWM1 Mode configuration: Channel1 */
    TIM_OCInitStructure.OcMode =  TIM_OCMODE_PWM1;
    TIM_OCInitStructure.OutputState =  TIM_OUTPUT_STATE_ENABLE;
    TIM_OCInitStructure.OcPolarity =  TIM_OC_POLARITY_HIGH;
    TIM_OCInitStructure.Pulse = 0;
    TIM_InitOc1(TIM3, &TIM_OCInitStructure);
    //使能预装载寄存器
    TIM_ConfigOc1Preload(TIM3, TIM_OC_PRE_LOAD_ENABLE);
    //使能自动重装载的预装载寄存器允许位
    TIM_ConfigArPreload(TIM3, ENABLE);
    /* TIM3 enable counter */
    TIM_Enable(TIM3, ENABLE);
}

4. The effects are as follows

WeChat_20220626141907

5. Test code

N32L43_LEDBreathingtest.rar (419.4 KB, downloads: 2)

This post is from Domestic Chip Exchange

Latest reply

Thanks for sharing, looking forward to your follow-up review.   Details Published on 2022-6-27 19:49
 
 

6841

Posts

11

Resources
2
 
Thank you for your hard work. This time, the routine of the controller seems to have a bigger change compared with N32G45.
This post is from Domestic Chip Exchange
 
 
 

5221

Posts

239

Resources
3
 

This is the first time I noticed that your way of downloading resources is different from their direct download from the official website? Is this address provided by the official website?

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
 
 

7462

Posts

2

Resources
4
 

Thanks for sharing, looking forward to your follow-up review.

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

20

Posts

0

Resources
5
 
nmg posted on 2022-6-27 08:39 This is the first time I found that your way of downloading resources is different from their direct download from the official website? Is this address provided by the official website?

This is also the official download address

This post is from Domestic Chip Exchange
 
 
 

20

Posts

0

Resources
6
 
freebsder posted on 2022-6-27 19:49 Thank you for sharing, looking forward to the follow-up review.

This post is from Domestic Chip Exchange
 
 
 

20

Posts

0

Resources
7
 
lugl4313820 posted on 2022-6-26 17:03 Thank you for your hard work. This time, the routine of the manager seems to have a bigger change compared with N32G45.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list