Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

User:Pau pajuelo

18 bytes added, 10:24, 8 August 2012
m
no edit summary
= What can I do =
 
== Handle the gpio-LED's ==
 
'''Basic '''
 
In this tutorial, we are going to use the '''4 LED's available in the board''', which probably is the most simple feature in the board, but sometimes you may want LED's to be a way of checking the status of some of your applications.
 
You can easily '''turn LED's on and off''' using the 'echo' instruction.
 
Log into IGEPv2 (for example via SSH, as shown in the previous chapter), and run the following commands to turn LED's on:
<pre>echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/brightness
echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\:red/brightness
echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:green/brightness
echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:red/brightness
</pre>
You can turn them down using the same command and write '0' instead of '1'.
 
<br> '''Know more '''
 
IGEPv2 LED's are controlled with it's platform device at /sys/devices/platform/leds-gpio/leds/
 
If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.<br>
 
To enable any of this modes you just have to change a parameter in the directory of the led you want to control. You can see all the possibilities using the instruction 'cat':<br>
<pre>$ cat /sys/devices/platform/leds-gpio/leds/d240\:green/trigger
 
[none] mmc0 mmc1 timer heartbeat default-on
</pre>
In the example above, we have checked the status of the trigger in led D240:green. Mode 'none' is selected.
 
To change it, for example, to the ''timer'' mode you can use 'echo':
<pre>echo timer &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/trigger
</pre>
In this case, we have set the trigger to the 'timer' mode. Now you can set the time for what the led is ON and the time it is OFF using:
<pre>echo 250 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/delay_on
echo 750 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/delay_off
</pre>
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF.
 
<br>
 
== Get sound in (audio in) ==
 
'''Basic '''
 
External Audio input devices, such as a powered microphone or the audio output of a PC or MP3 player, can be connected to the via a 3.5mm jack (Audio IN).
 
You can record audio in with the application Arecord, for example:
 
arecord -t wav -c 2 -r 44100 -f S16_LE -v audio-in.wav
 
Following output is expected on console:
 
Recording WAVE 'audio-in.wav'&nbsp;: Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Plug PCM: Hardware PCM card 0 'TWL4030' device 0 subdevice 0
Its setup is:
stream &nbsp;: CAPTURE
access &nbsp;: RW_INTERLEAVED
format &nbsp;: S16_LE
subformat &nbsp;: STD
channels &nbsp;: 2
rate &nbsp;: 44100
exact rate &nbsp;: 44100 (44100/1)
msbits &nbsp;: 16
buffer_size &nbsp;: 32768
period_size &nbsp;: 2048
period_time &nbsp;: 46439
tick_time &nbsp;: 7812
tstamp_mode &nbsp;: NONE
period_step &nbsp;: 1
sleep_min &nbsp;: 0
avail_min &nbsp;: 2048
xfer_align &nbsp;: 2048
start_threshold &nbsp;: 1
stop_threshold &nbsp;: 32768
silence_threshold: 0
silence_size&nbsp;: 0
boundary &nbsp;: 1073741824
 
When ever you think you want to stop recording just press CTRL+C
 
<br>
 
== Get sound out (audio out) ==
 
'''Basic '''
 
Connect an '''external output audio device''' to the 3.5mm jack Audio Out connector in IGEPv2, such as external stereo powered speakers.
 
The amplifiers for the headset output are disabled by default, so the first thing you'll do is enable these amplifiers with:
 
amixer set -D hw:0 'Headset' 0dB
amixer set -D hw:0 'HeadsetL Mixer AudioL2' on
amixer set -D hw:0 'HeadsetR Mixer AudioR2' on
 
Then you can easily play a *.wav sound with the application Aplay, for example:
 
aplay audio-in.wav
 
<br>
 
== Connect to the Serial Debug interface ==
 
'''Basic '''
 
[[Image:DSC 0177.JPG|thumb|right|550px]]
 
In the preinstalled software, the serial port is configured as a '''Debug interface'''.
 
Therefore, if you connect an external device to the serial port you will be able to see the '''Linux Kernel traces''', as the system boots.
 
<br> Follow these steps:
 
*Connect an '''AT/Everex Cable''' to the '''10-pin serial header''' on IGEPv2 and a '''[http://en.wikipedia.org/wiki/Null_modem null modem] DB9 male-male''' serial cable between the board and your host machine.
 
*Refer to the article: '''[[How to setup the IDC10 cable|How to setup the IDC10 cable]]''' to setup the IDC10 cable.
 
*You can also use a Serial port in your host machine you might need a '''USB to Serial converter''' to communicate via this port.
 
*Run a serial console, or any program that can interact with the serial port in your host machine, such Minicom, PuTTy (Linux, Windows), Terminal (Windows), etc.
 
*Refer to this extended article about '''[[Using serial debug port to communicate]]''' to setup the right configuration of your serial console.
 
<br> Now, as you are connected to the '''serial debug port''', you will see the system traces as the board is starting up.
 
Finally you will see the boot prompt asking for login.
 
<br> [[Image:Poky-prompt-screenshot.png|thumb|center|550px]]
 
