9222 views|4 replies

10

Posts

0

Resources
The OP
 

nrf52832 debugging record IO pin configuration [Copy link]

This post was last edited by Zhixin Studio on 2020-11-18 14:38

Since the Bluetooth ECG recording module developed by this studio uses nrf52832 as the main control chip, some problems encountered during the development process will be shared with you one by one:

The following figure is the pin diagram of the nrf52832 chip QFN48 package

Among them, P0.02~P0.05 and P0.28~P0.31 can be configured as ADC acquisition pins, and other IO pins can be arbitrarily assigned to various peripherals

P0.09 and P0.10 are assigned to NFC peripherals by default. If you need to set them as normal IO or map them to other peripherals, you need to add the macro CONFIG_NFCT_PINS_AS_GPIOS

P0.21 is used as the reset pin by default. If you need to set it as a normal IO or map it to other peripherals, you need to delete the macro CONFIG_GPIO_AS_PINRESET

However, after actual debugging, it is invalid after deletion. Debug observation found that PSELRESET is still connected to the default reset pin

I searched the source code and found that the following if statement is always invalid, so I need to manually modify NRF_UICR->PSELRESET[0] NRF_UICR->PSELRESET[1] to the required reset pin or disconnect it. When I was debugging, I directly modified the register to the empty IO pin.

Since this register is not lost when power is off, it can be modified normally

/* Bit 31 : Connection */
#define UICR_PSELRESET_CONNECT_Pos (31UL) /*!< Position of CONNECT field. */
#define UICR_PSELRESET_CONNECT_Msk (0x1UL << UICR_PSELRESET_CONNECT_Pos) /*!< Bit mask of CONNECT field. */
#define UICR_PSELRESET_CONNECT_Connected ( 0UL) /*!< Connect */
#define UICR_PSELRESET_CONNECT_Disconnected (1UL) /*!< Disconnect */

#if defined (CONFIG_GPIO_AS_PINRESET)
if (((NRF_UICR->PSELRESET[0] & UICR_PSELRESET_CONNECT_Msk) != (UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos)) ||
((NRF_UICR->PSELRESET[1] & UICR_PSELRESET_CONNECT_Msk ) != (UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos )))
{
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NRF_UICR->PSELRESET[0] = 0xffff;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NRF_UICR->PSELRESET[1] = 0xffff;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
while (NRF_NVMC ->READY = = NVMC_READY_READY_Busy){}
NVIC_SystemReset();
}
#endif

Serial communication pin

When configuring serial communication, when the serial port receiving pin is left unconnected and reception is enabled, errors may occur, causing the program to die in the serial port receiving error. This can be solved by connecting a pull-up resistor to the RX pin.

Since the 32768 clock is normally used, no IO configuration is made

This post is from RF/Wirelessly

Latest reply

Nice sharing   Details Published on 2020-12-20 12:41
 

1w

Posts

204

Resources
2
 

Thanks for sharing ~ Is there a demo development board like that? Can you let netizens experience it?

This post is from RF/Wirelessly
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle

Comments

https://en.eeworld.com/bbs/forum.php?mod=viewthread&tid=1149010&page=1#pid3030385 This is a sample test. Now only a small batch is made. After mass production, it can be experienced by netizens who are engaged in wearable products or medical fields.  Details Published on 2020-12-12 20:30
Personal signature

玩板看这里:

http://en.eeworld.com/bbs/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 

10

Posts

0

Resources
3
 
okhxyyo posted on 2020-12-8 20:37 Thank you for sharing ~ Is there a demo development board like that? Can you let netizens experience it?

https://en.eeworld.com/bbs/forum.php?mod=viewthread&tid=1149010&page=1#pid3030385

This is a sample test. We have only made a small batch now. After mass production, we can let netizens who are engaged in wearable products or medical fields experience it.

This post is from RF/Wirelessly

Comments

I wish you all the best here.  Details Published on 2020-12-14 09:03
Personal signature

专注医疗健康解决方案

 
 
 

1w

Posts

204

Resources
4
 
Zhixin Studio published on 2020-12-12 20:30 https://en.eeworld.com/bbs/forum.php?mod=viewthread&tid=1149010&page=1#pid3030385 This is a sample...

I wish you all the best here.

This post is from RF/Wirelessly
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

http://en.eeworld.com/bbs/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

2w

Posts

341

Resources
5
 

Nice sharing

This post is from RF/Wirelessly
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

快速回复 返回顶部 Return list