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
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
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
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
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
Hi mahmed106,
请访问我们的新网站,支持下//www.xmece.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