Adding a new GPIO pin for controlling custom board

⚠️
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//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
kqtrinh
Offline
Last seen:3 years 10 months ago
加入:2016-08-24 00:17
Adding a new GPIO pin for controlling custom board

I am using the DSPS peripheral mode as my baseline development environment. My application is currently using 2 UARTs and SPI allocation of GPIO ports/pins as defined below:

/****************************************************************************************/
/* UART1 GPIO configuration for external Host interface */
/****************************************************************************************/

#定义GPIO_UART1_TX_PORT GPIO_PORT_0
#定义GPIO_UART1_TX_PIN GPIO_PIN_4
#定义GPIO_UART1_RX_PORT GPIO_PORT_0
#定义GPIO_UART1_RX_PIN GPIO_PIN_5

/****************************************************************************************/
/* UART2 GPIO configuration for QPI CI interface */
/****************************************************************************************/

#定义GPIO_UART2_TX_PORT GPIO_PORT_1
#定义GPIO_UART2_TX_PIN GPIO_PIN_2
#定义GPIO_UART2_RX_PORT GPIO_PORT_1
#定义GPIO_UART2_RX_PIN GPIO_PIN_3

/****************************************************************************************/
/* SPI Flash options */
/****************************************************************************************/

#定义SPI_GPIO_PORT GPIO_PORT_0
#定义SPI_CLK_PIN GPIO_PIN_0
#定义SPI_CS_PIN GPIO_PIN_1
#定义SPI_DI_PIN GPIO_PIN_6
#定义SPI_DO_PIN GPIO_PIN_7

We are using to use the 580 WL-CSP34 package in which i understand there are only 2 available GPIO ports for this particular package.
With the above GPIO port/pin allocation, what is your suggestion in how to free up an available pin for use by the DA to tap into a reset line of another device so i can programmatically reset that device?

Thanks,
--Khai

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

Yes the WL-CSP34 has indeed only two available ports PORT_0 and PORT_1, although i dont quite undertstand your question, you would like an extra GPIO pin in order to reset the 580 programmatically via an external MCU, so i suppose that you would toggle that GPIO from an external MCU check via sw the state of the of the pin and issue a platform reset, is that the case ? In the current configuration that you have posted you have free pins (P02, P03, P10 and P11 also the P14/SWCLK and P15/SW_DIO can also be used - you need to be a bit careful with those pins since they are the JTAG pins), so what is exactly the case ?

Some additional info, if you configure your pins in a specific functionallity, there is no limitation to re-configure them in a different functionallity, for example you can configure a pin to work as a UART TX/RX when you would like to transmit or you are aware that you are going to have a data reception and after that is done you can reconfigure your pin to have any SPI functionallity.

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 10 months ago
加入:2016-08-24 00:17
No, actually i want it the

No, actually i want it the other way around. I want the DA MCU to reset an external device through a GPIO pin. So based on what I already used up for two UARTs and SPI, looks like either GPIO Port1 Pin0 (P1_0) or Port1 Pin1 (P1_1) can be used for this purpose? am I correct?

I also would like to use the MCU 16Mhz clock to drive my external device. Is this clock mapped to one of the GPIO pin on the 580 Basic/Pro Kit? If not, how can i take advantage of this clock for my external device?

Thanks,
--Khai

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

Regarding mapping of the clocks, the XTAL or any of the clocks on GPIO pins, the XTAL16, XTAL32, RC16M_clk, RC32K and RC32K Low jitter clock are mapped to the port/pins P05, P06, P07, P10 and P11 respectively, by enabling the corresponding clock and by setting the corresponding pin as output. That will output the selected clock to the specified pins, this behaviour is only enabled during testing (there is a specific hidden register that puts the chip in test mode) and that means that the corresponding pins from port 0 and 1 will be reserved to output the testing signals of the clocks (if the corresponding pins are configured as output), so you wont be able to use those ports as outputs when operating under test mode. Also if you intent to use the sleep mode on the 580 be aware that the XTAL will be shut down during low power mode. So i am not sure if this is a good idea, since you allready have a pin limitation.

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 10 months ago
加入:2016-08-24 00:17
Ok. Doesn't look like we can

Ok. Doesn't look like we can count on this clock from the 580 then. Can you comment on the reset pin to confirm if my thinking is correct?

Recall my question:

I want it the other way around. I want the DA MCU to reset an external device through a GPIO pin on the DA J4 header.
So based on what I already used up for two UARTs and SPI, looks like either GPIO Port1 Pin0 (P1_0) or Port1 Pin1 (P1_1) can be used for this purpose? am I correct?

Thanks,
--Khai

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

Yes, i dont see any probelm in that, you should be able to use those GPIO's as outputs to drive your external MCU in reset.

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 10 months ago
加入:2016-08-24 00:17
In the DA firmware code for

In the DA firmware code for GPIO, there are functions like

GPIO_ConfigurePin()
GPIO_SetInactive()
GPIO_SetActive()

Would you mind tell me when to use which? Looking at the code, it looks like GPIO_ConfigurePin() needs to be called during initialization or startup. Then GPIO_SetActive() and GPIO_SetInactive() can be used. is my understanding correct here?

Thanks,
--Khai

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

Yes the GPIO_ConfigurePin() is to configure the functionallity of the pin and also you can set a default state of the pin (high or low) the GPIO_SetInactive() and GPIO_SetActive() are used in order to set the state of the pin high of low.

I would suggest to have a look at the UM-B-051 DA1458x Software Platform Reference.pdf on section 10.3 which documents the drivers for the GPIOs in the SDK.

Thanks MT_dialog