Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

User:Pau pajuelo

20 bytes added, 18:42, 22 August 2012
m
no edit summary
[[Category:GPIO]]
=How to use UARTs(update it)<br> = == Overview ==
This How-To is meant to be a starting point for people to learn use UART for IGEPv2 devices as quickly and easily as possible. In this how-to, we use [http://releases.linaro.org/platform/linaro-m/headless/final/linaro-m-headless-tar-20101108-2.tar.gz Linaro Headless] with [[Linux Kernel 2.6.35.y|Kernel 2.6.35.y]] and [http://labs.isee.biz/images/e/ee/Uart-test-beta2.tar.bz2 UART test program]
Type something in one terminal.
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| style="text-align: left;" | [[Image:Minicom screenshot.png|640x400px]]
=== RS232 Schematic Igep V2 ===
{| align="center" cellspacing="1" cellpadding="1" border="1" align="center"
|-
| [[Image:RS232 Schematic Igep V2.png|800x531px]]
=== Uart Schematic Igep Module ===
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart Schematic Igep Module.png|581x600px]]
Decoded with [http://www.asciitable.com/ ASCII table].
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart decode1withlf.JPG|350x230px]]
Program sends information via UART1 but don't receive response via UART3, because only a process is executed. This problem is repeated every 5 seconds (constant WAIT=5) until other process sends information via UART3 at the same speed. If "select" hasn't been implemented, process would have stayed blocked.<br>
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart select timeout9.JPG|350x230px]]
More information [http://en.wikipedia.org/wiki/RS-232#Standard_details here].
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart voltageparams8.JPG|350x230px]]
Note that wave is degraded when speed is higher
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart 300 o.JPG|260x172px]]
You can see that RS232 have some lag between transmisions. This caused mainly by kernel process management. UART peripheral is controlled by Linux and It isn't a [http://en.wikipedia.org/wiki/Real-time_operating_system real-time operating system].&nbsp;
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart lag left6.JPG|350x230px]]
This program have three I/O functions that connect to UART driver via ioctl: (read(), write() and select()). 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>
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart select5.JPG|260x172px]]
Every full process the number is increased twice. Program checks that this condicion is true, if it isn't accomplished, process will be finish.
{| align="center" cellspacing="1" cellpadding="1" width="200" border="1" alignwidth="center200"
|-
| [[Image:Uart error test2.png|640x400px]]
4,199
edits