GPIO Port 0 Pin 0 as Output

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5 posts / 0 new
Last post
magergar
Offline
Last seen: 1 year 2 weeks ago
Joined: 2020-05-26 18:20
GPIO Port 0 Pin 0 as Output

I have a problem regarding pin 0 port 0 beacuse I can not use it as an output

I'm using the ble_app_peripheral example and added the corresponding configuration

I've reserved the pin
RESERVE_GPIO(LED2, LED2_PORT, LED2_PIN, PID_GPIO); //Where LED2_PORT = GPIO_PORT_0 and LED2_PIN_0 = GPIO_PIN_0

Then configure it as an output
GPIO_ConfigurePin(LED2_PORT, LED2_PIN, OUTPUT, PID_GPIO, false);

And when trying to change the pin state nothing happens it remains off

I notice that is this pin specifically because when I change it to another pin (GPIO_PIN_9) it works, so maybe is there another configuration I'm mising?
I also know that this pin is also for reset so maybe I can't use it for this purpose?

I had no problem when working as peripheral only, it works fine, the problem comes in the bluetooth example, this pin is used as SPI and I removed this configuration
but a I think that this was not enough...

I can not use another pin because I'm using all of them for diferent purposes(which I have not configured yet, I'm focusing on this pin for the moment)

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi magergar,

Hi magergar,

According to the DA14531 Module Datasheet, the P0_0 is used for the SPI MOSI and for the reset functionality.

Please note that P0_0/RST pin should not be driven while the TINYTM module boots from its internal

SPI FLASH. So, are you booting from Flash or from System-RAM?

>>this pin is used as SPI and I removed this configuration

Do you mean that you have remove the configuration from the user_periph_setup.h / .c ? Can you please attach the the user_periph_setup.h / .c files?

Thanks, PM_Dialog

magergar
Offline
Last seen: 1 year 2 weeks ago
Joined: 2020-05-26 18:20
Hi,

Hi,

I Uploaded the user_periph_setup.h / .c  where I Removed the SPI configuration
I also included the user_custs1_impl.c which is where I drive  the port on and off
what I did was just turn on and off  the port when I write the LED Characteristic in the service 1

I don't know where I'm booting from
I'm flashing the device in my custom pcb is this what you meant?

Attachment: 
magergar
Offline
Last seen: 1 year 2 weeks ago
Joined: 2020-05-26 18:20
Found the problem, I needed

Found the problem, I needed to disable the hardware reset function so I could use it as GPIO

checking the example found this line

GPIO_Disable_HW_Reset();

on void periph_init(void) function once I added that there was no problem.

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi magergar,

Hi magergar,

Thanks for your indication and glad that you solved it.

Thanks, PM_Dialog