添加新的GPIO引脚控制定制板

⚠️
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个帖子/ 0新
Last post
kqtrinh
Offline
Last seen:3 years 10 months ago
加入:2016-08-24 00:17
添加新的GPIO引脚控制定制板

我正在使用DSP外设模式作为我的基线开发环境。我的应用程序目前正在使用2个UART和SPI分配GPIO端口/引脚,如下所定义:

/****************************************************************************************/
/ * UART1外部主机接口的GPIO配置* /
/****************************************************************************************/

#define gpio_uart1_tx_port gpio_port_0.
#define gpio_uart1_tx_pin gpio_pin_4.
#define GPIO_UART1_RX_PORT GPIO_PORT_0
#define GPIO_UART1_RX_PIN GPIO_PIN_5

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

#define gpio_uart2_tx_port gpio_port_1
#define GPIO_UART2_TX_PIN GPIO_PIN_2
#define gpio_uart2_rx_port gpio_port_1.
#define gpio_uart2_rx_pin gpio_pin_3.

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

#define SPI_GPIO_PORT GPIO_PORT_0
#define SPI_CLK_PIN GPIO_PIN_0
#define spi_cs_pin gpio_pin_1
#define spi_di_pin gpio_pin_6.
#define 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?

谢谢,
--Khai

设备:
MT_dialog
Offline
Last seen:2个月2周前
工作人员
加入: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

不,实际上我想要它等待它。我希望DA MCU通过GPIO引脚重置外部设备。因此,根据我已经用完了两个UART和SPI的基础,看起来GPIO Port1 PIN0(P1_0)或POR1 PIN1(P1_1)可用于此目的?我对么?

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?

谢谢,
--Khai

MT_dialog
Offline
Last seen:2个月2周前
工作人员
加入: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.
因此,根据我已经用完了两个UART和SPI的基础,看起来GPIO Port1 PIN0(P1_0)或POR1 PIN1(P1_1)可用于此目的?我对么?

谢谢,
--Khai

MT_dialog
Offline
Last seen:2个月2周前
工作人员
加入: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
在DA固件代码中

在DA固件代码中GPIO, there are functions like

gpio_configurepin()
gpio_setinactive()
GPIO_SetActive()

你介意告诉我什么时候用?查看代码,看起来需要在初始化或启动期间调用GPIO_CONFIGUREPIN()。然后可以使用gpio_setactive()和gpio_setinactive()。我的理解是否正确?

谢谢,
--Khai

MT_dialog
Offline
Last seen:2个月2周前
工作人员
加入: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