== Add support for IGEPv2 EXPANSION ==
buddy=igep0022
<br>
== How to use Serial communication ==
*[[:Category:UART]]
<br>
== How to get VGA output ==
omapdss.def_disp=dvi omapfb.mode=dvi:1024x768-16@60
Note that you could connect both a VGA monitor and a DVI-D monitor and see the same image, as long as the video mode is compatible with both monitors.
== How to use TFT and Touchscreen ==
When you are ready to send your message use Ctrl+Z to send it.
If you want to cancel or restart the message press ESC.<br>
== How to use TVP5151 Video Decoder (update to kernel 37)<br> ==
If everything was fine you will see the live video at the screen.
[[Image:TVP5151 video decoder.jpg|frame|center|514x346px]]See also: [[How to setup tvp5151 video decoder]]<br>
== How to use EEPROM ==
i2cget -f -y 2 0x50 0x10
See also: i2dump(8), i2cget(8) and i2cset(8) man page
== How to use CAN bus ==
 
a
 
== Handle the gpio-LED's ==
 
'''Basic '''
 
In this tutorial, we are going to use the '''4 LED's available in the board''', which probably is the most simple feature in the board, but sometimes you may want LED's to be a way of checking the status of some of your applications.
 
You can easily '''turn LED's on and off''' using the 'echo' instruction.
 
Log into IGEPv2 (for example via SSH, as shown in the previous chapter), and run the following commands to turn LED's on:
<pre>echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/brightness
echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\:red/brightness
echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:green/brightness
echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:red/brightness
</pre>
You can turn them down using the same command and write '0' instead of '1'.
 
<br> '''Know more '''
 
IGEPv2 LED's are controlled with it's platform device at /sys/devices/platform/leds-gpio/leds/
 
If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.<br>
 
To enable any of this modes you just have to change a parameter in the directory of the led you want to control. You can see all the possibilities using the instruction 'cat':<br>
<pre>$ cat /sys/devices/platform/leds-gpio/leds/d240\:green/trigger
 
[none] mmc0 mmc1 timer heartbeat default-on
</pre>
In the example above, we have checked the status of the trigger in led D240:green. Mode 'none' is selected.
 
To change it, for example, to the ''timer'' mode you can use 'echo':
<pre>echo timer &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/trigger
</pre>
In this case, we have set the trigger to the 'timer' mode. Now you can set the time for what the led is ON and the time it is OFF using:
<pre>echo 250 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/delay_on
echo 750 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/delay_off
</pre>
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF.
 
<br>
 
== Get sound in (audio in) ==
 
'''Basic '''
 
External Audio input devices, such as a powered microphone or the audio output of a PC or MP3 player, can be connected to the via a 3.5mm jack (Audio IN).
 
You can record audio in with the application Arecord, for example:
 
arecord -t wav -c 2 -r 44100 -f S16_LE -v audio-in.wav
 
Following output is expected on console:
 
Recording WAVE 'audio-in.wav'&nbsp;: Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Plug PCM: Hardware PCM card 0 'TWL4030' device 0 subdevice 0
Its setup is:
stream &nbsp;: CAPTURE
access &nbsp;: RW_INTERLEAVED
format &nbsp;: S16_LE
subformat &nbsp;: STD
channels &nbsp;: 2
rate &nbsp;: 44100
exact rate &nbsp;: 44100 (44100/1)
msbits &nbsp;: 16
buffer_size &nbsp;: 32768
period_size &nbsp;: 2048
period_time &nbsp;: 46439
tick_time &nbsp;: 7812
tstamp_mode &nbsp;: NONE
period_step &nbsp;: 1
sleep_min &nbsp;: 0
avail_min &nbsp;: 2048
xfer_align &nbsp;: 2048
start_threshold &nbsp;: 1
stop_threshold &nbsp;: 32768
silence_threshold: 0
silence_size&nbsp;: 0
boundary &nbsp;: 1073741824
 
When ever you think you want to stop recording just press CTRL+C
 
<br>
 
== Get sound out (audio out) ==
 
'''Basic '''
 
Connect an '''external output audio device''' to the 3.5mm jack Audio Out connector in IGEPv2, such as external stereo powered speakers.
 
The amplifiers for the headset output are disabled by default, so the first thing you'll do is enable these amplifiers with:
 
amixer set -D hw:0 'Headset' 0dB
amixer set -D hw:0 'HeadsetL Mixer AudioL2' on
amixer set -D hw:0 'HeadsetR Mixer AudioR2' on
 
Then you can easily play a *.wav sound with the application Aplay, for example:
 
aplay audio-in.wav
 
<br>
 
== Connect to the Serial Debug interface ==
 
'''Basic '''
 
[[Image:DSC 0177.JPG|thumb|right|550px]]
 
In the preinstalled software, the serial port is configured as a '''Debug interface'''.
 
Therefore, if you connect an external device to the serial port you will be able to see the '''Linux Kernel traces''', as the system boots.
 
<br> Follow these steps:
 
*Connect an '''AT/Everex Cable''' to the '''10-pin serial header''' on IGEPv2 and a '''[http://en.wikipedia.org/wiki/Null_modem null modem] DB9 male-male''' serial cable between the board and your host machine.
 
*Refer to the article: '''[[How to setup the IDC10 cable|How to setup the IDC10 cable]]''' to setup the IDC10 cable.
 
*You can also use a Serial port in your host machine you might need a '''USB to Serial converter''' to communicate via this port.
 
*Run a serial console, or any program that can interact with the serial port in your host machine, such Minicom, PuTTy (Linux, Windows), Terminal (Windows), etc.
 
*Refer to this extended article about '''[[Using serial debug port to communicate]]''' to setup the right configuration of your serial console.
 
<br> Now, as you are connected to the '''serial debug port''', you will see the system traces as the board is starting up.
 
Finally you will see the boot prompt asking for login.
 
<br> [[Image:Poky-prompt-screenshot.png|thumb|center|550px]]
 
<br> a
{{#lst:How to use CAN bus|IGEPv2 EXPANSION}}
4,199
edits