https://elinux.org/api.php?action=feedcontributions&user=Larmorgs&feedformat=atomeLinux.org - User contributions [en]2024-03-19T02:44:58ZUser contributionsMediaWiki 1.31.0https://elinux.org/index.php?title=ECE497_SPI_Project&diff=257126ECE497 SPI Project2013-05-27T01:23:16Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497Fall2012 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmorgs/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/drivers/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_scl'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code></b>. Buffering problems can cause the kernel to seg fault or crash completely (see Future Work).<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
{{#ev:youtube|8d9n5QUyH38}}<br />
<br />
The program shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
=== Sean Richardson ===<br />
* Researched using SPI on the BeagleBone<br />
* Debugged the LED strand (the first one we received was broken)<br />
* Wrote code to interface with the strand using spidev<br />
* Helped integrate the SPI interface into the sysfs driver<br />
<br />
=== Greg Larmore ===<br />
* Researched kernel drivers and sysfs<br />
* Helped debug the LED strand<br />
* Wrote example sysfs driver<br />
* Integrated the SPI interface into the sysfs driver<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=257120ECE497 SPI Project2013-05-27T01:23:03Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497Fall2012 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmoreg/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/drivers/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_scl'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code></b>. Buffering problems can cause the kernel to seg fault or crash completely (see Future Work).<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
{{#ev:youtube|8d9n5QUyH38}}<br />
<br />
The program shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
=== Sean Richardson ===<br />
* Researched using SPI on the BeagleBone<br />
* Debugged the LED strand (the first one we received was broken)<br />
* Wrote code to interface with the strand using spidev<br />
* Helped integrate the SPI interface into the sysfs driver<br />
<br />
=== Greg Larmore ===<br />
* Researched kernel drivers and sysfs<br />
* Helped debug the LED strand<br />
* Wrote example sysfs driver<br />
* Integrated the SPI interface into the sysfs driver<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Contributions_and_Project_Status_here&diff=257114ECE497 Contributions and Project Status here2013-05-27T01:22:46Z<p>Larmorgs: </p>
<hr />
<div>{|<br />
|- <br />
! Name<br />
! git repository<br />
|-<br />
| [[User:hansenrl | Ross Hansen]]<br />
| [https://github.com/hansenrl/ece497.git MiniProject01]<br />
|-<br />
| [[User:atniptw | Tom Atnip]]<br />
| [https://github.com/atniptw/ECE497 ECE497_Repo]<br />
|-<br />
| [[User:larmorgs | Greg Larmore]]<br />
| [https://github.com/larmorgs/ECE497 ECE497_Repo]<br />
|-<br />
| [[User:jessebrannon | Jesse Brannon]]<br />
| [https://github.com/brannojs/ece497 ECE497_Repo]<br />
|-<br />
|| [[User:duganje | Josh Dugan]]<br />
| [https://github.com/duganje/ECE497_duganje ECE497_duganje]<br />
|-<br />
| [[User:popenhjc | James Popenhagen]]<br />
|[https://github.com/popenhjc/popenhjc_ECE497 MiniProject01]<br />
|-<br />
| [[User:jungeml | Mike Junge]]<br />
| [https://github.com/jungeml MiniProject01]<br />
|-<br />
| [[User:mmoravec | Matthew Moravec]]<br />
| [https://github.com/mmoravec ECE497_moravec]<br />
|-<br />
| [[User:shinnsm|Stephen Shinn]]<br />
| [https://github.com/shinnsm/ECE497 ECE497 Repo]<br />
|-<br />
| [[User:millerap|Andrew Miller]]<br />
| [https://github.com/millerap/MiniProject01 MiniProject01]<br />
|-<br />
| [[User:Richarsm|Sean Richardson]]<br />
| [https://github.com/seanrich/MiniProject01 MiniProject01]<br />
|}</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_MPlayer_and_Dvb-apps&diff=255818ECE497 Notes on MPlayer and Dvb-apps2013-05-23T00:58:20Z<p>Larmorgs: Created page with "MP [http://www.linuxtv.org/wiki/index.php/MPlayer MPlayer] can be used in conjunction with [http://www.linuxtv.org/wiki/index.php/LinuxTV_dvb-apps D..."</p>
<hr />
<div>[[Category:ECE497Notes |MP]]<br />
<br />
[http://www.linuxtv.org/wiki/index.php/MPlayer MPlayer] can be used in conjunction with [http://www.linuxtv.org/wiki/index.php/LinuxTV_dvb-apps Dvb-apps] to create a video recording and playback system in embedded linux. Add on to this combination a software defined ATSC radio such as the [http://www.hauppage.com/site/products/data_hvr950q.html Hauppauge WinTV-HVR-950Q] and digital/analog TV signals (both antenna and cable) can be decoded and recorded.<br />
<br />
== Installation ==<br />
<br />
The 3.8.6 kernel comes with it the kernel modules necessary for the [http://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-950Q WinTV-HVR-950Q]. For completeness they are listed below<br />
<br />
xc5000<br />
au8522<br />
au0828<br />
<br />
Also required for this hardware to function is the firmware file from [http://www.kernellabs.com/ Kernel Labs]. It can be added by running the following as root:<br />
<br />
wget http://www.kernellabs.com/firmware/xc5000/dvb-fe-xc5000c-4.1.30.7.fw<br />
mv dvb-fe-xc5000c-4.1.30.7.fw /lib/firmware/<br />
<br />
Lastly, we need the to install the Dvb-apps. To do this run the following as root:<br />
<br />
opkg install dvb-apps<br />
<br />
=== How to Run ===<br />
<br />
To find cable TV channels run the following:<br />
<br />
scan -t 1 -A 2 -U /usr/share/dvb/atsc/us-Cable-Standard-center-frequencies-QAM256 > ~/Desktop/channels.conf<br />
<br />
After this is done you can open the channels.conf file to view the channel names. There are a few ways of tuning to these channels. A simple way is shown below:<br />
<br />
azap -r -c ~/Desktop/channels.conf "MyFOX10 HD"<br />
<br />
Now once the radio is tuned you will see something like: <br />
<br />
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'<br />
tuning to 207000000 Hz<br />
video pid 0x0041, audio pid 0x0044<br />
status 00 | signal 3999 | snr cd37 | ber 00000000 | unc 00000000 |<br />
status 1f | signal cb84 | snr f8cf | ber 00000000 | unc 00000000 | FE_HAS_LOCK<br />
status 1f | signal cb84 | snr f8b3 | ber 00000000 | unc 00000000 | FE_HAS_LOCK<br />
<br />
Once you see FE_HAS_LOCK you can run the following to watch the tuned channel:<br />
<br />
mplayer -framedrop /dev/dvb/adapter0/dvr0<br />
<br />
== Future Work ==<br />
<br />
See if the playback can be optimized for a small system with limited resources like the BeagleBone.</div>Larmorgshttps://elinux.org/index.php?title=User:Larmorgs&diff=255812User:Larmorgs2013-05-22T23:55:55Z<p>Larmorgs: /* How To */</p>
<hr />
<div>Greg Larmore<br />
<br />
Electrical Engineering Major, Class of 2013.<br />
<br />
== Projects ==<br />
Project topics I'm interested in:<br />
* Compressive sensing and other DSP topics<br />
* Cryptography<br />
* Software defined radio applications<br />
* Discrete time control systems applications<br />
<br />
== Mini-projects == <br />
* [[Adafruit: 16x24 Red LED Matrix Panel]]<br />
<br />
== Project ==<br />
* [[ECE497 SPI Project]]<br />
<br />
== How To ==<br />
* [[ECE497 Notes on Rakarrack]]<br />
* [[ECE497 Notes on Rtlizer]]<br />
* [[ECE497 Notes on BeagleStache]]<br />
* [[ECE497 Notes on MPlayer and Dvb-apps]] <br />
<br />
[[Category:ECE497Fall2012 |Ul]]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_BeagleStache&diff=247172ECE497 Notes on BeagleStache2013-04-30T01:56:14Z<p>Larmorgs: Created page with "Notes [http://beagleboard.org/project/stache BeagleStache] is a fun demo using [http://opencv.willowgarage.com/wiki/ OpenCV] to detect faces and give the..."</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://beagleboard.org/project/stache BeagleStache] is a fun demo using [http://opencv.willowgarage.com/wiki/ OpenCV] to detect faces and give them a nice mustache.<br />
<br />
== Installation ==<br />
<br />
Instructions for installing BeagleStache can be found at the link [http://beagleboard.org/project/stache above]. They are copied here for convenience.<br />
<br />
Run the following as root on the BeagleBone:<br />
<br />
git clone git://github.com/jadonk/stache<br />
cd stache<br />
make && make install<br />
<br />
Now this will install a desktop icon called 'stache.desktop' that runs the shell script '~/stache/runstache'. By default this script will run the Twitter version that requires a Twitter account to be set up. I modified it to bypass that as below:<br />
<br />
#!/bin/sh<br />
cd $HOME/stache<br />
./stache<br />
<br />
=== How to Run ===<br />
<br />
Double click the desktop icon. If you encounter problems, you can make the following modifications to help debugging. In '~/stache/runstache' append a the line '$SHELL'. And in 'stache.desktop' set 'Terminal=true'<br />
<br />
== Conclusion ==<br />
<br />
This fun little demo highlights the power of the BeagleBone to do real time video processing.</div>Larmorgshttps://elinux.org/index.php?title=User:Larmorgs&diff=247166User:Larmorgs2013-04-30T01:41:37Z<p>Larmorgs: /* How To */</p>
<hr />
<div>Greg Larmore<br />
<br />
Electrical Engineering Major, Class of 2013.<br />
<br />
== Projects ==<br />
Project topics I'm interested in:<br />
* Compressive sensing and other DSP topics<br />
* Cryptography<br />
* Software defined radio applications<br />
* Discrete time control systems applications<br />
<br />
== Mini-projects == <br />
* [[Adafruit: 16x24 Red LED Matrix Panel]]<br />
<br />
== Project ==<br />
* [[ECE497 SPI Project]]<br />
<br />
== How To ==<br />
* [[ECE497 Notes on Rakarrack]]<br />
* [[ECE497 Notes on Rtlizer]]<br />
* [[ECE497 Notes on BeagleStache]]<br />
<br />
[[Category:ECE497 |Ul]]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rtlizer&diff=246950ECE497 Notes on Rtlizer2013-04-29T03:18:24Z<p>Larmorgs: /* Installation */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[https://github.com/csete/rtlizer Rtlizer] is a simple spectrum analyzer written for the BeagleBone. Rtlizer uses [http://www.rtlsdr.org/ rtl-sdr] a command line tool to interface with software defined radios such as the [http://www.nooelec.com/store/software-defined-radio/sdr-receivers/tv28tv2.html#.UU5gGXGx0ak R820T] used here.<br />
<br />
== Installation ==<br />
<br />
Instructions for installing rtl-sdr and rtlizer can be found [http://www.oz9aec.net/index.php/beaglebone/480-rtlizer here]. They are copied here for convenience.<br />
<br />
Run the following as root on the BeagleBone:<br />
<br />
git clone git://git.osmocom.org/rtl-sdr.git<br />
cd rtl-sdr/<br />
autoreconf -i<br />
./configure<br />
make<br />
make install<br />
mv /usr/local/lib/pkgconfig/librtlsdr.pc /usr/lib/pkgconfig<br />
ldconfig<br />
<br />
git clone git://github.com/csete/rtlizer.git<br />
cd rtlizer<br />
./build-target<br />
<br />
=== How to Run ===<br />
<br />
In X11 run the following:<br />
<br />
cd rtlizer<br />
rtlizer 640x360+0+0<br />
<br />
== Conclusion ==<br />
<br />
[http://osmocom.rtlsdr.org//trac/wiki/rtl-sdr This site] contains more information about rtl-sdr including a long list of SDR applications that use the library.<br />
<br />
The R820T is a very nice (and cheap) SDR with some nice functionality. One thing that it cannot do however (at least in the US) is function as a TV tuner. The tuner uses the DVB-T standard. ATSC is the standard used for digital TV broadcasting in the US.<br />
<br />
== Future Work ==<br />
<br />
It would be interesting to do some radio decoding on the BeagleBone using rtl-sdr as a back-end to the R820T. A possible application could be something like ADS-B (aircraft tracking) or NOAA (weather satellite) decoding.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rtlizer&diff=246944ECE497 Notes on Rtlizer2013-04-29T02:46:29Z<p>Larmorgs: /* Installation */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[https://github.com/csete/rtlizer Rtlizer] is a simple spectrum analyzer written for the BeagleBone. Rtlizer uses [http://www.rtlsdr.org/ rtl-sdr] a command line tool to interface with software defined radios such as the [http://www.nooelec.com/store/software-defined-radio/sdr-receivers/tv28tv2.html#.UU5gGXGx0ak R820T] used here.<br />
<br />
== Installation ==<br />
<br />
Instructions for installing rtl-sdr and rtlizer can be found [http://www.oz9aec.net/index.php/beaglebone/480-rtlizer here]. They are copied here for convenience.<br />
<br />
Run the following as root on the BeagleBone:<br />
<br />
git clone git://git.osmocom.org/rtl-sdr.git<br />
cd rtl-sdr/<br />
autoreconf -i<br />
./configure<br />
make<br />
make install<br />
ldconfig<br />
<br />
git clone git://github.com/csete/rtlizer.git<br />
cd rtlizer<br />
./build-target<br />
<br />
=== How to Run ===<br />
<br />
In X11 run the following:<br />
<br />
cd rtlizer<br />
rtlizer 640x360+0+0<br />
<br />
== Conclusion ==<br />
<br />
[http://osmocom.rtlsdr.org//trac/wiki/rtl-sdr This site] contains more information about rtl-sdr including a long list of SDR applications that use the library.<br />
<br />
The R820T is a very nice (and cheap) SDR with some nice functionality. One thing that it cannot do however (at least in the US) is function as a TV tuner. The tuner uses the DVB-T standard. ATSC is the standard used for digital TV broadcasting in the US.<br />
<br />
== Future Work ==<br />
<br />
It would be interesting to do some radio decoding on the BeagleBone using rtl-sdr as a back-end to the R820T. A possible application could be something like ADS-B (aircraft tracking) or NOAA (weather satellite) decoding.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rtlizer&diff=246938ECE497 Notes on Rtlizer2013-04-29T02:40:16Z<p>Larmorgs: /* Installation */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[https://github.com/csete/rtlizer Rtlizer] is a simple spectrum analyzer written for the BeagleBone. Rtlizer uses [http://www.rtlsdr.org/ rtl-sdr] a command line tool to interface with software defined radios such as the [http://www.nooelec.com/store/software-defined-radio/sdr-receivers/tv28tv2.html#.UU5gGXGx0ak R820T] used here.<br />
<br />
== Installation ==<br />
<br />
Instructions for installing rtl-sdr and rtlizer can be found [http://www.oz9aec.net/index.php/beaglebone/480-rtlizer here]. They are copied here for convenience.<br />
<br />
Run the following on the BeagleBone:<br />
<br />
git clone git://git.osmocom.org/rtl-sdr.git<br />
cd rtl-sdr/<br />
autoreconf -i<br />
./configure<br />
make<br />
make install<br />
ldconfig<br />
<br />
git clone git://github.com/csete/rtlizer.git<br />
cd rtlizer<br />
./build-target<br />
<br />
=== How to Run ===<br />
<br />
In X11 run the following:<br />
<br />
cd rtlizer<br />
rtlizer 640x360+0+0<br />
<br />
== Conclusion ==<br />
<br />
[http://osmocom.rtlsdr.org//trac/wiki/rtl-sdr This site] contains more information about rtl-sdr including a long list of SDR applications that use the library.<br />
<br />
The R820T is a very nice (and cheap) SDR with some nice functionality. One thing that it cannot do however (at least in the US) is function as a TV tuner. The tuner uses the DVB-T standard. ATSC is the standard used for digital TV broadcasting in the US.<br />
<br />
== Future Work ==<br />
<br />
It would be interesting to do some radio decoding on the BeagleBone using rtl-sdr as a back-end to the R820T. A possible application could be something like ADS-B (aircraft tracking) or NOAA (weather satellite) decoding.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rtlizer&diff=233822ECE497 Notes on Rtlizer2013-03-24T02:43:10Z<p>Larmorgs: Created page with "Notes [https://github.com/csete/rtlizer Rtlizer] is a simple spectrum analyzer written for the BeagleBone. Rtlizer uses [http://www.rtlsdr.org/ rtl-sdr] ..."</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[https://github.com/csete/rtlizer Rtlizer] is a simple spectrum analyzer written for the BeagleBone. Rtlizer uses [http://www.rtlsdr.org/ rtl-sdr] a command line tool to interface with software defined radios such as the [http://www.nooelec.com/store/software-defined-radio/sdr-receivers/tv28tv2.html#.UU5gGXGx0ak R820T] used here.<br />
<br />
== Installation ==<br />
<br />
Instructions for installing rtl-sdr and rtlizer can be found [http://www.oz9aec.net/index.php/beaglebone/480-rtlizer here]. They are copied here for convenience.<br />
<br />
Run the following on the BeagleBone:<br />
<br />
git clone git://git.osmocom.org/rtl-sdr.git<br />
cd rtl-sdr/<br />
autoreconf -i<br />
./configure<br />
make<br />
make install<br />
ldconfig<br />
<br />
git clone https://github.com/csete/rtlizer.git<br />
cd rtlizer<br />
./build-target<br />
<br />
=== How to Run ===<br />
<br />
In X11 run the following:<br />
<br />
cd rtlizer<br />
rtlizer 640x360+0+0<br />
<br />
== Conclusion ==<br />
<br />
[http://osmocom.rtlsdr.org//trac/wiki/rtl-sdr This site] contains more information about rtl-sdr including a long list of SDR applications that use the library.<br />
<br />
The R820T is a very nice (and cheap) SDR with some nice functionality. One thing that it cannot do however (at least in the US) is function as a TV tuner. The tuner uses the DVB-T standard. ATSC is the standard used for digital TV broadcasting in the US.<br />
<br />
== Future Work ==<br />
<br />
It would be interesting to do some radio decoding on the BeagleBone using rtl-sdr as a back-end to the R820T. A possible application could be something like ADS-B (aircraft tracking) or NOAA (weather satellite) decoding.</div>Larmorgshttps://elinux.org/index.php?title=User:Larmorgs&diff=233816User:Larmorgs2013-03-24T01:49:23Z<p>Larmorgs: /* How To */</p>
<hr />
<div>Greg Larmore<br />
<br />
Electrical Engineering Major, Class of 2013.<br />
<br />
== Projects ==<br />
Project topics I'm interested in:<br />
* Compressive sensing and other DSP topics<br />
* Cryptography<br />
* Software defined radio applications<br />
* Discrete time control systems applications<br />
<br />
== Mini-projects == <br />
* [[Adafruit: 16x24 Red LED Matrix Panel]]<br />
<br />
== Project ==<br />
* [[ECE497 SPI Project]]<br />
<br />
== How To ==<br />
* [[ECE497 Notes on Rakarrack]]<br />
* [[ECE497 Notes on Rtlizer]]<br />
<br />
[[Category:ECE497 |Ul]]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223142ECE497 Notes on Rakarrack2013-02-23T06:20:22Z<p>Larmorgs: /* Conclusion */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
Run `sudo apt-get update` and `sudo apt-get upgrade` until there are no more updates/upgrades to install.<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
*Note: The BeagleBone needs to be running off the wall adapter to reach maximum clock rate<br />
<br />
=== JACK ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'. We could get a little more performance out of 'Zero Order', but this sampling does not interpolate so the quality isn't great.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just too computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note: On multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223136ECE497 Notes on Rakarrack2013-02-23T06:18:55Z<p>Larmorgs: /* Rakarrack */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
Run `sudo apt-get update` and `sudo apt-get upgrade` until there are no more updates/upgrades to install.<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
*Note: The BeagleBone needs to be running off the wall adapter to reach maximum clock rate<br />
<br />
=== JACK ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'. We could get a little more performance out of 'Zero Order', but this sampling does not interpolate so the quality isn't great.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note: On multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223130ECE497 Notes on Rakarrack2013-02-23T06:16:03Z<p>Larmorgs: /* System Configuration */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
Run `sudo apt-get update` and `sudo apt-get upgrade` until there are no more updates/upgrades to install.<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
*Note: The BeagleBone needs to be running off the wall adapter to reach maximum clock rate<br />
<br />
=== JACK ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note: On multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223124ECE497 Notes on Rakarrack2013-02-23T06:14:45Z<p>Larmorgs: /* Ubuntu Installation */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
Run `sudo apt-get update` and `sudo apt-get upgrade` until there are no more updates/upgrades to install.<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
=== JACK ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note: On multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223118ECE497 Notes on Rakarrack2013-02-23T06:13:52Z<p>Larmorgs: /* Ubuntu Installation */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
=== JACK ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note: On multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223112ECE497 Notes on Rakarrack2013-02-23T06:12:51Z<p>Larmorgs: /* System Configuration */</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
=== JACK ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note: On multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223106ECE497 Notes on Rakarrack2013-02-23T06:12:22Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
=== JACK Configuration ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack Configuration ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note: On multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223100ECE497 Notes on Rakarrack2013-02-23T06:11:39Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
=== JACK Configuration ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack Configuration ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note that this version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note on multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223094ECE497 Notes on Rakarrack2013-02-23T06:11:08Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. <br />
<br />
Rakarrack can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
=== JACK Configuration ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
=== Rakarrack Configuration ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note that this version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note on multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Kinect&diff=223088ECE497 Notes on Kinect2013-02-23T06:09:36Z<p>Larmorgs: Undo revision 223058 by Larmorgs (talk)</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
{{YoderHead}}<br />
<br />
[http://www.xbox.com/en-US/kinect Microsoft's Kinect] sensor has created great interest in the Beagle Community.<br />
<br />
Here are notes on installing the third party drivers from [http://www.omekinteractive.com/ Omek].<br />
<br />
== Downloading ==<br />
<br />
I got the 4 files from [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/19/7/beagleboard-xm-installation-and-documentation here]. Here's the files I have<br />
<br />
host$ '''ls -sh'''<br />
<pre><br />
total 65M<br />
4.0K beagle-omek<br />
54M beckon-image-2.4.16175.tar.gz<br />
4.0K Beckon-SDK-2.4.16236<br />
11M beckon-sdk-2.4.16236.tar.gz<br />
4.0K create_sd.txt<br />
4.0K mkcard.sh<br />
1.1M omek beckon sdk, ti dm3730 edition -- developer guide.pdf<br />
4.0K readme<br />
4.0K UsersGuide<br />
</pre><br />
<br />
== Installing ==<br />
<br />
I'm getting this error.<br />
<br />
host$ '''sudo bash mkcard.sh /dev/mmcblk0 beagle-omek/'''<br />
<pre><br />
Using image beagle-omek/<br />
using device /dev/mmcblk0<br />
.<br />
You are about to totaly erase the device, are you sure (yes/no) ?yes<br />
1024+0 records in<br />
1024+0 records out<br />
1048576 bytes (1.0 MB) copied, 0.382056 s, 2.7 MB/s<br />
Disk /dev/mmcblk0 doesn't contain a valid partition table<br />
DISK SIZE - 8010072064 bytes<br />
CYLINDERS - 973<br />
Checking that no-one is using this disk right now ...<br />
OK<br />
<br />
Disk /dev/mmcblk0: 973 cylinders, 255 heads, 63 sectors/track<br />
<br />
sfdisk: ERROR: sector 0 does not have an msdos signature<br />
/dev/mmcblk0: unrecognized partition table type<br />
Old situation:<br />
No partitions found<br />
New situation:<br />
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0<br />
<br />
Device Boot Start End #cyls #blocks Id System<br />
/dev/mmcblk0p1 * 0+ 8 9- 72261 c W95 FAT32 (LBA)<br />
/dev/mmcblk0p2 9 972 964 7743330 83 Linux<br />
/dev/mmcblk0p3 0 - 0 0 0 Empty<br />
/dev/mmcblk0p4 0 - 0 0 0 Empty<br />
Successfully wrote the new partition table<br />
<br />
Re-reading the partition table ...<br />
<br />
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)<br />
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1<br />
(See fdisk(8).)<br />
done partitioning.<br />
Cant find boot partition /dev/mmcblk01<br />
Cant find rootfs partition in /dev/mmcblk02<br />
mount: special device /dev/mmcblk01 does not exist<br />
</pre><br />
Failed to mount /dev/mmcblk0'''1'''.<br />
<br />
The problem is it's looking for /dev/mmcblk0'''1''' and on my Ubuntu 10.4 it appears at /dev/mmcblk0'''p1'''.<br />
<br />
I modified '''mkcard.sh''' to add the '''p''' and after a little fussing it worked!<br />
<br />
== Running ==<br />
<br />
It booted up and runs fine. There is no X windows, rather the one demo uses QT embedded. QT embedded writes straight to the framebuffer and doesn't need X.<br />
<br />
== Porting ==<br />
<br />
I'm now in the process of seeing if I can copy the demos over to an SD card that I've been doing other development on. My SD isn't set up for QT embedded, so I'm trying:<br />
<br />
beagle$ '''opkg update'''<br />
beagle$ '''opgk install qt4-embedded-tools''' # 5 minutes<br />
beagle$ '''opgk install qt4-embedded-static''' # 2.5 minutes<br />
beagle$ '''opgk install qt4-embedded-fonts''' # 2.5 minutes<br />
<br />
These times running on a rather slow network at home. I don't know if the 'static' needs to be installed.<br />
<br />
Next I went to the SD that was working with the Kinect and copied /usr/lib/libOpenNI.* to /usr/lib on the target SD card. I now get the following error.<br />
<br />
beagle$ '''./QtTracking -qws'''<br />
Error creating sensor.<br />
Failed to initialize tracking !<br />
<br />
I'm guess I don't have the DSP stuff setup right.<br />
<br />
[http://youngindiafellowship.academia.edu/JatinSharma/Blog/48864/OpenNI-on-Beagle-Board-XM This] might help with the openNI port.<br />
<br />
{{YoderFoot}}</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Kinect&diff=223082ECE497 Notes on Kinect2013-02-23T06:09:25Z<p>Larmorgs: Undo revision 223064 by Larmorgs (talk)</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
{{YoderHead}}<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. <br />
<br />
Rakarrack can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
<br />
=== JACK Configuration ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
<br />
=== Rakarrack Configuration ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note that this version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note on multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223076ECE497 Notes on Rakarrack2013-02-23T06:07:47Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. <br />
<br />
Rakarrack can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
<br />
=== JACK Configuration ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
<br />
=== Rakarrack Configuration ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note that this version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note on multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Rakarrack&diff=223070ECE497 Notes on Rakarrack2013-02-23T06:07:28Z<p>Larmorgs: Created page with "Notes {{YoderHead}} [http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. Rakar..."</p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
{{YoderHead}}<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. <br />
<br />
Rakarrack can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
<br />
=== JACK Configuration ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
<br />
=== Rakarrack Configuration ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note that this version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note on multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Kinect&diff=223064ECE497 Notes on Kinect2013-02-23T06:06:58Z<p>Larmorgs: oops</p>
<hr />
<div><br />
<br />
[[Category:ECE497 |Notes]]<br />
<br />
[http://www.xbox.com/en-US/kinect Microsoft's Kinect] sensor has created great interest in the Beagle Community.<br />
<br />
Here are notes on installing the third party drivers from [http://www.omekinteractive.com/ Omek].<br />
<br />
== Downloading ==<br />
<br />
I got the 4 files from [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/19/7/beagleboard-xm-installation-and-documentation here]. Here's the files I have<br />
<br />
host$ '''ls -sh'''<br />
<pre><br />
total 65M<br />
4.0K beagle-omek<br />
54M beckon-image-2.4.16175.tar.gz<br />
4.0K Beckon-SDK-2.4.16236<br />
11M beckon-sdk-2.4.16236.tar.gz<br />
4.0K create_sd.txt<br />
4.0K mkcard.sh<br />
1.1M omek beckon sdk, ti dm3730 edition -- developer guide.pdf<br />
4.0K readme<br />
4.0K UsersGuide<br />
</pre><br />
<br />
== Installing ==<br />
<br />
I'm getting this error.<br />
<br />
host$ '''sudo bash mkcard.sh /dev/mmcblk0 beagle-omek/'''<br />
<pre><br />
Using image beagle-omek/<br />
using device /dev/mmcblk0<br />
.<br />
You are about to totaly erase the device, are you sure (yes/no) ?yes<br />
1024+0 records in<br />
1024+0 records out<br />
1048576 bytes (1.0 MB) copied, 0.382056 s, 2.7 MB/s<br />
Disk /dev/mmcblk0 doesn't contain a valid partition table<br />
DISK SIZE - 8010072064 bytes<br />
CYLINDERS - 973<br />
Checking that no-one is using this disk right now ...<br />
OK<br />
<br />
Disk /dev/mmcblk0: 973 cylinders, 255 heads, 63 sectors/track<br />
<br />
sfdisk: ERROR: sector 0 does not have an msdos signature<br />
/dev/mmcblk0: unrecognized partition table type<br />
Old situation:<br />
No partitions found<br />
New situation:<br />
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0<br />
<br />
Device Boot Start End #cyls #blocks Id System<br />
/dev/mmcblk0p1 * 0+ 8 9- 72261 c W95 FAT32 (LBA)<br />
/dev/mmcblk0p2 9 972 964 7743330 83 Linux<br />
/dev/mmcblk0p3 0 - 0 0 0 Empty<br />
/dev/mmcblk0p4 0 - 0 0 0 Empty<br />
Successfully wrote the new partition table<br />
<br />
Re-reading the partition table ...<br />
<br />
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)<br />
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1<br />
(See fdisk(8).)<br />
done partitioning.<br />
Cant find boot partition /dev/mmcblk01<br />
Cant find rootfs partition in /dev/mmcblk02<br />
mount: special device /dev/mmcblk01 does not exist<br />
</pre><br />
Failed to mount /dev/mmcblk0'''1'''.<br />
<br />
The problem is it's looking for /dev/mmcblk0'''1''' and on my Ubuntu 10.4 it appears at /dev/mmcblk0'''p1'''.<br />
<br />
I modified '''mkcard.sh''' to add the '''p''' and after a little fussing it worked!<br />
<br />
== Running ==<br />
<br />
It booted up and runs fine. There is no X windows, rather the one demo uses QT embedded. QT embedded writes straight to the framebuffer and doesn't need X.<br />
<br />
== Porting ==<br />
<br />
I'm now in the process of seeing if I can copy the demos over to an SD card that I've been doing other development on. My SD isn't set up for QT embedded, so I'm trying:<br />
<br />
beagle$ '''opkg update'''<br />
beagle$ '''opgk install qt4-embedded-tools''' # 5 minutes<br />
beagle$ '''opgk install qt4-embedded-static''' # 2.5 minutes<br />
beagle$ '''opgk install qt4-embedded-fonts''' # 2.5 minutes<br />
<br />
These times running on a rather slow network at home. I don't know if the 'static' needs to be installed.<br />
<br />
Next I went to the SD that was working with the Kinect and copied /usr/lib/libOpenNI.* to /usr/lib on the target SD card. I now get the following error.<br />
<br />
beagle$ '''./QtTracking -qws'''<br />
Error creating sensor.<br />
Failed to initialize tracking !<br />
<br />
I'm guess I don't have the DSP stuff setup right.<br />
<br />
[http://youngindiafellowship.academia.edu/JatinSharma/Blog/48864/OpenNI-on-Beagle-Board-XM This] might help with the openNI port.<br />
<br />
{{YoderFoot}}</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Notes_on_Kinect&diff=223058ECE497 Notes on Kinect2013-02-23T06:06:02Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497 |Notes]]<br />
{{YoderHead}}<br />
<br />
[http://rakarrack.sourceforge.net/ Rakarrack] is an open source effects processor that emulates a guitar effects pedal board. <br />
<br />
Rakarrack can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the [http://circuitco.com/support/index.php?title=BeagleBone_Audio BeagleBone Audio Cape]. <br />
<br />
*The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.<br />
<br />
<br />
== Ubuntu Installation ==<br />
<br />
To install Ubuntu on the BeagleBone follow the instructions found on the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu elinux site].<br />
<br />
login: ubuntu<br />
password: temppwd<br />
<br />
<br />
=== ALSA ===<br />
<br />
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'<br />
<br />
snd_soc_tlv320aic3x<br />
snd_soc_davinci<br />
snd_soc_davinci_mcasp<br />
snd_soc_evm<br />
<br />
You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.<br />
<br />
<br />
== Rakarrack Installation ==<br />
<br />
Rakarrack uses the [http://jackaudio.org/ Jack Audio Connection Kit] to route audio between applications.<br />
<br />
<br />
=== JACK ===<br />
<br />
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see [http://jack-audio.10948.n7.nabble.com/Jack-Devel-jack2-on-ARM-patch-td15962.html this forum post]). Run the recipe below (copied from that post with a couple modifications).<br />
<br />
wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff<br />
apt-get source jackd2<br />
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 <br />
patch -p1 -i ../jack2_armel.diff <br />
dpkg-buildpackage -rfakeroot -uc -b <br />
cd .. <br />
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb<br />
<br />
<br />
=== Rakarrack ===<br />
<br />
Then install Rakarrack by running the following:<br />
<br />
sudo apt-get install rakarrack<br />
<br />
The installation should install jackd as a dependency. To check the installed jack packages run the following:<br />
<br />
dpkg --get-selections | grep jack<br />
<br />
You should see something like this:<br />
<br />
ubuntu@arm:~$ dpkg --get-selections | grep jack<br />
jack deinstall<br />
jackd install<br />
jackd1 deinstall<br />
jackd2 install<br />
libjack-jackd2-0:armhf install<br />
libjack0:armhf deinstall<br />
qjackctl deinstall<br />
<br />
<br />
== System Configuration ==<br />
<br />
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:<br />
<br />
sudo cpufreq-set -f 720MHz<br />
sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
<br />
The output of that last command should be '720000'<br />
<br />
<br />
=== JACK Configuration ===<br />
<br />
Next, start JACK by running the following:<br />
<br />
jackd -d alsa -p 256 -n 16 -S<br />
<br />
This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:<br />
<br />
ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S<br />
jackdmp 1.9.10<br />
Copyright 2001-2005 Paul Davis and others.<br />
Copyright 2004-2013 Grame.<br />
jackdmp comes with ABSOLUTELY NO WARRANTY<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions; see the file COPYING for details<br />
JACK server starting in realtime mode with priority 10<br />
creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit<br />
control device hw:0<br />
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods<br />
ALSA: final selected sample format for capture: 16bit little-endian<br />
ALSA: use 16 periods for capture<br />
ALSA: final selected sample format for playback: 16bit little-endian<br />
ALSA: use 16 periods for playback<br />
<br />
<br />
=== Rakarrack Configuration ===<br />
<br />
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`. <br />
<br />
*Note that this version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.<br />
<br />
The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.<br />
<br />
When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.<br />
<br />
In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'.<br />
<br />
== Conclusion ==<br />
<br />
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just to computationally complex.<br />
<br />
== Future Work ==<br />
<br />
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).<br />
<br />
*Note on multicore systems JACK may require some special setup for [http://jackaudio.org/linux_rt_config realtime processing]</div>Larmorgshttps://elinux.org/index.php?title=User:Larmorgs&diff=223052User:Larmorgs2013-02-23T05:22:43Z<p>Larmorgs: </p>
<hr />
<div>Greg Larmore<br />
<br />
Electrical Engineering Major, Class of 2013.<br />
<br />
== Projects ==<br />
Project topics I'm interested in:<br />
* Compressive sensing and other DSP topics<br />
* Cryptography<br />
* Software defined radio applications<br />
* Discrete time control systems applications<br />
<br />
== Mini-projects == <br />
* [[Adafruit: 16x24 Red LED Matrix Panel]]<br />
<br />
== Project ==<br />
* [[ECE497 SPI Project]]<br />
<br />
== How To ==<br />
* [[ECE497 Notes on Rakarrack]]<br />
<br />
[[Category:ECE497 |Ul]]</div>Larmorgshttps://elinux.org/index.php?title=Adafruit:_16x24_Red_LED_Matrix_Panel&diff=196994Adafruit: 16x24 Red LED Matrix Panel2012-12-02T07:59:31Z<p>Larmorgs: /* Sample C++ Code */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:Adafruit]]<br />
<br />
<pre style="color:red"><br />
Overview: 2<br />
Wiring: 2<br />
Code: 2<br />
git/Compiles with make: 2<br />
Demo: 2<br />
Total: 10<br />
Comments: Looks good. <br />
Have you been able to look into other ways besides bit banging to drive the display?<br />
</pre> <br />
<br />
[[File:16x24_LED_Matrix.jpg|500px|16x24 LED Matrix Display]]<br />
== Overview ==<br />
<br />
Adafruit's [http://www.adafruit.com/products/555 16x24 Red LED Matrix Panel] uses the [http://www.adafruit.com/datasheets/ht1632cv120.pdf HT1632C LED driver]. The driver has the ability to dim and flash and they can be chained together to produce large displays. The code developed for this Mini Project is based on Adafruit's [https://github.com/adafruit/HT1632 original HT1632 github repository] originally written for Arduino. It also uses a modified version of BoneHeader.h to support C++ originally from [https://github.com/millerap/ECE497 Andrew Miller's github repository].<br />
<br />
[[Image:Panel_Connector.jpg|thumb|right|alt=16x24 LED Matrix Display Side Connector|Back connector on the 16x24 LED Matrix Display courtesy of [http://www.adafruit.com/products/555/ adafruit]]]<br />
<br />
== Inputs and Outputs ==<br />
<br />
A single matrix panel can be powered directly off of the BeagleBone's 3.3V supply (running only on USB power). The interface is a bit-banged serial interface requiring 3 pins: chip select (active low), write clock (rising edge trigger), and data. The HT1632C also has a read pin, but it is not populated or used in the example code developed for this Mini Project.<br />
<br />
== Bone Usage ==<br />
<br />
[[Image:Bone P9 pinout.jpg|thumb|left|alt=P9 Connector Pinout|Pinout for the P9 header on the BeagleBone]]<br />
[[Image:Board_Connector.jpg|thumb|right|alt=16x24 LED Matrix Board Side Connector|Board side connector with wires attached courtesy of [http://ladyada.net/products/16x24LEDmatrix/ ladyada]]]<br />
<br />
The pin mappings<br />
<br />
P9 pin # (BeagleBone pin) -> Panel pin (wire color)<br />
<br />
1 (GND) -> GND (black)<br />
<br />
3 (VDD_3V3EXP) -> VCC (red)<br />
<br />
15 (R13/GPIO1_16) -> CS0 (white)<br />
<br />
23 (V14/GPIO1_17) -> WR (yellow)<br />
<br />
12 (A14/GPIO1_28) -> DATA (orange)<br />
<br />
<br />
=== Sample C++ Code ===<br />
<br />
The code shown below is sample code to demonstrate the 16x24 Red LED Matrix Panel.<br />
<br />
<pre><br />
#include "../Resources/adafruit/HT1632/HT1632.h"<br />
#include <stdio.h><br />
#include <unistd.h><br />
#include "icons.c"<br />
<br />
/* <br />
This is a basic demo program showing how to write to a HT1632<br />
These can be used for up to 16x24 LED matrix grids, with internal memory<br />
and using only 3 pins - data, write and select.<br />
Multiple HT1632's can share data and write pins, but need unique CS pins.<br />
*/<br />
<br />
#define BANK 1<br />
#define DATA 28 //1_28<br />
#define WR 17 //1_17<br />
#define CS 16 //1_16<br />
<br />
void testMatrix2(HT1632LEDMatrix *matrix) {<br />
//Display "A+"<br />
matrix->setTextSize(2);<br />
matrix->setTextColor(1);<br />
matrix->write('A');<br />
matrix->write('+');<br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
void testMatrix1(HT1632LEDMatrix *matrix) {<br />
//Display icon<br />
matrix->drawBitmap(0, 0, icon, matrix->width(), matrix->height(), 1); <br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
int main(void) {<br />
printf("Starting...\n");<br />
HT1632LEDMatrix matrix = HT1632LEDMatrix(BANK, DATA, WR, CS);<br />
matrix.begin(HT1632_COMMON_16NMOS);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test #1\n");<br />
testMatrix1(&matrix);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test2\n");<br />
testMatrix2(&matrix);<br />
<br />
printf("Done!\n");<br />
return 0;<br />
}<br />
</pre><br />
<br />
This code example and the required resources can be found in [https://github.com/larmoreg/ece497 Greg Larmore's github repository]<br />
<br />
== Updates ==<br />
<br />
A node.js implementation has been added that sends hard coded pictures to the bone. Also the driver has been switched over to use mmap for gpio writes to speed it up. Ideally the writes should occur at 500kHz now.<br />
<br />
== Future Work ==<br />
<br />
The node.js implementation should be modified to take in a .gif file. Or scrolling text could be implemented.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=196988ECE497 SPI Project2012-12-02T07:58:10Z<p>Larmorgs: /* Installation Instructions */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
09 Executive Summary<br />
09 Installation Instructions (Too detailed to fully test at this time.)<br />
09 User Instructions<br />
09 Highlights<br />
10 Theory of Operation (Nice details)<br />
09 Work Breakdown<br />
10 Future Work<br />
10 Conclusions<br />
10 Demo<br />
10 On time<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 95/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmoreg/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmoreg/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/driver/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code></b>. Buffering problems can cause the kernel to seg fault or crash completely (see Future Work).<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
{{#ev:youtube|8d9n5QUyH38}}<br />
<br />
The program shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
=== Sean Richardson ===<br />
* Researched using SPI on the BeagleBone<br />
* Debugged the LED strand (the first one we received was broken)<br />
* Wrote code to interface with the strand using spidev<br />
* Helped integrate the SPI interface into the sysfs driver<br />
<br />
=== Greg Larmore ===<br />
* Researched kernel drivers and sysfs<br />
* Helped debug the LED strand<br />
* Wrote example sysfs driver<br />
* Integrated the SPI interface into the sysfs driver<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_Contributions_and_Project_Status_here&diff=196982ECE497 Contributions and Project Status here2012-12-02T07:57:07Z<p>Larmorgs: </p>
<hr />
<div>{|<br />
|- <br />
! Name<br />
! git repository<br />
|-<br />
| [[User:hansenrl | Ross Hansen]]<br />
| [https://github.com/hansenrl/ece497.git MiniProject01]<br />
|-<br />
| [[User:atniptw | Tom Atnip]]<br />
| [https://github.com/atniptw/ECE497 ECE497_Repo]<br />
|-<br />
| [[User:larmorgs | Greg Larmore]]<br />
| [https://github.com/larmoreg/ECE497 ECE497_Repo]<br />
|-<br />
| [[User:jessebrannon | Jesse Brannon]]<br />
| [https://github.com/brannojs/ece497 ECE497_Repo]<br />
|-<br />
|| [[User:duganje | Josh Dugan]]<br />
| [https://github.com/duganje/ECE497_duganje ECE497_duganje]<br />
|-<br />
| [[User:popenhjc | James Popenhagen]]<br />
|[https://github.com/popenhjc/popenhjc_ECE497 MiniProject01]<br />
|-<br />
| [[User:jungeml | Mike Junge]]<br />
| [https://github.com/jungeml MiniProject01]<br />
|-<br />
| [[User:mmoravec | Matthew Moravec]]<br />
| [https://github.com/mmoravec ECE497_moravec]<br />
|-<br />
| [[User:shinnsm|Stephen Shinn]]<br />
| [https://github.com/shinnsm/ECE497 ECE497 Repo]<br />
|-<br />
| [[User:millerap|Andrew Miller]]<br />
| [https://github.com/millerap/MiniProject01 MiniProject01]<br />
|-<br />
| [[User:Richarsm|Sean Richardson]]<br />
| [https://github.com/seanrich/MiniProject01 MiniProject01]<br />
|}</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=193508ECE497 SPI Project2012-11-14T11:40:22Z<p>Larmorgs: /* Highlights */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary (Good start)<br />
02 Installation Instructions <br />
00 User Instructions (Missing)<br />
00 Highlights (Missing)<br />
00 Theory of Operation (Missing)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 07/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmorgs/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/driver/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code></b>. Buffering problems can cause the kernel to seg fault or crash completely (see Future Work).<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
{{#ev:youtube|8d9n5QUyH38}}<br />
<br />
The program shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
=== Sean Richardson ===<br />
* Researched using SPI on the BeagleBone<br />
* Debugged the LED strand (the first one we received was broken)<br />
* Wrote code to interface with the strand using spidev<br />
* Helped integrate the SPI interface into the sysfs driver<br />
<br />
=== Greg Larmore ===<br />
* Researched kernel drivers and sysfs<br />
* Helped debug the LED strand<br />
* Wrote example sysfs driver<br />
* Integrated the SPI interface into the sysfs driver<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=193502ECE497 SPI Project2012-11-14T11:39:36Z<p>Larmorgs: /* Highlights */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary (Good start)<br />
02 Installation Instructions <br />
00 User Instructions (Missing)<br />
00 Highlights (Missing)<br />
00 Theory of Operation (Missing)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 07/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmorgs/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/driver/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code></b>. Buffering problems can cause the kernel to seg fault or crash completely (see Future Work).<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
{{#ev:youtube|8d9n5QUyH38}}<br />
<br />
The file shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
=== Sean Richardson ===<br />
* Researched using SPI on the BeagleBone<br />
* Debugged the LED strand (the first one we received was broken)<br />
* Wrote code to interface with the strand using spidev<br />
* Helped integrate the SPI interface into the sysfs driver<br />
<br />
=== Greg Larmore ===<br />
* Researched kernel drivers and sysfs<br />
* Helped debug the LED strand<br />
* Wrote example sysfs driver<br />
* Integrated the SPI interface into the sysfs driver<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=193496ECE497 SPI Project2012-11-14T11:08:17Z<p>Larmorgs: /* User Instructions */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary (Good start)<br />
02 Installation Instructions <br />
00 User Instructions (Missing)<br />
00 Highlights (Missing)<br />
00 Theory of Operation (Missing)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 07/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmorgs/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/driver/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code></b>. Buffering problems can cause the kernel to seg fault or crash completely (see Future Work).<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
The file shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
=== Sean Richardson ===<br />
* Researched using SPI on the BeagleBone<br />
* Debugged the LED strand (the first one we received was broken)<br />
* Wrote code to interface with the strand using spidev<br />
* Helped integrate the SPI interface into the sysfs driver<br />
<br />
=== Greg Larmore ===<br />
* Researched kernel drivers and sysfs<br />
* Helped debug the LED strand<br />
* Wrote example sysfs driver<br />
* Integrated the SPI interface into the sysfs driver<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=193490ECE497 SPI Project2012-11-14T11:05:38Z<p>Larmorgs: /* Work Breakdown */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary (Good start)<br />
02 Installation Instructions <br />
00 User Instructions (Missing)<br />
00 Highlights (Missing)<br />
00 Theory of Operation (Missing)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 07/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmorgs/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/driver/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code>. Buffering problems can cause the kernel to seg fault or crash completely</b>.<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
The file shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
=== Sean Richardson ===<br />
* Researched using SPI on the BeagleBone<br />
* Debugged the LED strand (the first one we received was broken)<br />
* Wrote code to interface with the strand using spidev<br />
* Helped integrate the SPI interface into the sysfs driver<br />
<br />
=== Greg Larmore ===<br />
* Researched kernel drivers and sysfs<br />
* Helped debug the LED strand<br />
* Wrote example sysfs driver<br />
* Integrated the SPI interface into the sysfs driver<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=193484ECE497 SPI Project2012-11-14T10:58:45Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary (Good start)<br />
02 Installation Instructions <br />
00 User Instructions (Missing)<br />
00 Highlights (Missing)<br />
00 Theory of Operation (Missing)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 07/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmorgs/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/driver/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code>. Buffering problems can cause the kernel to seg fault or crash completely</b>.<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
The file shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues. A good place for future work would be to figure out how the buffering problem can be alleviated.<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely. This is a simple place to start for future work.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
The work was broken down into two main tracks. On one side was the SPI interface and getting the light strand to work. The other track was getting a base driver working to integrate the SPI interface into.<br />
<br />
== Future Work ==<br />
<br />
While the strand works well as it is, there are some things that we would like to see looked into if there is future work on this project.<br />
<br />
=== Latching and Controller Interface ===<br />
<br />
According to Adafruit, the interface to this part has been reverse engineered. The one part that really remains unknown is how exactly the 3-bit control interface works for each LED. We were able to achieve a latching effect by sending 6 empty transmissions. The code in [github.com/adafruit/lpd8806 Adafruit's github] doesn't seem to be using this many latch transmissions.<br />
<br />
=== Buffering Problem ===<br />
<br />
There is a problem with buffered output going into the <code>data</code> file (because it is so big). When the output buffers it causes 2 sequential writes which weren't being handled well by the attribute's store function. This could be alleviated with a circular buffer and an index that can be controlled by the user, but really the driver should be able to handle this condition.<br />
<br />
=== Sysfs File Location ===<br />
<br />
The decision to have these drivers located in <code>/lib/modules/3.2.25+/kernel/drivers/char</code> and run out of <code>/sys/firmware</code> was pretty much arbitrary. It would be nice to do some research into how the kernel is supposed to be structured so that we can match it. This also applies to the example driver included in this project.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we were able to get SPI (a lesser used interface on the bone) to work well with our LED strand. More impressively, we were able to interface with the SPI through a sysfs interface. In the process of developing this sysfs interface to the LED strand, we developed an example sysfs driver that can be used in future ECE497 classes. Lastly, we developed a sample application that uses this sysfs interface for our LED strand to show off the results.</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=193478ECE497 SPI Project2012-11-14T10:35:54Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary (Good start)<br />
02 Installation Instructions <br />
00 User Instructions (Missing)<br />
00 Highlights (Missing)<br />
00 Theory of Operation (Missing)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 07/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Good Websites ==<br />
<br />
[http://elinux.org/BeagleBoard/SPI BeagleBoard and SPI]<br />
<br />
[http://www.xml.com/ldd/chapter/book/ O'Reilly Book on Linux Device Drivers]<br />
<br />
[http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/samples/kobject/kset-example.c Kset example for sysfs driver]<br />
<br />
[http://elk.informatik.fh-augsburg.de/pub/elinux/ngw100-docs/AVR32743/spi/spi_example.c Example SPI device driver]<br />
<br />
[http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62 Another example SPI device driver]<br />
<br />
== More Good Websites ==<br />
<br />
[http://www.loadyourself.com/linux/sample-linux-driver/ Example Kernel Driver (ioctl, no sysfs)]<br />
<br />
[http://www.freesoftwaremagazine.com/articles/drivers_linux Kernel Driver Tutorial (no sysfs/ioctl)]<br />
<br />
== Installation Instructions ==<br />
<br />
All of these instructions are meant for the A6A BeagleBone running version 3.2.25+ of the kernel. Scripts and Makefiles expect that the kernel be located at <code>~/BeagleBoard/kernel/kernel</code><br />
<br />
Start by cloning the [https://github.com/larmorgs/FinalProject github] repository on both the bone and the host machine by running the following:<br />
<br />
both$ '''git clone git@github.com:larmorgs/FinalProject'''<br />
<br />
On the host machine, run the following:<br />
<br />
host$ '''cd ~/FinalProject'''<br />
host$ '''./setup.sh'''<br />
<br />
Make sure you only do this <b>once</b> because it is adding on our modules to the Kconfig and Makefile in <code>~/BeagleBoard/kernel/kernel/driver/char</code>. The files are backed up in the same folder with <code>.orig</code> appended.<br />
<br />
Next run the following on the host machine:<br />
<br />
host$ '''make kernel'''<br />
<br />
This will copy the files <code>example.c</code> and <code>lpd8806.c</code> into the <code>~/BeagleBoard/kernel/kernel/driver/char</code> directory, make the kernel, and then scp the files to the bone.<br />
<br />
Moving over to the bone, run the following:<br />
<br />
bone$ '''cd /lib/modules/3.2.25+'''<br />
bone$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Next modify <code>modules.dep</code> to include <code>kernel/drivers/char/example.ko:</code> and <code>kernel/driver/char/lpd8806.ko:</code><br />
<br />
Upon successful completion, you should be able to run the following:<br />
<br />
bone$ '''modprobe example'''<br />
bone$ '''modprobe lpd8806'''<br />
<br />
== User Instructions ==<br />
<br />
Run <code>dmesg</code> or <code>lsmod</code> to make sure the modules have loaded properly. You should now find two folders inside <code>/sys/firmware</code> called <code>example</code> and <code>lpd8806</code>. Feel free to play around in the example folder. If you go into this folder and then one folder further into device, you will find two files. The <code>test</code> file holds an unsigned integer, while the <code>data</code> file holds a string of length 10 (initially empty). You can read and write from these files as you would any other sysfs file.<br />
<br />
Next we will hook up the LED strand. <b>For this make sure the beagle is powered externally</b>. The USB power supply does not have enough current to run the 5m strand at full brightness.<br />
<br />
To get started hook up pins 30 (D12/SPI1_D1) and 31 (A13/SPI1_SCLK) to SPI data and SPI clock on the strand (see the silkscreen for guidance. Hook up the ground to ground (obviously), and the 5V wire on the strand to the <b>3.3V</b> pin on the bone. <b>Do not use the 5V pin on the bone or the suggested Adafruit 5V power supply directly connected to the strand without also adding logic level voltage shifters to the data and clock lines</b>.<br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
You may need to modify your muxes (if they have been changed from the default). If so, do the following:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk'''<br />
<br />
Now that the strand is hooked up, we can run the following:<br />
<br />
bone$ '''cd /sys/firmware/lpd8806/device/'''<br />
bone$ '''echo "127 127 127" > grb'''<br />
<br />
You should see the first LED (closest to the bone) light up bright white. You can also do something like the following:<br />
<br />
bone$ '''echo "127 0 0 0 127 0 0 0 127" > data'''<br />
<br />
The <code>data</code> file is written directly out to the strand while the <code>grb</code> file treats the strand like a big shift register. <b>Be careful with using <code>data</code>. Buffering problems can cause the kernel to seg fault or crash completely</b>.<br />
<br />
== Highlights ==<br />
<br />
We have created a simple C example that uses this sysfs driver. You can run it by doing the following:<br />
<br />
bone$ '''cd ~/FinalProject'''<br />
bone$ '''make'''<br />
bone$ '''./test'''<br />
<br />
The file shows the capabilities of the strand running in shift mode. Because of the nature of the strand's construction, it would be very simple to daisy chain many chains end to end. Also, the kset implementation means that we can have as many separate strands as there are SPI buses. Normally you could have even more, but the strand only runs 3 wire SPI (no chip select).<br />
<br />
The speed is increased greatly when the strand is running in direct access mode by using the <code>data</code> file instead of the <code>grb</code> file. However, due to time limitations we were unable to debug the buffering issues (see Future Work).<br />
<br />
== Theory of Operation ==<br />
<br />
There are many layers to the implementation, so we will break them out into subsections.<br />
<br />
=== Light Strand ===<br />
<br />
The light strand uses the LPD8806 controller chip. Each chip controls the brightness of two 3 color GRB LEDs using PWM running at 1.2 MHz. SPI is used to communicate with the controller chips. The controller has its SPI bus rated somewhere around 20 MHz, but we are only running at 10 MHz. Each LED is 21-bit color, which leaves three bits available for latch control.<br />
<br />
So, as you write color values out on the SPI, the first chip receives them. If the chip hasn't written a color to one of its to LEDs, it does so and thus ends the transmission. However, if it has already assigned a color to each LED then it passes the SPI along on a separate bus to the next chip. This is how the strand is able to be 5m and still run at 10 MHz.<br />
<br />
It is still unknown how exactly the 3 latch bits are used (because the chip manufacturer has kept the interface a secret). However, if you write 6 bytes of "latch" the strand restarts at the beginning. Perhaps less bytes of "latch" can be sent and get the same effect, but due to time limitations we were unable to debug this completely.<br />
<br />
=== SPI Bus ===<br />
<br />
We use the default SPI controller to control the SPI lines. All we had to do is find what master is controlling the bus (2 in our case) and add a device. Initially, the SPI bus we want is being used by the default configuration of spidev. So, all we do is unregister the device from spidev and reregister it for our driver. There are a few things that go into the configuration of the device like speed, number of bits, chip select, and mode. Once these are set, you can add the device and it will then be associated with your driver.<br />
<br />
=== Sysfs Kernel Driver ===<br />
<br />
The sysfs kernel driver is based on the references above. It uses a kset to store kobjects (the basic building block of the kernel). Each kobject has associated with it certain attributes. These attributes are brought out to the user as files. When the files are read from or written to, the kernel calls back into the kobject's read/write routines. Here, we are able to decide which attribute is being addressed and manipulate the buffer as we see fit.<br />
<br />
There are some alternative implementations to this that were looked into in addition to kset. The driver could have been implemented as a sysfs device driver instead of a kernel driver so that it shows up in <code>/sys/class</code> with everything else. Another option is that it could be implemented as a straight up device/kernel driver making it show up in <code>/dev</code> instead. There doesn't seem to be much of a difference though between these implementations as far as performance is concerned. However, finding where this driver fits best is another good place for future work. <br />
<br />
== Work Breakdown ==<br />
<br />
== Future Work ==<br />
<br />
== Conclusions ==</div>Larmorgshttps://elinux.org/index.php?title=ECE497_SPI_Project&diff=193460ECE497 SPI Project2012-11-14T09:07:55Z<p>Larmorgs: /* Executive Summary */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
Team members: [[user:Richarsm|Sean Richardson]], [[user:larmorgs|Greg Larmore]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary (Good start)<br />
02 Installation Instructions <br />
00 User Instructions (Missing)<br />
00 Highlights (Missing)<br />
00 Theory of Operation (Missing)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 07/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
For this project we wanted to further improve documentation available for sysfs kernel drivers with the Beagle Bone. To do this we have interfaced an [http://adafruit.com/products/306 LED light strand] by Adafruit with a sysfs kernel driver utilizing SPI. In doing so we have created an easy to use interface to the light strand while also maximizing data throughput.<br />
<br />
== Installation Instructions ==<br />
<br />
The kernel driver for SPI is installed in the A6A version of the beagle bone.<br />
<br />
We have integrated some code to work with a SPI radio device <span style="color:red">(What radio device?)</span>. The code is located at [https://github.com/larmorgs/ece497/tree/master/Project github].<br />
<br />
To get started hook up pins 30 (D12) and 31 (A13) to SPI Data (sometimes referred to as Master) and SPI clock. <br />
<br />
[[File:Bone_P9_pinout.jpg]]<br />
<br />
Then echo 0 into both:<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_d1'''<br />
beagle$ '''echo 0 > /sys/kernel/debug/omap_mux/spi0_sclk''' <br />
<br />
to select the pin mux for SPI.<br />
<br />
== Work Breakdown ==<br />
<br />
So far we have done research on how Linux interfaces with SPI and we have integrated the SPI interface with current code that we have for an SPI radio. We also have explored methods of interfacing the SPI LED strip with a user to create a pleasant experience, such as creating a website to change the colors, or adding a possible twitter reader that would change the lights based on tweets.<br />
<br />
== Future Work ==<br />
<br />
We want to develop a driver that will interface with SPI and potentially create a sysfs userspace utility for the LED strip.<br />
<br />
== Conclusions ==<br />
<br />
The SPI interface is not well developed in Linux and can use some work progressing it. We have taken on the task of getting these two devices to work in an easier manner.</div>Larmorgshttps://elinux.org/index.php?title=Adafruit:_16x24_Red_LED_Matrix_Panel&diff=190712Adafruit: 16x24 Red LED Matrix Panel2012-11-08T23:26:22Z<p>Larmorgs: /* Bone Usage */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:Adafruit]]<br />
<br />
<pre style="color:red"><br />
Overview: 2<br />
Wiring: 2<br />
Code: 2<br />
git/Compiles with make: 2<br />
Demo: 2<br />
Total: 10<br />
Comments: Looks good. <br />
Have you been able to look into other ways besides bit banging to drive the display?<br />
</pre> <br />
<br />
[[File:16x24_LED_Matrix.jpg|500px|16x24 LED Matrix Display]]<br />
== Overview ==<br />
<br />
Adafruit's [http://www.adafruit.com/products/555 16x24 Red LED Matrix Panel] uses the [http://www.adafruit.com/datasheets/ht1632cv120.pdf HT1632C LED driver]. The driver has the ability to dim and flash and they can be chained together to produce large displays. The code developed for this Mini Project is based on Adafruit's [https://github.com/adafruit/HT1632 original HT1632 github repository] originally written for Arduino. It also uses a modified version of BoneHeader.h to support C++ originally from [https://github.com/millerap/ECE497 Andrew Miller's github repository].<br />
<br />
[[Image:Panel_Connector.jpg|thumb|right|alt=16x24 LED Matrix Display Side Connector|Back connector on the 16x24 LED Matrix Display courtesy of [http://www.adafruit.com/products/555/ adafruit]]]<br />
<br />
== Inputs and Outputs ==<br />
<br />
A single matrix panel can be powered directly off of the BeagleBone's 3.3V supply (running only on USB power). The interface is a bit-banged serial interface requiring 3 pins: chip select (active low), write clock (rising edge trigger), and data. The HT1632C also has a read pin, but it is not populated or used in the example code developed for this Mini Project.<br />
<br />
== Bone Usage ==<br />
<br />
[[Image:Bone P9 pinout.jpg|thumb|left|alt=P9 Connector Pinout|Pinout for the P9 header on the BeagleBone]]<br />
[[Image:Board_Connector.jpg|thumb|right|alt=16x24 LED Matrix Board Side Connector|Board side connector with wires attached courtesy of [http://ladyada.net/products/16x24LEDmatrix/ ladyada]]]<br />
<br />
The pin mappings<br />
<br />
P9 pin # (BeagleBone pin) -> Panel pin (wire color)<br />
<br />
1 (GND) -> GND (black)<br />
<br />
3 (VDD_3V3EXP) -> VCC (red)<br />
<br />
15 (R13/GPIO1_16) -> CS0 (white)<br />
<br />
23 (V14/GPIO1_17) -> WR (yellow)<br />
<br />
12 (A14/GPIO1_28) -> DATA (orange)<br />
<br />
<br />
=== Sample C++ Code ===<br />
<br />
The code shown below is sample code to demonstrate the 16x24 Red LED Matrix Panel.<br />
<br />
<pre><br />
#include "../Resources/adafruit/HT1632/HT1632.h"<br />
#include <stdio.h><br />
#include <unistd.h><br />
#include "icons.c"<br />
<br />
/* <br />
This is a basic demo program showing how to write to a HT1632<br />
These can be used for up to 16x24 LED matrix grids, with internal memory<br />
and using only 3 pins - data, write and select.<br />
Multiple HT1632's can share data and write pins, but need unique CS pins.<br />
*/<br />
<br />
#define BANK 1<br />
#define DATA 28 //1_28<br />
#define WR 17 //1_17<br />
#define CS 16 //1_16<br />
<br />
void testMatrix2(HT1632LEDMatrix *matrix) {<br />
//Display "A+"<br />
matrix->setTextSize(2);<br />
matrix->setTextColor(1);<br />
matrix->write('A');<br />
matrix->write('+');<br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
void testMatrix1(HT1632LEDMatrix *matrix) {<br />
//Display icon<br />
matrix->drawBitmap(0, 0, icon, matrix->width(), matrix->height(), 1); <br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
int main(void) {<br />
printf("Starting...\n");<br />
HT1632LEDMatrix matrix = HT1632LEDMatrix(BANK, DATA, WR, CS);<br />
matrix.begin(HT1632_COMMON_16NMOS);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test #1\n");<br />
testMatrix1(&matrix);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test2\n");<br />
testMatrix2(&matrix);<br />
<br />
printf("Done!\n");<br />
return 0;<br />
}<br />
</pre><br />
<br />
This code example and the required resources can be found in [https://github.com/larmorgs/ece497 Greg Larmore's github repository]<br />
<br />
== Updates ==<br />
<br />
A node.js implementation has been added that sends hard coded pictures to the bone. Also the driver has been switched over to use mmap for gpio writes to speed it up. Ideally the writes should occur at 500kHz now.<br />
<br />
== Future Work ==<br />
<br />
The node.js implementation should be modified to take in a .gif file. Or scrolling text could be implemented.</div>Larmorgshttps://elinux.org/index.php?title=Adafruit:_16x24_Red_LED_Matrix_Panel&diff=190706Adafruit: 16x24 Red LED Matrix Panel2012-11-08T23:25:03Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:Adafruit]]<br />
<br />
<pre style="color:red"><br />
Overview: 2<br />
Wiring: 2<br />
Code: 2<br />
git/Compiles with make: 2<br />
Demo: 2<br />
Total: 10<br />
Comments: Looks good. <br />
Have you been able to look into other ways besides bit banging to drive the display?<br />
</pre> <br />
<br />
[[File:16x24_LED_Matrix.jpg|500px|16x24 LED Matrix Display]]<br />
== Overview ==<br />
<br />
Adafruit's [http://www.adafruit.com/products/555 16x24 Red LED Matrix Panel] uses the [http://www.adafruit.com/datasheets/ht1632cv120.pdf HT1632C LED driver]. The driver has the ability to dim and flash and they can be chained together to produce large displays. The code developed for this Mini Project is based on Adafruit's [https://github.com/adafruit/HT1632 original HT1632 github repository] originally written for Arduino. It also uses a modified version of BoneHeader.h to support C++ originally from [https://github.com/millerap/ECE497 Andrew Miller's github repository].<br />
<br />
[[Image:Panel_Connector.jpg|thumb|right|alt=16x24 LED Matrix Display Side Connector|Back connector on the 16x24 LED Matrix Display courtesy of [http://www.adafruit.com/products/555/ adafruit]]]<br />
<br />
== Inputs and Outputs ==<br />
<br />
A single matrix panel can be powered directly off of the BeagleBone's 3.3V supply (running only on USB power). The interface is a bit-banged serial interface requiring 3 pins: chip select (active low), write clock (rising edge trigger), and data. The HT1632C also has a read pin, but it is not populated or used in the example code developed for this Mini Project.<br />
<br />
== Bone Usage ==<br />
<br />
[[Image:Bone P9 pinout.jpg|thumb|left|alt=P9 Connector Pinout|Pinout for the P9 header on the BeagleBone]]<br />
[[Image:Board_Connector.jpg|thumb|right|alt=16x24 LED Matrix Board Side Connector|Board side connector with wires attached courtesy of [http://ladyada.net/products/16x24LEDmatrix/ ladyada]]]<br />
<br />
The pin mappings<br />
<br />
P9 pin # (BeagleBone pin) -> Panel pin (wire color)<br />
<br />
1 (GND) -> GND (black)<br />
<br />
3 (VDD_3V3EXP) -> VCC (red)<br />
<br />
15 (R13/GPIO1_16) -> CS0 (white)<br />
<br />
23 (V14/GPIO1_17) -> DATA (orange)<br />
<br />
12 (A14/GPIO1_28) -> WR (yellow)<br />
<br />
<br />
=== Sample C++ Code ===<br />
<br />
The code shown below is sample code to demonstrate the 16x24 Red LED Matrix Panel.<br />
<br />
<pre><br />
#include "../Resources/adafruit/HT1632/HT1632.h"<br />
#include <stdio.h><br />
#include <unistd.h><br />
#include "icons.c"<br />
<br />
/* <br />
This is a basic demo program showing how to write to a HT1632<br />
These can be used for up to 16x24 LED matrix grids, with internal memory<br />
and using only 3 pins - data, write and select.<br />
Multiple HT1632's can share data and write pins, but need unique CS pins.<br />
*/<br />
<br />
#define BANK 1<br />
#define DATA 28 //1_28<br />
#define WR 17 //1_17<br />
#define CS 16 //1_16<br />
<br />
void testMatrix2(HT1632LEDMatrix *matrix) {<br />
//Display "A+"<br />
matrix->setTextSize(2);<br />
matrix->setTextColor(1);<br />
matrix->write('A');<br />
matrix->write('+');<br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
void testMatrix1(HT1632LEDMatrix *matrix) {<br />
//Display icon<br />
matrix->drawBitmap(0, 0, icon, matrix->width(), matrix->height(), 1); <br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
int main(void) {<br />
printf("Starting...\n");<br />
HT1632LEDMatrix matrix = HT1632LEDMatrix(BANK, DATA, WR, CS);<br />
matrix.begin(HT1632_COMMON_16NMOS);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test #1\n");<br />
testMatrix1(&matrix);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test2\n");<br />
testMatrix2(&matrix);<br />
<br />
printf("Done!\n");<br />
return 0;<br />
}<br />
</pre><br />
<br />
This code example and the required resources can be found in [https://github.com/larmorgs/ece497 Greg Larmore's github repository]<br />
<br />
== Updates ==<br />
<br />
A node.js implementation has been added that sends hard coded pictures to the bone. Also the driver has been switched over to use mmap for gpio writes to speed it up. Ideally the writes should occur at 500kHz now.<br />
<br />
== Future Work ==<br />
<br />
The node.js implementation should be modified to take in a .gif file. Or scrolling text could be implemented.</div>Larmorgshttps://elinux.org/index.php?title=EBC_Contributions_and_Project_Status&diff=189206EBC Contributions and Project Status2012-11-06T17:00:20Z<p>Larmorgs: /* Project Status */</p>
<hr />
<div>[[Category:ECE497 |Contributions]]<br />
{{YoderHead}}<br />
<br />
== Fall 2012 ==<br />
<br />
=== Project Status ===<br />
<br />
Please edit this page and add your project to this list. Copy my [[ECE497 Project Template]] to your own eLinux page and include the title of your project in the name of the page. <br />
<br />
Please make the list alphabetical by family name.<br />
<br />
Take a look at what you and others have contributed.<br />
<br />
{|<br />
|- <br />
! Name<br />
! Contributions<br />
! Project<br />
! git repository<br />
|-<br />
| [[User:atniptw | Tom Atnip]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/atniptw/ atniptw]<br />
|-<br />
| [[User:larmorgs | Greg Larmore]]<br />
| [[Special:Contributions/larmorgs|contrib]]<br />
| [[ECE497 SPI Project | SPI Project]]<br />
| [https://github.com/larmorgs Greg Larmore]<br />
|-<br />
| [[User:jessebrannon | Jesse Brannon]]<br />
| <br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/brannojs/ brannojs]<br />
|-<br />
| [[User:Xinyu1991 | Xinyu Cheng]]<br />
| [[Special:Contributions/Xinyu1991|contrib]]<br />
| [[ECE497_Project:_Kinect | Kinect]]<br />
| [https://github.com/xinyu1991/ Xinyu Cheng]<br />
|-<br />
| [[User:correlbn | Bryan Correll]]<br />
| [[Special:Contributions/correlbn|contrib]]<br />
| [[BeagleBone PRU | BeagleBone PRU]]<br />
| [https://github.com/correlbn/My-Beagle-Project/ Correlbn]<br />
|-<br />
| [[User:draneaw | Alex Drane]]<br />
| <br />
| [[ECE497 draneaw Project | My Beagle Project]]<br />
| [https://github.com/draneaw/My-Beagle-Project draneaw]<br />
|-<br />
| [[User:duganje | Josh Dugan]]<br />
| [[Special:Contributions/duganje|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/duganje/ duganje]<br />
|-<br />
| [[User:Geislekj | Kevin Geisler]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/geislekj/ geislekj]<br />
| <br />
|-<br />
| [[User:chris.good | Christopher A Good]]<br />
| [[Special:Contributions/Chris.good|contrib]]<br />
| [[ECE497 Project RoverGUI | RoverGUI]]<br />
| [https://github.com/goodca/ goodca]<br />
| <br />
|-<br />
| [[User:hansenrl | Ross Hansen]]<br />
| [[Special:Contributions/hansenrl|contrib]]<br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/hansenrl/ Hansenrl]<br />
| <br />
|-<br />
| [[User:jungeml | Michael Junge]]<br />
| [[Special:Contributions/jungeml|contrib]]<br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/jungeml/ Jungeml]<br />
|-<br />
|<br />
|-<br />
| [[User:Lix | Xia Li]]<br />
| [[Special:Contributions/Lix|contrib]]<br />
| [[ECE497 Project: Kinect | Kinect]]<br />
| [https://github.com/1984xiali/ xiali]<br />
|-<br />
| [[User:mmoravec | Matthew Moravec]]<br />
| [[Special:Contributions/mmoravec|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/mmoravec/ mmoravec]<br />
|-<br />
| [[User:ngop | Peter Ngo]]<br />
| <br />
| [[ECE497 ngop Project: Beaglebone PRU|Beaglebone PRU]]<br />
| [https://github.com/ngop/ ngop]<br />
|<br />
|-<br />
| [[User:shinnsm|Stephen Shinn]]<br />
| [[Special:Contributions/shinnsm|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/shinnsm shinnsm]<br />
|-<br />
| [[User:Yoder | Mark A. Yoder]]<br />
| [[Special:Contributions/Yoder | contrib]]<br />
| [[ECE497 Project Template | My Beagle Project]]<br />
| [https://github.com/MarkAYoder MarkAYoder]<br />
|-<br />
| [[User:Popenhjc | James Popenhagen]]<br />
| <br />
| [[BeagleBone PRU | BeagleBone PRU]]<br />
| [https://github.com/popenhjc/ popenhjc]<br />
|-<br />
| [[User:Whiteer | Elias White]]<br />
| <br />
| [[ECE497 SLAM via ROS | My Beagle Project]]<br />
| [https://github.com/whiteer whiteer]<br />
|-<br />
| [[User:ruff | Ruffin White]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/ruffsl/ ruffsl]<br />
|<br />
|-<br />
| [[User:Richarsm | Sean Richardson]]<br />
| [[Special:Contributions/Richarsm|contrib]]<br />
| [[ECE497 SPI Project | SPI Project]]<br />
| [https://github.com/seanrich Sean Richardson]<br />
|-<br />
| [[User:Millerap | Andrew Miller]]<br />
|<br />
| [[ECE 497 millerap Project | My Beagle Project]]<br />
| [https://github.com/millerap millerap]<br />
|-| <br />
| [[User:Astroricks | Yue Zhang]]<br />
| <br />
| [[ECE497 Yue Zhang Project | My Beagle Project]]<br />
| [https://github.com/Astroricks/Beagle-Project Yue Zhang]<br />
|-<br />
| [[User:Lobdeljt | John Lobdell]]<br />
| <br />
| [[ECE 497 lobdeljt Project | My Beagle Project]]<br />
| [https://github.com/jtlobdell jtlobdell]<br />
|-<br />
|<br />
|}<br />
<br />
== Winter 2011-2012 ==<br />
<br />
=== Contributions ===<br />
<br />
# [[Special:Contributions/Yuming | Yuming Cao]]<br />
# [[Special:Contributions/Yifei | Yifei Li]]<br />
# [[Special:Contributions/Harrisgw | Greg Harrison]]<br />
# [[Special:Contributions/mac | Jack Ma]]<br />
# [[Special:Contributions/Gemini91 | Guanqun Wang]]<br />
# [[Special:Contributions/Yanj | Mona Yan]]<br />
# [[Special:Contributions/Yoder | Mark A. Yoder]]<br />
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]<br />
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]<br />
# [[Special:Contributions/Zitnikdj | David Zitnik]]<br />
# [[Special:Contributions/Zitnikdj | Alex Drane]]<br />
# [[Special:Contributions/jessebrannon | Jesse Brannon]]<br />
# [[Special:Contributions/larmorgs | Greg Larmore]]<br />
# [[Special:Contributions/jungeml | Michael Junge]]<br />
# [[Special:Contributions/millerap | Andrew Miller]]<br />
# [[Special:Contributions/correlbn | Bryan Correll]]<br />
<br />
=== Project Status ===<br />
<br />
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]<br />
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]<br />
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]<br />
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]<br />
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]<br />
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]<br />
<br />
<br />
{{YoderFoot}}</div>Larmorgshttps://elinux.org/index.php?title=EBC_Contributions_and_Project_Status&diff=189194EBC Contributions and Project Status2012-11-06T16:59:54Z<p>Larmorgs: /* Project Status */</p>
<hr />
<div>[[Category:ECE497 |Contributions]]<br />
{{YoderHead}}<br />
<br />
== Fall 2012 ==<br />
<br />
=== Project Status ===<br />
<br />
Please edit this page and add your project to this list. Copy my [[ECE497 Project Template]] to your own eLinux page and include the title of your project in the name of the page. <br />
<br />
Please make the list alphabetical by family name.<br />
<br />
Take a look at what you and others have contributed.<br />
<br />
{|<br />
|- <br />
! Name<br />
! Contributions<br />
! Project<br />
! git repository<br />
|-<br />
| [[User:atniptw | Tom Atnip]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/atniptw/ atniptw]<br />
|-<br />
| [[User:larmorgs | Greg Larmore]]<br />
| [[Special:Contributions/larmorgs|contrib]]<br />
| [[ECE497 SPI Project | SPI Project]]<br />
| [https://github.com/larmorgs Greg Larmore]<br />
| <br />
| [[ECE497 SPI Project | SPI Project]]<br />
| [https://github.com/larmorgs/ larmorgs]<br />
|-<br />
| [[User:jessebrannon | Jesse Brannon]]<br />
| <br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/brannojs/ brannojs]<br />
|-<br />
| [[User:Xinyu1991 | Xinyu Cheng]]<br />
| [[Special:Contributions/Xinyu1991|contrib]]<br />
| [[ECE497_Project:_Kinect | Kinect]]<br />
| [https://github.com/xinyu1991/ Xinyu Cheng]<br />
|-<br />
| [[User:correlbn | Bryan Correll]]<br />
| [[Special:Contributions/correlbn|contrib]]<br />
| [[BeagleBone PRU | BeagleBone PRU]]<br />
| [https://github.com/correlbn/My-Beagle-Project/ Correlbn]<br />
|-<br />
| [[User:draneaw | Alex Drane]]<br />
| <br />
| [[ECE497 draneaw Project | My Beagle Project]]<br />
| [https://github.com/draneaw/My-Beagle-Project draneaw]<br />
|-<br />
| [[User:duganje | Josh Dugan]]<br />
| [[Special:Contributions/duganje|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/duganje/ duganje]<br />
|-<br />
| [[User:Geislekj | Kevin Geisler]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/geislekj/ geislekj]<br />
| <br />
|-<br />
| [[User:chris.good | Christopher A Good]]<br />
| [[Special:Contributions/Chris.good|contrib]]<br />
| [[ECE497 Project RoverGUI | RoverGUI]]<br />
| [https://github.com/goodca/ goodca]<br />
| <br />
|-<br />
| [[User:hansenrl | Ross Hansen]]<br />
| [[Special:Contributions/hansenrl|contrib]]<br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/hansenrl/ Hansenrl]<br />
| <br />
|-<br />
| [[User:jungeml | Michael Junge]]<br />
| [[Special:Contributions/jungeml|contrib]]<br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/jungeml/ Jungeml]<br />
|-<br />
|<br />
|-<br />
| [[User:Lix | Xia Li]]<br />
| [[Special:Contributions/Lix|contrib]]<br />
| [[ECE497 Project: Kinect | Kinect]]<br />
| [https://github.com/1984xiali/ xiali]<br />
|-<br />
| [[User:mmoravec | Matthew Moravec]]<br />
| [[Special:Contributions/mmoravec|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/mmoravec/ mmoravec]<br />
|-<br />
| [[User:ngop | Peter Ngo]]<br />
| <br />
| [[ECE497 ngop Project: Beaglebone PRU|Beaglebone PRU]]<br />
| [https://github.com/ngop/ ngop]<br />
|<br />
|-<br />
| [[User:shinnsm|Stephen Shinn]]<br />
| [[Special:Contributions/shinnsm|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/shinnsm shinnsm]<br />
|-<br />
| [[User:Yoder | Mark A. Yoder]]<br />
| [[Special:Contributions/Yoder | contrib]]<br />
| [[ECE497 Project Template | My Beagle Project]]<br />
| [https://github.com/MarkAYoder MarkAYoder]<br />
|-<br />
| [[User:Popenhjc | James Popenhagen]]<br />
| <br />
| [[BeagleBone PRU | BeagleBone PRU]]<br />
| [https://github.com/popenhjc/ popenhjc]<br />
|-<br />
| [[User:Whiteer | Elias White]]<br />
| <br />
| [[ECE497 SLAM via ROS | My Beagle Project]]<br />
| [https://github.com/whiteer whiteer]<br />
|-<br />
| [[User:ruff | Ruffin White]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/ruffsl/ ruffsl]<br />
|<br />
|-<br />
| [[User:Richarsm | Sean Richardson]]<br />
| [[Special:Contributions/Richarsm|contrib]]<br />
| [[ECE497 SPI Project | SPI Project]]<br />
| [https://github.com/seanrich Sean Richardson]<br />
|-<br />
| [[User:Millerap | Andrew Miller]]<br />
|<br />
| [[ECE 497 millerap Project | My Beagle Project]]<br />
| [https://github.com/millerap millerap]<br />
|-| <br />
| [[User:Astroricks | Yue Zhang]]<br />
| <br />
| [[ECE497 Yue Zhang Project | My Beagle Project]]<br />
| [https://github.com/Astroricks/Beagle-Project Yue Zhang]<br />
|-<br />
| [[User:Lobdeljt | John Lobdell]]<br />
| <br />
| [[ECE 497 lobdeljt Project | My Beagle Project]]<br />
| [https://github.com/jtlobdell jtlobdell]<br />
|-<br />
|<br />
|}<br />
<br />
== Winter 2011-2012 ==<br />
<br />
=== Contributions ===<br />
<br />
# [[Special:Contributions/Yuming | Yuming Cao]]<br />
# [[Special:Contributions/Yifei | Yifei Li]]<br />
# [[Special:Contributions/Harrisgw | Greg Harrison]]<br />
# [[Special:Contributions/mac | Jack Ma]]<br />
# [[Special:Contributions/Gemini91 | Guanqun Wang]]<br />
# [[Special:Contributions/Yanj | Mona Yan]]<br />
# [[Special:Contributions/Yoder | Mark A. Yoder]]<br />
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]<br />
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]<br />
# [[Special:Contributions/Zitnikdj | David Zitnik]]<br />
# [[Special:Contributions/Zitnikdj | Alex Drane]]<br />
# [[Special:Contributions/jessebrannon | Jesse Brannon]]<br />
# [[Special:Contributions/larmorgs | Greg Larmore]]<br />
# [[Special:Contributions/jungeml | Michael Junge]]<br />
# [[Special:Contributions/millerap | Andrew Miller]]<br />
# [[Special:Contributions/correlbn | Bryan Correll]]<br />
<br />
=== Project Status ===<br />
<br />
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]<br />
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]<br />
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]<br />
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]<br />
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]<br />
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]<br />
<br />
<br />
{{YoderFoot}}</div>Larmorgshttps://elinux.org/index.php?title=User:Larmorgs&diff=189146User:Larmorgs2012-11-06T16:56:37Z<p>Larmorgs: </p>
<hr />
<div>Greg Larmore<br />
<br />
Electrical Engineering Major, Class of 2013.<br />
<br />
== Projects ==<br />
Project topics I'm interested in:<br />
* Compressive sensing and other DSP topics<br />
* Cryptography<br />
* Software defined radio applications<br />
* Discrete time control systems applications<br />
<br />
== Mini-projects == <br />
* [[Adafruit: 16x24 Red LED Matrix Panel]]<br />
<br />
== Project ==<br />
* [[ECE497 SPI Project]]<br />
<br />
== How To ==<br />
<br />
[[Category:ECE497 |Ul]]</div>Larmorgshttps://elinux.org/index.php?title=User:Larmorgs&diff=189134User:Larmorgs2012-11-06T16:56:14Z<p>Larmorgs: </p>
<hr />
<div>Greg Larmore<br />
<br />
Electrical Engineering Major, Class of 2013.<br />
<br />
== Projects ==<br />
Project topics I'm interested in:<br />
* Compressive sensing and other DSP topics<br />
* Cryptography<br />
* Software defined radio applications<br />
* Discrete time control systems applications<br />
<br />
== Mini-projects == <br />
* [[Adafruit: 16x24 Red LED Matrix Panel]]<br />
<br />
== Project ==<br />
* [[ECE497 Project: ECE497 SPI Project]]<br />
<br />
== How To ==<br />
<br />
[[Category:ECE497 |Ul]]</div>Larmorgshttps://elinux.org/index.php?title=User:Larmorgs&diff=189104User:Larmorgs2012-11-06T16:53:15Z<p>Larmorgs: </p>
<hr />
<div>Greg Larmore<br />
<br />
Electrical Engineering Major, Class of 2013.<br />
<br />
== Projects ==<br />
Project topics I'm interested in:<br />
* Compressive sensing and other DSP topics<br />
* Cryptography<br />
* Software defined radio applications<br />
* Discrete time control systems applications<br />
<br />
== Mini-projects == <br />
<br />
== How To ==<br />
<br />
[[Category:ECE497 |Ul]]</div>Larmorgshttps://elinux.org/index.php?title=EBC_Exercise_26_Device_Drivers&diff=185732EBC Exercise 26 Device Drivers2012-10-30T08:30:23Z<p>Larmorgs: /* Compiling */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
Chapter 8 of the text [http://www.amazon.com/Embedded-Linux-Primer-Practical-Real-World/dp/0137017839] gives a nice example of a minimal device driver. The purpose of this lab is to implement that driver.<br />
<br />
== Minimal Device Driver Example ==<br />
<br />
=== Compiling ===<br />
<br />
Follow the 5 steps given in Section 8.1.4 on page 205. You can get a copy of Listing 8-1 here ([[ECE497_Listings_for_Embedded_Linux_Primer_Chapter_8]]). Once finished you will have a file called <code>hello1.c</code> in <code>.../drivers/char/examples</code> and have the kernel configure file and Makefile updated for the new driver. See Section 4.4 on page 89 for help with modifying the config files.<br />
<br />
Note: There is a typo in Listing 8-2.<br />
<br />
If you have created the '''crossCompileEnv.sh''' file and sourced it, all you have to do to make the modules is cd to the top of the kernel directory and then:<br />
<br />
host$ '''source ~/.oe/crossCompileEnv.sh''' (Only need to run once per terminal session.)<br />
host$ '''make modules''' (or make -j''X'' modules, where ''X'' = number of cores on host.)<br />
<br />
Mine took a while the first time as it compiles all the modules. The second it only took 31 seconds.<br />
<br />
If you want to install all the modules that are created. <br />
<br />
host$ '''make INSTALL_MOD_PATH=~/BeagleBoard modules_install'''<br />
<br />
This will create '''lib''' directory in '''~/BeagleBoard''' with everything that goes in '''/lib''' on the Beagle. Then <br />
<br />
host$ '''rsync --progress -avhe ssh ~/BeagleBoard/lib root@beagle:/'''<br />
<br />
Could take a while to transfer.<br />
<br />
====Improvements to the Code in the Book====<br />
The code in Listing 8-10 is incomplete. If you compile it as is and load the module, it will work, but if you then remove the module and try to reinsert it it will fail with an error like this:<br />
<pre><br />
ERROR GOES HERE<br />
</pre><br />
The reason for this is that the module is registered with the kernel on load with a command like this:<br />
<pre><br />
register_chrdev(MAJOR_NUMBER, NAME, FILE_OPERATIONS*);<br />
</pre><br />
But it is never unregistered when the module is unloaded. To properly unload the module, add this line of code to your module's exit function<br />
<pre><br />
unregister_chrdev(MAJOR_NUMBER, NAME);<br />
</pre><br />
This will properly unregister the module from the kernel and allow it to be inserted and removed from the kernel at will without restarting your system in between.<br />
<br />
=== Moving to Beagle ===<br />
<br />
On the beagle edit <code>/lib/modules/2.6.32/modules.dep</code> and add<br />
<br />
/lib/modules/2.6.32/kernel/drivers/char/examples/hello1.ko:<br />
<br />
Then copy the file <code>…/drivers/char/examples/hello1.ko</code> on the host computer to <code>/lib/modules/2.6.32/kernel/drivers/char/examples/</code> on your Beagle. This can be done with a single command though you may have to mkdir the char/examples directory on the Beagle first.<br />
<br />
host$ '''cd …/drivers/char/examples'''<br />
host$ '''scp hello1.ko root@beagle:/lib/modules/2.6.32/kernel/drivers/char/examples'''<br />
<br />
I suggest putting the <code>scp</code> command in the <code>Makefile</code> since you may use it several times while developing your code.<br />
<br />
Now, on the Beagle, add the module to '''modules.dep'''<br />
<br />
beagle$ '''cd /lib/modules/2.6.32'''<br />
beagle$ '''gedit modules.dep'''<br />
<br />
Add the path to your new module and save. You will also have to move the '''modules.dep.bin''', otherwise the beagle will read from it rather than the modules.dep.<br />
<br />
beagle$ '''mv modules.dep.bin modules.dep.bin.orig'''<br />
<br />
Now, modprobe the module and check the log file.<br />
<br />
beagle$ '''modprobe hello1'''<br />
beagle$ '''dmesg | tail -4'''<br />
<br />
You should see your Init message. And then...<br />
<br />
beagle$ '''modprobe -r hello1'''<br />
beagle$ '''dmesg | tail -4'''<br />
<br />
should show your Exit message.<br />
<br />
== Module Parameters ==<br />
<br />
Section 8.1.7 on page 211 of the text shows how to pass a parameter to a module. Modify your <code>hello1.c</code> to take a parameter as shown.<br />
<br />
Modify it so you can pass two parameters.<br />
<br />
== Module Utilities ==<br />
<br />
Play with the mod utilities listed in section 8.2 on page 212.<br />
<br />
== Driver Methods ==<br />
<br />
Section 8.3 on page 217 gives a longer example of how to use the file interface with modules. Implement the example. Be sure to fix the ''unsigned int'' format error, and make sure your <code>exit</code> function unregisters the device (unlike the Listing). When compiling the <code>use-hello</code> command be sure you are using the cross compiler for the ARM rather than the x86 compiler. If you sourced the '''crossCompilerEnv.sh''' file this should work:<br />
<br />
host$ '''${CROSS_COMPILE}gcc use-hello.c -o use-hello''' <br />
host$ '''file use-hello'''<br />
<br />
The <code>file</code> command will tell you if you got the right compiler. Modify your <code>Makefile</code> to make <code>use-hello</code>.<br />
<br />
Some questions...<br />
* The major device number 234 is part of a range of unassigned numbers. What is the range?<br />
* What's the new line added to <code>hello_init</code> do?<br />
* What does <code>mknod</code> do?<br />
* Once your device is running try <code>$ cat /proc/devices</code>. Do you see your device?<br />
<br />
=== Optional Driver Work ===<br />
<br />
Chapter 3 of ''Linux Device Drivers'' by Corbet, Rubini and Kroah-Hartman ([http://www.rose-hulman.edu/~yoder/Beagle/]) gives some more details on device drivers. Our text uses an older, static, method for major device number allocation. The book, referenced above, uses the newer dynamic allocation. <br />
* Convert the example in our text to use the newer method. It's only a couple of additional lines, but you will have to read the book to know how to do it. <br />
* Modify the ''scull_load'' script (call it ''hello_load'') on page 47, of chapter 3, to load your module. Hint: the back quotes are missing in this line in the text:<br />
<br />
major=`awk "\\$2==\"$module\" {print \\$1}" /proc/devices)`<br />
<br />
* Test it with <code>use-hello.c</code> from page 222 of ''Embedded Linux Primer''.<br />
* Write a ''hello_unload'' script that will rmmod the driver and remove the nodes in /dev<br />
* Modify ''hello.c'' to pass the major device number in as a parameter during <code>insmod</code>.<br />
<br />
Optional: Stretch time, I though these would be easy, but after reading up on them, they look rather involved.<br />
* How can your driver find what the minor device number is?<br />
* Modify the driver to return some characters when <code>/dev/hello1</code> is read.<br />
<br />
== Reference ==<br />
<br />
[http://www.cnx-software.com/2011/08/19/how-to-write-and-submit-a-linux-kernel-patch/ How to Write and Submit a Linux Kernel Patch]<br />
<br />
{{YoderFoot}}</div>Larmorgshttps://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_3.8&diff=185342EBC Exercise 08 Installing Development Tools 3.82012-10-29T03:08:36Z<p>Larmorgs: /* reboot */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([http://projects.gnome.org/gedit/ gedit]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle. Later, when we start compiling the kernel [http://www.kernel.org/] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.<br />
<br />
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.<br />
<br />
Instructions for building Ångström are given [http://www.angstrom-distribution.org/building-angstrom here]; however there are a few changes you have to make. Here's what I did.<br />
<br />
'''Tip:''' Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.<br />
<br />
== The Kernel ==<br />
<br />
These instructions have been tested for the 3.2.25 kernel.<br />
<br />
=== download ===<br />
These are notes are based on [https://github.com/beagleboard/kernel/blob/6682025752d0b807119c1e363a0b1b9bfe2ab453/README.md Beagleboard kernel git site].<br />
<br />
First download the tools needed to compile the kernel. This took about 25 seconds.<br />
host$ '''sudo apt-get install -y git lzop gcc-arm-linux-gnueabi uboot-mkimage'''<br />
<br />
Next download the tools to get the kernel and the patches needed to make it run on the beagle. (2.5 seconds)<br />
host$ '''cd ~/BeagleBoard'''<br />
host$ '''git clone git://github.com/beagleboard/kernel.git'''<br />
host$ '''git checkout 6a7c4284a16fed3dae87f4aef78b59c902e4da84 -b beaglebone-3.2'''<br />
<br />
Next download the kernel and the patches. Before running '''./patch/sh''', take a look at it. Can you figure out what it's doing? Also look at '''patch_script.sh''', it's where the details are. The downloading/patching process takes some 39 minutes.<br />
host$ '''less patch.sh patch_script.sh'''<br />
host$ '''./patch.sh'''<br />
host$ '''cp patches/beaglebone/defconfig kernel/arch/arm/configs/beaglebone_defconfig<br />
host$ '''wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O kernel/firmware/am335x-pm-firmware.bin'''<br />
host$ '''md5sum kernel/firmware/am335x-pm-firmware.bin''' <br />
17d6a4c24d3cb720aa9ed4522cb891fc kernel/firmware/am335x-pm-firmware.bin<br />
<br />
=== compile ===<br />
Once patched you are ready to compile the kernel. The first time takes a while. Mine tool 4 minutes, but I was running on 8 cores. Set the '''-j''X'' ''' to match the number of cores you have. '''uImage''' is the kernel!<br />
host$ '''cd kernel'''<br />
host$ '''make beaglebone_defconfig'''<br />
Do the above once.<br />
<br />
host$ '''export ARCH=arm'''<br />
host$ '''export CROSS_COMPILE=arm-linux-gnueabi-'''<br />
Do the above once per terminal session.<br />
<br />
host$ '''make -j9'''<br />
host$ '''make uImage'''<br />
Do the above every time you recompile the kernel<br />
<br />
You also need all the kernel modules. Here we create a directory to install them in. (a few seconds)<br />
host$ '''mkdir ../rootfs'''<br />
host$ '''make INSTALL_MOD_PATH=../rootfs modules_install'''<br />
<br />
=== install ===<br />
Copy the kernel and the modules to the Beagle. (a minute or so)<br />
host$ '''cd ..'''<br />
host$ '''scp kernel/arch/arm/boot/uImage root@beagle:/boot/uImage-3.2.25+<br />
host$ '''cd rootfs'''<br />
host$ '''find -H -depth | cpio -o -H crc | ssh root@beagle 'cd /; cpio -id' '''<br />
<br />
Now log into the beagle and move some things around.<br />
host$ '''ssh root@beagle<br />
<br />
This will copy the kernel to the ext4 partition.<br />
beagle$ '''cd /boot'''<br />
beagle$ '''rm uImage'''<br />
beagle$ '''ln -s uImage-3.2.25+ uImage'''<br />
<br />
This will copy to the FAT partition.<br />
beagle$ '''mkdir /media/mmcblk0p1'''<br />
beagle$ '''mount /dev/mmcblk0p1 /media/mmcblk0p1'''<br />
beagle$ '''cp /boot/uImage-3.2.25+ /media/uImage'''<br />
<br />
=== reboot ===<br />
Make sure screen is running on your host so you can see the shutdown and boot processes.<br />
host$ '''sudo screen /dev/ttyUSB0 115200<br />
<br />
Then restart you beagle<br />
beagle$ '''shutdown -r now'''<br />
<br />
If all goes well you will boot into your new kernel.<br />
beagle$ '''uname -a'''<br />
Linux beaglebone 3.2.25+ #1 Fri Oct 19 11:05:28 EDT 2012 armv7l GNU/Linux<br />
<br />
== DAS U-boot ==<br />
These instructions came from [http://www.eewiki.net/display/linuxonarm/Home eewiki].<br />
<br />
=== download ===<br />
While we're at it, let's get the boot loader we'll be using. It takes some 3 minutes.<br />
<br />
host$ '''cd ~/BeagleBoard'''<br />
host$ '''git clone git://git.denx.de/u-boot.git'''<br />
host$ '''cd u-boot/'''<br />
host$ '''git checkout v2012.10-rc2 -b tmp'''<br />
<br />
=== compile ===<br />
Now configure and build. The first time takes some 4 minutes. After that it's only 5 seconds or so. (Replace '''am335x_evm_config''' with '''omap3_beagle_config''' if you are compiling for the xM.)<br />
host$ '''make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- am335x_evm_config'''<br />
host$ '''make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-'''<br />
<br />
=== install ===<br />
<br />
host$ '''scp u-boot.img root@beagle:.'''<br />
beagle$ '''mkdir /media/mmcblk0p1'''<br />
beagle$ '''mount /dev/mmcblk0p1 /media/mmcblk0p1'''<br />
beagle$ '''cd /media/mmcblk0p1'''<br />
beagle$ '''mv u-boot.img u-boot.img.orig''' # Save the working u-boot<br />
beagle$ '''cp ~/u-boot.img u-boot.img.new'''<br />
beagle$ '''cp u-boot.img.new u-boot.img'''<br />
Once installed you are ready for u-boot work.<br />
<br />
{{YoderFoot}}</div>Larmorgshttps://elinux.org/index.php?title=Adafruit:_16x24_Red_LED_Matrix_Panel&diff=183050Adafruit: 16x24 Red LED Matrix Panel2012-10-22T06:26:38Z<p>Larmorgs: </p>
<hr />
<div>[[Category:ECE497]] [[Category:Adafruit]]<br />
<br />
<pre style="color:red"><br />
Overview: 2<br />
Wiring: 2<br />
Code: 2<br />
git/Compiles with make: 2<br />
Demo: 2<br />
Total: 10<br />
Comments: Looks good. <br />
Have you been able to look into other ways besides bit banging to drive the display?<br />
</pre> <br />
<br />
[[File:16x24_LED_Matrix.jpg|500px|16x24 LED Matrix Display]]<br />
== Overview ==<br />
<br />
Adafruit's [http://www.adafruit.com/products/555 16x24 Red LED Matrix Panel] uses the [http://www.adafruit.com/datasheets/ht1632cv120.pdf HT1632C LED driver]. The driver has the ability to dim and flash and they can be chained together to produce large displays. The code developed for this Mini Project is based on Adafruit's [https://github.com/adafruit/HT1632 original HT1632 github repository] originally written for Arduino. It also uses a modified version of BoneHeader.h to support C++ originally from [https://github.com/millerap/ECE497 Andrew Miller's github repository].<br />
<br />
[[Image:Panel_Connector.jpg|thumb|right|alt=16x24 LED Matrix Display Side Connector|Back connector on the 16x24 LED Matrix Display courtesy of [http://www.adafruit.com/products/555/ adafruit]]]<br />
<br />
== Inputs and Outputs ==<br />
<br />
A single matrix panel can be powered directly off of the BeagleBone's 3.3V supply (running only on USB power). The interface is a bit-banged serial interface requiring 3 pins: chip select (active low), write clock (rising edge trigger), and data. The HT1632C also has a read pin, but it is not populated or used in the example code developed for this Mini Project.<br />
<br />
== Bone Usage ==<br />
<br />
[[Image:Bone P9 pinout.jpg|thumb|left|alt=P9 Connector Pinout|Pinout for the P9 header on the BeagleBone]]<br />
[[Image:Board_Connector.jpg|thumb|right|alt=16x24 LED Matrix Board Side Connector|Board side connector with wires attached courtesy of [http://ladyada.net/products/16x24LEDmatrix/ ladyada]]]<br />
<br />
The pin mappings<br />
<br />
P9 pin # (BeagleBone pin) -> Panel pin (wire color)<br />
<br />
1 (GND) -> GND (black)<br />
<br />
3 (VDD_3V3EXP) -> VCC (red)<br />
<br />
15 (R13/GPIO1_16) -> CS0 (white)<br />
<br />
23 (V14/GPIO1_17) -> DATA (yellow)<br />
<br />
25 (A14/GPIO3_21) -> WR (orange)<br />
<br />
<br />
=== Sample C++ Code ===<br />
<br />
The code shown below is sample code to demonstrate the 16x24 Red LED Matrix Panel.<br />
<br />
<pre><br />
#include "../Resources/adafruit/HT1632/HT1632.h"<br />
#include <stdio.h><br />
#include <unistd.h><br />
#include "icons.c"<br />
<br />
/* <br />
This is a basic demo program showing how to write to a HT1632<br />
These can be used for up to 16x24 LED matrix grids, with internal memory<br />
and using only 3 pins - data, write and select.<br />
Multiple HT1632's can share data and write pins, but need unique CS pins.<br />
*/<br />
<br />
#define DATA 117 //3_21<br />
#define WR 49 //1_17<br />
#define CS 48 //1_16<br />
<br />
void testMatrix2(HT1632LEDMatrix *matrix) {<br />
//Display "Hi"<br />
matrix->setTextSize(2);<br />
matrix->setTextColor(1);<br />
matrix->write('H');<br />
matrix->write('i');<br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
void testMatrix1(HT1632LEDMatrix *matrix) {<br />
//Display icon<br />
matrix->drawBitmap(0, 0, icon, matrix->width(), matrix->height(), 1); <br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
int main(void) {<br />
printf("Starting...\n");<br />
HT1632LEDMatrix matrix = HT1632LEDMatrix(DATA, WR, CS);<br />
matrix.begin(HT1632_COMMON_16NMOS);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test #1\n");<br />
testMatrix1(&matrix);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test2\n");<br />
testMatrix2(&matrix);<br />
<br />
printf("Done!\n");<br />
return 0;<br />
}<br />
</pre><br />
<br />
This code example and the required resources can be found in [https://github.com/larmorgs/ece497 Greg Larmore's github repository]<br />
<br />
== Updates ==<br />
<br />
A node.js implementation has been added that sends hard coded pictures to the bone. Also the driver has been switched over to use mmap for gpio writes to speed it up. Ideally the writes should occur at 500kHz now.<br />
<br />
== Future Work ==<br />
<br />
The node.js implementation should be modified to take in a .gif file. Or scrolling text could be implemented.</div>Larmorgshttps://elinux.org/index.php?title=EBC_Exercise_02_Out-of-the-Box,_Bone&diff=173672EBC Exercise 02 Out-of-the-Box, Bone2012-09-25T06:49:08Z<p>Larmorgs: /* Windows 7 */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
The BeagleBone can do many neat things right out of the box using just the USB cable and SD card that come with it. Before hooking up anything, if you are running Linux or OSX on your host computer, open a terminal at run:<br />
<br />
host$ '''ls /dev/tty* > /tmp/tty'''<br />
<br />
This will record what devices are present on you host computer. Once you plug the bone in it will create a new device. Windows users don't have to do anything here.<br />
<br />
Install the SD card (not the one that says Linux SDK on it) and attach the Bone to a host computer via the USB cable. The little USB connector goes to the Beagle in the connector on the bottom of the board near the Ethernet connector. Connect the large end of the USB cable to a host computer. The host can be either Linux, Mac, or Windows (though if you are doing development, consider running Linux on the host.) I give instructions for each.<br />
<br />
The Beagle, powered via the USB, will boot up. You should initially see two LEDs blinking, near the Ethernet connector. The one labeled '''0''' blinks a heartbeat pattern. LED '''1''' blinks when the SD card is being accessed. After about 30 seconds LED 1 will stop blinking. The Bone is booted.<br />
<br />
Here are some of the things it can do.<br />
<br />
== YouTube Introduction ==<br />
<br />
[http://www.youtube.com/watch?v=z6b4zlh0IrE&feature=bf_next&list=UUf_sAmhBw7Tj7-2ujmLFoQg Here's] a nice overview of the BeagleBone. It shows how to work with it using a Windows host.<br />
<br />
== USB Drive ==<br />
<br />
On your host you will notice a new folder appearing. On Linux and OSX it's call '''BEAGLE_BONE'''. On Windows it's '''Beagle Bone Getting Started'''. Open it up and look around. The '''README.html''' gives lots of information about getting going with the Bone. Look at it in detail after going though this page.<br />
<br />
When you are doing exploring the files, eject the drive (don't select ''SAFELY REMOVE DRIVE''). Once the drive is ejected, the network will start up over the USB.<br />
<br />
== Built in USB to serial adapter ==<br />
<br />
The Beagle xM has a serial port connector on board, but the Bone doesn't. Instead you access the serial port through the USB connector. The trick is figuring out how to access it. <br />
<br />
=== Linux, OSX ===<br />
<br />
Run the following:<br />
host$ '''ls /dev/tty* > /tmp/tty2'''<br />
host$ '''diff /tmp/tty*'''<br />
ttyUSB1<br />
host$ '''screen /dev/''ttyUSB1'' 115200''' (Linux)<br />
host$ '''screen /dev/tty.usb*B 115200''' (OSX)<br />
<br />
The first line lists what devices are out there. The second compares that list to the list made earlier. What appears is the USB to serial device on the Bone. The last line starts a serial port program that attaches to that device. Notice the ''ttyUSB1'' is the same string as returned by the diff command.<br />
<br />
=== Windows ===<br />
To find where the serial port appears in Windows, click on the start menu and search for '''Device Manager''' and run it.<br />
<br />
[[File:Device_Manager.png|300px]]<br />
<br />
Select '''Ports''' and look for USB Serial Port. In my case the port appears at '''COM6'''.<br />
<br />
[[File:Port.png|300px]]<br />
<br />
Start up a [[ECE497_Tips_and_Tricks#Serial_Port serial port]] program and connect. The baud rate is 115200.<br />
<br />
=== Logging in ===<br />
<br />
Hit RETURN and you'll see the following. Login as '''root''' and look around.<br />
<br />
.---O---. <br />
| | .-. o o <br />
| | |-----.-----.-----.| | .----..-----.-----.<br />
| | | __ | ---'| '--.| .-'| | |<br />
| | | | | |--- || --'| | | ' | | | |<br />
'---'---'--'--'--. |-----''----''--' '-----'-'-'-'<br />
-' |<br />
'---' <br />
<br />
The Angstrom Distribution beaglebone ttyO0 <br />
<br />
Angstrom v2012.01-core - Kernel 3.2.5+<br />
<br />
beaglebone login: '''root'''<br />
Last login: Fri Jul 13 01:28:06 UTC 2012 on ttyO0<br />
root@beaglebone:~#<br />
<br />
== Internet Connection ==<br />
<br />
One of the slickest features of the Bone is it's ability to access the Internet through the USB connection. The network connection starts up ''after'' you've ejected the '''BEAGLE_BONE''' drive that appears. Do it now.<br />
<br />
=== Linux ===<br />
After ejecting, run:<br />
<br />
host$ '''ifconfig'''<br />
eth0 Link encap:Ethernet HWaddr 00:18:8b:72:b8:c2 <br />
inet addr:137.112.41.109 Bcast:137.112.41.255 Mask:255.255.255.0<br />
inet6 addr: fe80::218:8bff:fe72:b8c2/64 Scope:Link<br />
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br />
RX packets:8481193 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:1871287 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000 <br />
RX bytes:3172154531 (3.1 GB) TX bytes:203188180 (203.1 MB)<br />
Interrupt:19 <br />
<br />
eth4 Link encap:Ethernet HWaddr d4:94:a1:39:ff:ff <br />
inet addr:192.168.7.1 Bcast:192.168.7.3 Mask:255.255.255.252<br />
inet6 addr: fe80::d694:a1ff:fe39:ffff/64 Scope:Link<br />
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br />
RX packets:8 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000 <br />
RX bytes:2775 (2.7 KB) TX bytes:1234 (1.2 KB)<br />
<br />
lo Link encap:Local Loopback <br />
inet addr:127.0.0.1 Mask:255.0.0.0<br />
inet6 addr: ::1/128 Scope:Host<br />
UP LOOPBACK RUNNING MTU:16436 Metric:1<br />
RX packets:37315 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:37315 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:0 <br />
RX bytes:3665320 (3.6 MB) TX bytes:3665320 (3.6 MB)<br />
You'll see at new network has appear, '''eth4''' in my case. The IP address is '''192.168.7.1'''. There's a good chance the Bone is at '''192.168.7.''2'''''. Try connecting to it.<br />
host$ '''ssh -X root@192.168.7.2'''<br />
beagle$ <br />
You are now logged into the Bone through the network. This is much faster than the serial port (.115M vs. 100M) and supports many interesting network things. The only problem is, the Beagle doesn't know how to access the Internet through the host. Get back to the host computer by entering RETURN ~ ^Z. That is, hit RETURN, then ~ (it's up there near the ESC key) and then Ctrl-Z. This gets you back to your host, but leaves the ssh connection running. <br />
<br />
Copy the following lines into a file call '''host.ipForward.sh'''<br />
<br />
<pre><br />
#!/bin/bash<br />
# These are the commands to run on the host to setup IP masquerading so the Beagle<br />
# can access the Internet through the USB connection.<br />
# Inspired by http://thoughtshubham.blogspot.com/2010/03/internet-over-usb-otg-on-beagleboard.html<br />
<br />
if [ $# -eq 0 ] ; then<br />
echo "Usage: $0 interface (such as eth0 or wlan0)"<br />
exit 1<br />
fi<br />
<br />
interface=$1<br />
hostAddr=192.168.7.1<br />
beagleAddr=192.168.7.2<br />
ip_forward=/proc/sys/net/ipv4/ip_forward<br />
<br />
if [ `cat $ip_forward` == 0 ]<br />
then<br />
echo "You need to set IP forwarding. Edit /etc/sysctl.conf using:"<br />
echo "$ sudo gedit /etc/sysctl.conf"<br />
echo "and uncomment the line \"net.ipv4.ip_forward=1\""<br />
echo "to enable forwarding of packets. Then run the following:"<br />
echo "$ sudo sysctl -p"<br />
exit 1<br />
else<br />
echo "IP forwarding is set on host."<br />
fi<br />
# Setup IP masquerading on the host<br />
sudo iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o $interface -j MASQUERADE<br />
<br />
# Check to see what nameservers the host is using and copy these to the same<br />
# file on the Beagle<br />
# This makes it so you can connect to the Beagle without using your password.<br />
ssh-copy-id root@$beagleAddr<br />
# Save the /etc/resolv.conf on the Beagle in case we mess things up.<br />
ssh root@$beagleAddr "mv -n /etc/resolv.conf /etc/resolv.conf.orig"<br />
# Copy the resolv.conf file to the Beagle. Now the Beagle will use the<br />
# same name servers as the host.<br />
cat /etc/resolv.conf - << EOF > /tmp/resolv.conf<br />
nameserver 137.112.18.59<br />
nameserver 137.112.5.28<br />
nameserver 137.112.4.196<br />
search rose-hulman.edu<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
EOF<br />
scp /tmp/resolv.conf root@$beagleAddr:/etc<br />
# Tell the beagle to use the host as the gateway.<br />
ssh root@$beagleAddr "/sbin/route add default gw $hostAddr"<br />
</pre><br />
<br />
Now run:<br />
host$ '''chmod +x host.ipForward.sh'''<br />
host$ '''./host.ipForward.sh ''eth0'''''<br />
This will give you instructions on how to set up your host and will remotely set up your Beagle.<br />
Note: If you are using a wireless connection you should use host$ '''./host.ipForward.sh ''wlan0'''''<br />
<br />
Once ./host.ipForward.sh has been run you can:<br />
host$ '''fg'''<br />
ssh -X root@192.168.7.2<br />
(Hit RETURN)<br />
beagle$ '''ping google.com'''<br />
<br />
You should see Google responding. Hit Ctrl-C to stop.<br />
<br />
''Note: If you are using Ubuntu 12.04 and having an issue connecting to the internet, you may need to add a line to the /etc/resolv.conf file on the Bone. If ping google.com returns an "unknown host" error, this means that the Bone cannot resolve the url google.com to an IP address. Users with an Ubuntu 12.04 host may see this issue because the resolv.conf that Ubuntu uses (and is copied to the Bone in the host.ipForward.sh script) is not compatible with the Bone. The solution is to run the host.ipForward script as normal, then add the line "nameserver 8.8.8.8" above the existing entry in /etc/resolv.conf (run "nano /etc/resolv.conf" on the Bone to edit the file). This configures the Bone to use [https://developers.google.com/speed/public-dns/ Google's Public DNS Server].''<br />
<br />
Congratulations! Your Beagle is now on the network through your host computer.<br />
<br />
=== OSX===<br />
After ejecting<br />
<br />
# go to '''System Preferences''' and select '''Network'''<br />
# You should see '''RNDIS/...Gadget'''. This is the network connection to the Beagle. Select it<br />
# Wait for the IP address '''192.168.7.1''' to appear<br />
# Click '''Show All''' and select '''Sharing'''<br />
# Select '''Internet Sharing'''<br />
# Select '''RNDIS/Ethernet Gadget'''<br />
<br />
In a terminal window connect to the serial port<br />
<br />
host$ '''screen /dev/ttyusb*B 115200'''<br />
beagle$ '''udhcpc -i usb0'''<br />
beagle$ '''ping google.com'''<br />
<br />
This is all nicely shown [http://www.youtube.com/watch?v=Cf9hnscbSK8&feature=youtu.be here] in this silent YouTube movie.<br />
<br />
Congratulations, you now have a connection to the Internet.<br />
<br />
=== Windows 7 ===<br />
There are several ways of running ssh on Windows 7. Below are a couple of tools that you can use.<br />
<br />
==== msysgit ====<br />
Install [http://msysgit.github.com/ msysgit]. This is a version of git for Windows based on msys (a unix like shell for Windows) which includes ssh. This solution is simple if all you need to do is connect to your bone.<br />
<br />
==== Cygwin ====<br />
Install [http://cygwin.com/ Cygwin]. There are many packages that you can install that aren't installed by default:<br />
<br />
Required<br />
# openssh<br />
<br />
Optional<br />
# make<br />
# gcc-core<br />
# gcc-g++<br />
# gdb<br />
# git<br />
<br />
This solution is more involved, but it allows you to install development tools.<br />
<br />
==== Environment Setup ====<br />
<br />
You can either run ssh from a bash terminal (i.e. '''C:\Program Files\Git\Git Bash''' or '''C:\cygwin\Cygwin.bat'''), or you can add the bin directories to your path and run from the Windows command prompt (i.e. add '''C:\Program Files\Git\bin''' or '''C:\cygwin\bin''' to your path).<br />
<br />
Note: Be careful adding multiple bin directories to your path<br />
<br />
First time setup<br />
# Run '''regedit'''<br />
# Navigate to '''Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters'''<br />
# Change '''IPEnableRouter''' from 0 to 1<br />
# Close '''regedit'''<br />
# Run '''services'''<br />
# Make sure the following are set to '''Automatic''' and are started<br />
## Routing and Remote Access<br />
## Internet Connection Sharing (ICS)<br />
<br />
==== Connecting to the Internet ====<br />
<br />
After ejecting<br />
# Navigate to '''Control Panel\Network and Internet\Network and Sharing Center\Change adapter settings'''<br />
# Right click your wired/wireless internet connection and go to '''Properties'''<br />
# Go to the '''Sharing''' tab<br />
# Check the box to '''Allow other network users to connect through this computer's Internet connection'''<br />
# Select your bone's local area connection for the '''Home networking connection''' (if you cannot choose the local area connection, turn your internet connection sharing off and then back on)<br />
<br />
Open a command prompt or bash terminal and run the following:<br />
<br />
host$ '''ping 192.168.7.2'''<br />
<br />
If this ping times out then disable and re-enable your bone's local area connection and try again. Once it works run the following:<br />
<br />
host$ '''ssh root@192.168.7.2'''<br />
<br />
Login as root and run the following:<br />
<br />
beagle$ '''echo "nameserver 8.8.8.8" > /etc/resolv.conf'''<br />
beagle$ '''echo "nameserver 8.8.8.4" >> /etc/resolv.conf'''<br />
beagle$ '''/sbin/route add default gw 192.168.7.1'''<br />
beagle$ '''ping google.com'''<br />
<br />
Congratulations, you now have a connection to the Internet.<br />
<br />
== On the Network ==<br />
<br />
Once you have your Beagle on the network there are many things you can do. Try these from your host.<br />
<br />
* Point your browser to '''192.168.7.2'''. You'll see a nice slide show about the Beagle<br />
* Point your browser to '''192.168.7.2:3000''' to see the [http://c9.io/ Cloud9 IDE] running on the Beagle<br />
<br />
{{YoderFoot}}</div>Larmorgshttps://elinux.org/index.php?title=Adafruit:_16x24_Red_LED_Matrix_Panel&diff=173462Adafruit: 16x24 Red LED Matrix Panel2012-09-24T17:26:11Z<p>Larmorgs: /* Sample C++ Code */</p>
<hr />
<div>[[Category:ECE497]] [[Category:Adafruit]]<br />
<br />
[[File:16x24_LED_Matrix.jpg|500px|16x24 LED Matrix Display]]<br />
== Overview ==<br />
<br />
Adafruit's [http://www.adafruit.com/products/555 16x24 Red LED Matrix Panel] uses the [http://www.adafruit.com/datasheets/ht1632cv120.pdf HT1632C LED driver]. The driver has the ability to dim and flash and they can be chained together to produce large displays. The code developed for this Mini Project is based on Adafruit's [https://github.com/adafruit/HT1632 original HT1632 github repository] originally written for Arduino. It also uses a modified version of BoneHeader.h to support C++ originally from [https://github.com/millerap/ECE497 Andrew Miller's github repository].<br />
<br />
[[Image:Panel_Connector.jpg|thumb|right|alt=16x24 LED Matrix Display Side Connector|Back connector on the 16x24 LED Matrix Display courtesy of [http://www.adafruit.com/products/555/ adafruit]]]<br />
<br />
== Inputs and Outputs ==<br />
<br />
A single matrix panel can be powered directly off of the BeagleBone's 3.3V supply (running only on USB power). The interface is a bit-banged serial interface requiring 3 pins: chip select (active low), write clock (rising edge trigger), and data. The HT1632C also has a read pin, but it is not populated or used in the example code developed for this Mini Project.<br />
<br />
== Bone Usage ==<br />
<br />
[[Image:Bone P9 pinout.jpg|thumb|left|alt=P9 Connector Pinout|Pinout for the P9 header on the BeagleBone]]<br />
[[Image:Board_Connector.jpg|thumb|right|alt=16x24 LED Matrix Board Side Connector|Board side connector with wires attached courtesy of [http://ladyada.net/products/16x24LEDmatrix/ ladyada]]]<br />
<br />
The pin mappings<br />
<br />
P9 pin # (BeagleBone pin) -> Panel pin (wire color)<br />
<br />
1 (GND) -> GND (black)<br />
<br />
3 (VDD_3V3EXP) -> VCC (red)<br />
<br />
15 (R13/GPIO1_16) -> CS0 (white)<br />
<br />
23 (V14/GPIO1_17) -> DATA (yellow)<br />
<br />
25 (A14/GPIO3_21) -> WR (orange)<br />
<br />
<br />
=== Sample C++ Code ===<br />
<br />
The code shown below is sample code to demonstrate the 16x24 Red LED Matrix Panel.<br />
<br />
<pre><br />
#include "../Resources/adafruit/HT1632/HT1632.h"<br />
#include <stdio.h><br />
#include <unistd.h><br />
#include "icons.c"<br />
<br />
/* <br />
This is a basic demo program showing how to write to a HT1632<br />
These can be used for up to 16x24 LED matrix grids, with internal memory<br />
and using only 3 pins - data, write and select.<br />
Multiple HT1632's can share data and write pins, but need unique CS pins.<br />
*/<br />
<br />
#define DATA 117 //3_21<br />
#define WR 49 //1_17<br />
#define CS 48 //1_16<br />
<br />
void testMatrix2(HT1632LEDMatrix *matrix) {<br />
//Display "Hi"<br />
matrix->setTextSize(2);<br />
matrix->setTextColor(1);<br />
matrix->write('H');<br />
matrix->write('i');<br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
void testMatrix1(HT1632LEDMatrix *matrix) {<br />
//Display icon<br />
matrix->drawBitmap(0, 0, icon, matrix->width(), matrix->height(), 1); <br />
matrix->writeScreen();<br />
usleep(2000000);<br />
<br />
// Blink!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
<br />
// Dim down and then up<br />
for (int8_t i = 15; i >= 0; i--) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
for (int8_t i = 0; i < 16; i++) {<br />
matrix->setBrightness(i);<br />
usleep(100000);<br />
}<br />
<br />
// Blink again!<br />
matrix->blink(true);<br />
usleep(2000000);<br />
matrix->blink(false);<br />
}<br />
<br />
int main(void) {<br />
printf("Starting...\n");<br />
HT1632LEDMatrix matrix = HT1632LEDMatrix(DATA, WR, CS);<br />
matrix.begin(HT1632_COMMON_16NMOS);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test #1\n");<br />
testMatrix1(&matrix);<br />
<br />
printf("Clear\n");<br />
matrix.clearScreen();<br />
<br />
printf("Test2\n");<br />
testMatrix2(&matrix);<br />
<br />
printf("Done!\n");<br />
return 0;<br />
}<br />
</pre><br />
<br />
This code example and the required resources can be found in [https://github.com/larmorgs/ece497 Greg Larmore's github repository]</div>Larmorgs