2486 views|0 replies

157

Posts

0

Resources
The OP
 

[National Technology N32WB452 Review] + Basic Function Usage [Copy link]

[National Technology N32WB452 Review] + Basic Function Usage

The N32WB452 series is a BLE5.0 MCU chip based on the 32-bit ARM Cortex-M4F + Cortex-M0 dual-core, with TX/RX power consumption of 3.5mA, transmit power +3dBm, receive sensitivity -94dBm, main frequency of 144MHz, support for floating-point operations and DSP instructions, built-in 512KB Flash, 144KB SRAM, integrated 7xU(S)ART, 4xI2C, 3xSPI, 2xCAN 2.0B, 1x USB 2.0 FS Device, 1xSDIO, digital video interface, 2x12bit 5Msps ADC, 2x1Msps 12bit DAC, support up to 18-channel capacitive touch buttons, and built-in cryptographic algorithm hardware acceleration engine.

According to the chip data sheet, the chip functions are very powerful. First, use the basic functions, such as GPIO, PWM, ADC, SPI, touch buttons, etc., to familiarize yourself with the ideas of software development and learn to design software development thinking. I hope you will gain a lot from the following studies.

  • LED lighting
  1. The routine code structure is very concise, and the redundant and unused underlying drivers are not loaded. The software structure is also the mainstream structure, which is very easy to use. The N32WB452 series quick development guide document clearly describes the overall software architecture, as shown in the figure:

2. First, turn on the light to verify whether the compilation environment, download program function, and MCU minimum system function are in place.

3. The actual effect is shown in the figure

LED1 is always red, LED2 is always white and is controlled by the inverse function. LED3 and LED4 are switch control functions, but their pin control functions are customized. The following function is very interesting, and I have never encountered such an application in previous development.

/**

* @brief Turns selected Led on or off.

* @param GPIOx x can be A to G to select the GPIO port.

* @param Pin This parameter can be one of the following values:

* @arg GPIO_PIN_0~GPIO_PIN_15: set related pin on

* @arg (GPIO_PIN_0<<16)~(GPIO_PIN_15<<16): clear related pin off

*/

void LedOnOff(GPIO_Module* GPIOx, uint32_t Pin)

{

GPIOx->PBSC = Pin;

}

  • Touch Screen Switch (TSC)

  1. Software structure,Dome project uses four application layer driver files: serial port printing, timer, TSC, and GPIO.

After checking and analyzing the code, the main function of the timer is to regularly detect whether the touch button has action. Its main loop detects once every 10ms, and the timer interrupt function and the key trigger detection function call detection frequency are as high as 10ms/50. I think it should be used for anti-shake processing. According to this method, it can also be used for short-press and long-press judgment of buttons.

There are 23 touch button TSC channels:

// The following is the corresponding relationship of port, TSC channel, pulse data and key of this demo.

/* port <--------> TSC channel <--------> key on board

PA4 <--------> TSC channel 0 <--------> NC

PA5 <--------> TSC channel 1 <--------> NC

PB14 <--------> TSC channel 2 <--------> NC

PB15 <--------> TSC channel 3 <--------> NC

PD8 <--------> TSC channel 4 <--------> NC

PD9 <--------> TSC channel 5 <--------> NC

PD11 <--------> TSC channel 6 <--------> NC

PD12 <--------> TSC channel 7 <--------> NC

PC6 <--------> TSC channel 8 <--------> NC

PC7 <--------> TSC channel 9 <--------> NC

PC8 <--------> TSC channel 10 <--------> NC

PC9 <--------> TSC channel 11 <--------> NC

PC10 <--------> TSC channel 12 <--------> T6

PC11 <--------> TSC channel 13 <--------> T4

PC12 <--------> TSC channel 14 <--------> T5

PD2 <--------> TSC channel 15 <--------> T3

PD4 <--------> TSC channel 16 <--------> NC

PD5 <--------> TSC channel 17 <--------> NC

PD6 <--------> TSC channel 18 <--------> NC

PD7 <--------> TSC channel 19 <--------> NC

PB6 <--------> TSC channel 20 <--------> NC

PB7 <--------> TSC channel 21 <--------> NC

PB8 <--------> TSC channel 22 <--------> NC

PB9 <--------> TSC channel 23 <--------> NC

*/

  1. Actual Results

