UART2 pin on DA14681 board (basic)

6 posts / 0 new
Last post
jamesleo-konka
Offline
Last seen:4 years 1 month ago
加入:2017-01-22 02:42
UART2 pin on DA14681 board (basic)

Hi Dialog,
I want to use UART2 to communicate with other device.
But I don't know which port/pin is ready for UART2.
//------------------------------------------------
/* UART 2 */
#if CFG_DEMO_AD_UART
#if dg_configBLACK_ORCA_MB_REV == BLACK_ORCA_MB_REV_D
# define CFG_GPIO_UART2_TX_PORT (HW_GPIO_PORT_4)
# define CFG_GPIO_UART2_TX_PIN (HW_GPIO_PIN_2)
# define CFG_GPIO_UART2_RX_PORT (HW_GPIO_PORT_4)
# define CFG_GPIO_UART2_RX_PIN (HW_GPIO_PIN_1)
#else
# define CFG_GPIO_UART2_TX_PORT (HW_GPIO_PORT_1)
# define CFG_GPIO_UART2_TX_PIN (HW_GPIO_PIN_2)
# define CFG_GPIO_UART2_RX_PORT (HW_GPIO_PORT_1)
# define CFG_GPIO_UART2_RX_PIN (HW_GPIO_PIN_3)
#endif
#endif
//----------------------------------------------------
What does 'BLACK_ORCA_MB_REV_D' means?
I remember the GPIO1-2 is used as I2C's SDA, conflict with UART2?

Thanks

Keywords:
Device:
MT_dialog
Offline
Last seen:2 months 4 weeks ago
Staff
加入:2015-06-08 11:34
Hi jamesleo-konka,

Hi jamesleo-konka,

The BLACK_ORCA_MB_REV_D is the revision of the hardware (the revision of the board supported by the SDK), the used pins at least on 1.0.8 are the first ones under the if condition, if you have defined the CFG_DEMO_AD_UART the unused pins should be grayed out, also you can ctrl + click on the dgconfigBLACK_ORCA_MB_REV and check the value of the definition.

Thanks MT_dialog

jamesleo-konka
Offline
Last seen:4 years 1 month ago
加入:2017-01-22 02:42
Hi Dialog,

Hi Dialog,
It's my fault that I think the debug 'printf' function use UART1 as other MCUs, but it use UART2 as default.
I can't find the code to use UART1, so I'm not sure which port/pins should be assigned to UART1.
In my project (based on hrp_sensor), I'll use UART2 for debug and UART1 as communication port with other device.

Pls send me a sample code to initialize the UART1's port/pins.

Thanks

MT_dialog
Offline
Last seen:2 months 4 weeks ago
Staff
加入:2015-06-08 11:34
Hi jamesleo-konka,

Hi jamesleo-konka,

The code to initialize UART is exactly the same APIs used for using the UART2 module, the initializing procedure is the same for UART and UART2, just configure your pins in the periph_init() function declaring the port and pins that you would like to use for the UART and the proper function for UART (HW_GPIO_FUNC_UART_RX and HW_GPIO_FUNC_UART_TX) and then you can use the adapter in order to initialize and start using the UART. An example is available in UM-B-044-DA1458x Software Platform Reference.pdf in paragraph 11.3.1.

Thanks MT_dialog

mahmed106
Offline
Last seen:2 months 1 week ago
加入:2019-05-03 17:28
Hi MT_Dialog you mentioned

Hi MT_Dialog you mentioned 'UM-B-044-DA1458x Software Platform Reference.pdf in paragraph 11.3.1." .. so is it DA-1458x or DA1468x, because i cannot find DA1458x document,,, please clarify.. i also want to use both Uarts but so far cannot able to do so. I am using Dialog ProDevKit, is there any example code that can help me in this regard. Thanks alot

PM_Dialog
Offline
Last seen:2 days 17 hours ago
Staff
加入:2018-02-08 11:03
Hi mahmed106,

Hi mahmed106,

请访问我们的新网站,支持下//www.wsdof.com/bluetooth-low-energylink and from “Product overview” drop down menu select “SmartBond™ DA14680 and DA14681” . Here you could find theUM-B-044 User Manual: DA1468x Software Platform Referencedocument.

Thanks, PM_Dialog