Changes

How to use UARTs

816 bytes added, 13:32, 20 January 2012
no edit summary
As explained above, the program uses GPIO for debug option via oscilloscope, it is necessary install user-gpio-drv.ko driver inside Linux Kernel, more information [[How to use GPIOs|here]] .
There are some things that is interesting configure, before compiling the program. Open it, seek next lines:
<pre>//Define Array char size
#define SIZE 30
//Define Debug mode:0==Disable
#define DEBUG 0
//Define wait select
#define WAIT 5
Once you have installed module. Compile program using your Cross Compiler, I //Set GPIO Debugger port//Be sure that mux is correctly configured and GPIOs are not used arm-linux-gnueabi-#define GPIO1 136#define GPIO2 137 </pre> Constant SIZE:it determine the max number of char than can be sent<br>
Constant DEBUG: it can break program infinite loop part, it can be useful to debug some errors, 0 like infinite loop or positive number determine loop max entrances<br>
 
Constant WAIT: configure select max time.
 
Constants GPIO1 and GPIO2: they configure GPIOs used for debug via oscilloscope. Take care to configure mux and don't use this GPIO for other purposes<br>
 
Once you have installed module. Compile program using your Cross Compiler, I used arm-linux-gnueabi-:
<pre>arm-linux-gnueabi-gcc uart-test-beta1.c -o uart-test-beta1 </pre>
4,199
edits