The four buttons correspond to the four LED dots, and there is a serial port print output.

3. Timer PWM (TIM)

Everyone knows that PWM output uses the timer output channel. There are many TIM timer demos, and I am too lazy to verify them one by one. I would like to praise the demo project for being very user-friendly. The timer calculation formula and duty cycle are clearly stated in the download program.

  1. Actual Results

ADC

Up to two 12-bit 5Msps sampling rate successive approximation ADCs, supporting single-ended and differential inputs.

I hope the official can unify the ADC software structure. When using the TSCdemo project, the names of files such as tim.c are independent, while the configuration program and logic control program of ADC related projects are all in the main.c file. It feels intuitively that multiple engineers cooperated in development without a unified development idea. Now I am more worried about the reliability of the national technology manufacturer's program.

  • Hardware schematics, onboard features

  1. LCD uses SPI interface communication
  2. Reset and wake-up buttons can be used to test the sleep mechanism
  3. Adjustable resistor, with pwm pulse output, use knob resistor to adjust pwm pulse
  4. USB interface, USB2.0 full-speed device technical specification (12Mbit/s)
  5. Nslink interface, equivalent to jlinkV9.0 with serial port function
  6. Button battery, RTC clock circuit complete
  7. The Flash chip model is 25Q128
  8. Temperature and humidity sensor chip, HDC2010 adopts ultra-compact integrated design, very beautiful.
  9. Three-axis accelerometer acceleration sensor QMA7981,
  10. DVP camera interface
  11. TSC touch button
  12. Buzzer interface
This post is from RF/Wirelessly
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>
Featured Posts
Protel shortcut keys classic!!!

Author: qiy8106 Source: China PCB Technology Network tab??Start the property window of the floating drawing pgup??Enla ...

Practical Analog Circuit Design Technology Collection

Practical Analog Circuit Design Technology-Section 1

LS inverter module damage caused by overcurrent fault repair

LS inverter module damage leads to overcurrent fault repair: Overcurrent fault alarm is a common fault of LS inverter. T ...

【Development and application based on NUCLEO-F746ZG motor】14. Parameter configuration - motor parameter configuration

This post was last edited by annysky2012 on 2021-10-20 21:59 I haven't updated for a few days. The weather has turned c ...

Chapter 5 GD32L23x I2C Usage - Read and Write DHT12

I2C uses only two data lines for communication, and multiple devices can be mounted under one set of communication lin ...

[Sipeed LicheeRV 86 Panel Review] 5. WAFT First Experience

This post was last edited by sonicfirr on 2022-3-18 23:32 The introduction of the LicheeRV 86 board states that it s ...

35 "Ten Thousand Miles" Raspberry Pi Car——ROS Learning (Realizing Hello World)

The best way to learn ROS is to use it. The ROS official website has a Chinese version of the tutorial . After install ...

[DIY] Logitech K260 keyboard set modified lithium battery power supply and added working instructions

This post was last edited by dcexpert on 2023-1-24 18:22 During the Chinese New Year holiday, I don't have much to do, ...

[HC32F448 Review] SPI Learning and SPI Software/Hardware Driving OLED

Simulate SPI to drive OLED: Macro definition: #define CS2_PORT (GPIO_PORT_D) #define CS2_PIN (GPIO_P ...

Creative Contest-LORA Sensing-01 Unboxing Post

A week later, I placed an order on the first day after the Mid-Autumn Festival holiday, and received it on the 25th by S ...

快速回复 返回顶部 Return list