Changes

How to use UARTs

2 bytes added, 20:32, 22 January 2012
no edit summary
Click to enlarge image
This program have three I/O functions that connect to UART driver via ioctl: (read(), write() and select()), but . But select() and write() change process stat to sleep mode until system don't receive or transmit all information via UART. "select" function is used to prevent that read function can be blocked when data aren't available. <br>The next images (program with debug_gpio enabled and 300 bauds speed) show when process is executed or is waiting. Blue=UART1, Violet="write" and Green="select". When GPIO has HIGH value, process is blocked.<br>
{| width="200" cellspacing="1" cellpadding="1" border="1" align="center"
Click to enlarge image<br>
In this case:
select: blocked until all data is available (LF char received).
write: blocked until all data is send to UART buffer.
4,199
edits