- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm using a custom board BCM20736S.
I use the UART (P32, P35) to communicate with a computer. This work fine with no problem.
But now, I would like to use an UART - RS485 convert to communicate in RS485. So I need to set and clear two IO for receive and transmit data (/RE and DE IO of a ST4385EDC for example). I have try with this code (with and without delay):
gpio_setPinOutput(GPIO_DE_RS485 / 16, GPIO_DE_RS485 % 16, CS_ASSERT);
gpio_setPinOutput(GPIO_RE_RS485 / 16, GPIO_RE_RS485 % 16, CS_ASSERT);
//bleapputils_delayUs(1000000);
puart_write('0');
puart_write('1');
puart_write('2');
puart_write('3');
//bleapputils_delayUs(1000000);
gpio_setPinOutput(GPIO_DE_RS485 / 16, GPIO_DE_RS485 % 16, CS_DEASSERT);
gpio_setPinOutput(GPIO_RE_RS485 / 16, GPIO_RE_RS485 % 16, CS_DEASSERT);
But my computer not receive the data....I think the write uart function is not executed in time...
Do you have a solution for my problem?
Thanks in advance
J.A
Solved! Go to Solution.
- Labels:
-
GPIO
-
Peripherhal UART
- Tags:
- 20736s
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
solved!
I use static void puart_control_tx_callback(void* unused) and I do:
gpio_setPinOutput(GPIO_DE_RS485 / 16, GPIO_DE_RS485 % 16, CS_DEASSERT);
gpio_setPinOutput(GPIO_RE_RS485 / 16, GPIO_RE_RS485 % 16, CS_DEASSERT);
in the callback function when all data are sent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
solved!
I use static void puart_control_tx_callback(void* unused) and I do:
gpio_setPinOutput(GPIO_DE_RS485 / 16, GPIO_DE_RS485 % 16, CS_DEASSERT);
gpio_setPinOutput(GPIO_RE_RS485 / 16, GPIO_RE_RS485 % 16, CS_DEASSERT);
in the callback function when all data are sent.