I would like to interface an external sensor via uart. I am using the olimex bc66 dev kit, the one with the usb port.
I am using quecopen and can see uart debug via uart0 app_debug. So I thought perhaps I could use uart1 (debug uart)?
I tried to use the API ql_uart… But nothing is coming out of the pin (39) when viewed on a scope. I get no error returned from register or open api and sent bytes matches what id expected from ql_uart_write.
Please help!
Do I need to disable some default usage of these ports?
I noticed wizio seemed to access registers directly, is that before of an issue with the API? If so, where is this register details documented
I am using the UART_PORT1 succesfully, therefore it can de used. Please check this file: …/custom/config/custom_sys_cfg.h. debugPortCfg has to be set in BASIC_MODE:
…
static const ST_DebugPortCfg debugPortCfg = {
BASIC_MODE // Set the serial port to a common serial port
//ADVANCE_MODE // Set the serial port to a special debug port
};
…
Then you have to resgister and open the UART in the main.c:
…
/* Register UART port for reading data /
ret = Ql_UART_Register(UART_PORT1, CallBack_UART_Hdlr, NULL);
if (ret != QL_RET_OK) {
Ql_Debug_Trace("[ERROR] Fail to Ql_UART_Register port[%d]: %d\r\n", UART_PORT1, ret);
}
/ Open UART port for reading data */
ret = Ql_UART_Open(UART_PORT1, 115200, FC_NONE);
if (ret != QL_RET_OK) {
APP_DEBUG("[ERROR] Fail to Ql_UART_Open port[%d]: %d\r\n", UART_PORT1, ret);
} else {
APP_DEBUG("[INFO] UART Port %d open for reading data\r\n", UART_PORT1);
}
…
And then, you have to define your callback: CallBack_UART_Hdlr.
Yes, I am using two uarts at the same time, but only for reading. I dind’t have to use the function Ql_UART_Write. => I am sorry, I was wrong. I am using one only for reading and the other one only for writing.