tag:blogger.com,1999:blog-54664080592805325162024-03-08T10:54:31.922+00:00Robotics - Vision ExperimentsAnonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.comBlogger57125tag:blogger.com,1999:blog-5466408059280532516.post-32823650075532046572015-12-16T20:55:00.002+00:002015-12-29T16:50:13.981+00:00Parallella Board Notes (WIP)SDHC cards tested;<br />
Samsung 32GB Evo MicroSDHC (UHS-I Grade 1 Class 10)<br />
SanDisk 16GB MicroSDHC (Class 4)<br />
<br />
After burning headless image to SDHC card, use Putty to connect via SSH to the board.<br />
<br />
Login to board - Username: <i>Parallella</i> Password: <i>Parallella</i><br />
<br />
Check SD card space with: <b>df -h</b><br />
<br />
Find root partition with: <b>dmesg | grep "root"</b><br />
<br />
Run fdisk to rebuilt the root partition: See <a href="https://parallella.org/forums/viewtopic.php?f=49&t=1373">https://parallella.org/forums/viewtopic.php?f=49&t=1373</a><br />
<br />
Shutdown the board with: <b>sudo shutdown -r now</b><br />
<br />
Power off the board.<br />
<br />
Power on the board and SSH login again with Putty.<br />
<br />
Resize root partition with: <b>sudo resize2fs /dev/mmcblk0p2</b><br />
<br />
Check new SD card space with: <b>df -h</b><br />
<b><br /></b>
Update system software with:<br />
<b>sudo apt-get update</b><br />
<b>sudo apt-get upgrade</b><br />
<b><br /></b>
Reboot the board: <b>sudo reboot</b><br />
<br />
Putty will lose connection. Restart putty and login (it may take time to reboot).<br />
<br />
Update super-user password (make it something that's remembered, e.g. linaro)<br />
sudo su<br />
passwd<br />
exit<br />
<br />
Setup Git with user.name and user.email<br />
https://help.github.com/articles/set-up-git/<br />
<br />
git config --global push.default simple<br />
<br />
Install cmake: sudo apt-get install cmake<br />
Optional cmake-gui: sudo apt-get install cmake-qt-gui<br />
<br />
Update cmake to latest:<br />
wget https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz<br />
tar xvf cmake-3.4.1.tar.gz<br />
cd cmake-3.4.1<br />
cmake .<br />
make<br />
sudo make install<br />
Add export CMAKE_ROOT=/usr/local/share/cmake-3.4/ to .bashrc (then shutdown and relogin)<br />
Check cmake is version 3.4: cmake --version<br />
<br />
Install eog for image viewing: sudo apt-get install eog<br />
<br />
<br />
http://www.browndeertechnology.com/docs/app_note_epiphany_parallella_build.pdf<br />
<br />
wget http://www.mr511.de/software/libelf-0.8.13.tar.gz<br />
wget http://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz<br />
wget http://www.hyperrealm.com/libconfig/libconfig-1.4.8.tar.gz<br />
<br />
Extract all and usual; ./configure ; sudo make install<br />
flex --version<br />
bison --version<br />
m4 --version<br />
<br />
echo $PATH<br />
echo $LD_LIBRARY_PATH<br />
vi .bashrc (if /usr/local/lib not in the LD_LIBRARY_PATH and relogin)<br />
<div>
<br /></div>
cd ~<br />
wget http://www.browndeertechnology.com/code/coprthr-1.6.0-parallella.tgz<br />
tar xvf coprthr-1.6.0-parallella.tgz<br />
sudo ./browndeer/scripts/uninstall_coprthr_parallella.sh<br />
sudo ./browndeer/scripts/install_coprthr_parallella.sh<br />
<br />
cd ~<br />
wget https://github.com/browndeer/coprthr/archive/v1.6.0.tar.gz<br />
tar xvf v1.6.0.tar.gz<br />
cd coprthr-1.6.0<br />
./configure --enable-epiphany --disable-clete<br />
make<br />
sudo make install<br />
mkdir work<br />
cp –R /usr/local/browndeer/examples ./work<br />
cp –R /usr/local/browndeer/test ./work<br />
cd ./work/test<br />
su (required so tests can assess /dev/mmap)<br />
export PATH=/usr/local/browndeer/bin:$PATH<br />
export LD_LIBRARY_PATH=/usr/local/browndeer/lib:/usr/local/lib:$LD_LIBRARY_PATH<br />
make quicktest<br />
exit<br />
cd ../examples/parallella/hello_opencl<br />
gcc hello_opencl.c -o hello_opencl.x -I/usr/local/browndeer/include -L/usr/local/browndeer/lib -lcoprthr -lcoprthr_opencl<br />
<div>
./hello_opencl.x</div>
<br />
Install Xming X Server for Windows - http://sourceforge.net/projects/xming/<br />
Set "Enable X11 forwarding" option in Putty -> Connection -> SSH -> X11<br />
<br />
Install SFML: sudo apt-get install libsfml-dev libsfml-graphics2 libsfml-system2 libsfml-window2 <span style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; line-height: 22.4px;">libfreetype6-dev libxcb-image0-dev libudev-dev</span><br />
<br />
Grab OpenCL cl2.hpp file from https://www.khronos.org/registry/cl/api/2.1/cl2.hpp<br />
Put the cl2.hpp into /usr/local/browndeer/include/CL directory<br />
It MUST be version from 2.1 (older versions had bad 1.1 support)<br />
<br />
To see gcc pre-processor defines: <span class="pln" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">gcc </span><span class="pun" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">-</span><span class="pln" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">dM </span><span class="pun" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">-</span><span class="pln" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">E </span><span class="pun" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">-</span><span class="pln" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pun" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;"><</span><span class="pln" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;"> </span><span class="pun" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">/</span><span class="pln" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">dev</span><span class="pun" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">/</span><span class="pln" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;">null</span><br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-81276541303714603622011-05-07T21:32:00.003+01:002011-05-07T21:34:27.854+01:00FTP Server and RedFly-Shield Socket classI have been using <a href="http://www.skewworks.com/">Skewworks</a> <a href="http://code.tinyclr.com/project/256/netmf-ftp-server/">FTP server class</a> to test my simple RedFly.Socket class. I got to a point where the FTP server was able to respond to a few FTP commands, including using 'get' to retrieve a file from the FEZ Domino SD card. But hit a snag when trying to send a file from the PC to the FTP server. It was becoming obvious that my simple implementation of a Socket class needed to have higher level functionality. Two thoughts were; implementing meaningful exception handling and function parameter checking, and hide in a lower layer the internal socket handling within the <a href="http://www.watterott.com/en/Arduino-RedFly-Shield">RedFly-Shield</a>.<br />
<br />
My search lead my to quite a few differing implementations of System.Net.Socket class library functions. Eventually I was draw to the implementation in the <a href="http://www.java2s.com/Open-Source/CSharp/2.6.4-mono-.net-core/System.Net/System/Net/Sockets/CatalogSockets.htm">OpenSource Mono .Net core</a>.<br />
<br />
I've heavily refactored the <a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly/RedFly/">RedFly.Socket class</a>, and tweaked the <a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/FTP+Server+Test/">FTP server</a> and <a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly-Tester/">RedFly-Tester solution</a> (make sure to grab at least r106 from the GoogleCode SVN repository).<br />
<br />
As of r106 of the repository, the FTP server can perform most of the commands. 'get' and 'send' are quite limited at the moment though. They are restricted by the number of bytes for a file transferred.<br />
<br />
I've got two new steps to take now -<br />
<ol><li>Try the RedFly.Socket class with other example code, such as HTTP client and server, DNS lookups, NTP sync.</li>
<li> Finally update the UART reception handling.</li>
</ol>Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com8tag:blogger.com,1999:blog-5466408059280532516.post-3559405476869866472011-04-30T23:08:00.001+01:002011-04-30T23:10:05.084+01:00RedFly-Shield Socket class and FTP ServerAfter coming back from a short vacation, I thought I'd add an update to describe my progress with the <a href="http://www.watterott.com/index.php?page=index">Watterott Electronic</a> <a href="http://www.watterott.com/en/Arduino-RedFly-Shield">RedFly-Shield</a>.<br />
<br />
In the previous blog post I describe the success I've had with setting up the C# Shield class to initialise and setup the <a href="http://www.redpinesignals.com/index.html">RedPine Signals</a> WiFi module (<a href="http://www.redpinesignals.com/Products/Modules/Connect-io-n/Wireless_Device_Server/RS9110-N-11-22.html">RS9110-N-11-22</a>). Once I was happy with this class I moved on to looking at how to support the 8 sockets on this WiFi module.<br />
<br />
<a href="http://www.skewworks.com/">Skewworks</a> had added a <a href="http://code.tinyclr.com/project/256/netmf-ftp-server/">FTP server class</a> to the code repository over at <a href="http://code.tinyclr.com/">TinyCLR.com</a> Looking through this, and other network code, it seemed obvious to create a custom Socket class for the RedFly-Shield. I started with the System.Net.Sockets class as a template and began fleshing out the necessary class functions.<br />
<br />
After implementing the bare essential Socket functions, I was surprised how quickly it was to get the FTP server class working. A nice feature of creating a new RedFly Socket class is that the only change needed to Skewwork's FTP class was the addition of the following code;<br />
<blockquote>using Socket = RedFly.RedFlySocket;</blockquote><br />
So right now the RedFlySocket classes can be used to create listening Sockets (only tested TCP ones), accept incoming connections on those sockets, and receive data from a connected host. This initial setup however is able to allow a host PC to connect to the FTP server running on a FEZ Domino, complete a handful of FTP commands (pwd, cwd, etc.), and receive a file located on the FEZ Domino SD card.<br />
<br />
A much harder task is to flesh out the RedFlySocket.Send functions. I've come across something odd with my fairly synchronous UART data reception. So now I need to work out a different strategy for handling incoming UART data from the RedPine WiFi module.<br />
<br />
Over on my GoogleCode SVN repository, revision 99 of the RedFly class library ties in with this blog post;<br />
<a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly/">http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly/</a><br />
<br />
A RedFly-Tester solution exists that creates a listening Socket on port 23, and simply acknowledges a host trying to telnet to the RedFly Shield;<br />
<a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly-Tester/">http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly-Tester/</a><br />
<br />
Revision 96 of the RedFly FTP server solution also ties in with this blog post;<br />
<a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/FTP+Server+Test/">http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/FTP+Server+Test/</a>Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-32997167244137603732011-04-17T23:21:00.009+01:002011-05-06T22:58:42.927+01:00Watterott RedFly-Shield<table style="width: auto;"><tbody>
<tr><td><div class="separator" style="clear: both; text-align: center;"><a href="https://picasaweb.google.com/lh/photo/E5G_aWVEn2ecNVMOTGLFpw?feat=embedwebsite" style="margin-left: 1em; margin-right: 1em;"><img height="300" src="https://lh4.googleusercontent.com/_IyZ0gOKvN6Q/Tam-yG-qqcI/AAAAAAAAAdg/LpxMgWca4-c/s400/P1060009.JPG" width="400" /></a></div></td></tr>
<tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: left;">From <a href="https://picasaweb.google.com/riccro/ProjectBurt?feat=embedwebsite">Project: Burt</a></td></tr>
</tbody></table><br />
<a href="http://www.watterott.com/index.php?page=index">Watterott Electronic</a> very generously sent me a new Arduino Shield they are close to releasing. It's called <a href="http://www.watterott.net/projects/redfly-shield?lang=en">RedFly-Shield</a>, and uses a <a href="http://www.redpinesignals.com/index.html">RedPine Signals</a> WiFi module (<a href="http://www.redpinesignals.com/Products/Modules/Connect-io-n/Wireless_Device_Server/RS9110-N-11-22.html">RS9110-N-11-22</a>).<br />
<br />
Here's the feature list for this WiFi module -<br />
<ul><li>Compliant to 802.11b/g and single stream 802.11n</li>
<li>Fully self-contained serial-to-wireless functionality - does not require any host processor bandwidth</li>
<li>Includes all the protocol and configuration functions required for WLAN connectivity in Open, WEP and WPA/WPA2-PSK modes of operation</li>
<li>Payload data through Serial Interface and SPI</li>
<li>Terminates TCP and UDP connections, and offers transparent serial modem functionality</li>
<li>Configuration through AT commands and SPI frames</li>
<li>Integrated antenna, frequency reference, and low-frequency clock</li>
<li>Ultra low power operation with power save modes</li>
<li>Ad-hoc and infrastructure modes for maximum deployment flexibility</li>
<li>Single supply 3.1 to 3.6 V operation</li>
<li>Certification : Module is based on RS9110-N11-02 which is certified by FCC, IC and CE.</li>
</ul><br />
Watterott have done a great job in designing this shield. Communication to the RedPine WiFi module is via standard UART using modem-like ASCII 'AT' commands. Supplied with the shield is a nicely fleshed out Wiring library and example code for the Arduino (Tweeter, HTTP client and server).<br />
<br />
I'd picked up a <a href="http://www.sparkfun.com/products/718">Sparkfun FT232RL Breakout board</a> for another project. So the first job was to use it to talk to the RedPine module. As the above picture shows it's quite straight forward to setup and snoop on the serial port.<br />
<br />
I'm currently using Windows Vista for development, so I needed to grab HyperTerminal to be able to see the UART data, and to use the Kermit protocol to transfer the latest firmware to the module. <b>NOTE:</b> I first tried using the TeraTerm supplied by GHI for use with their .Net boards, but although this looked like it can successfully transfer the firmware files to the RedPine module, the module failed to load them upon reboot. Thankfully using HyperTerminal worked fine.<br />
<br />
Although the Arduino is a wonderful module, I usually get frustrated with the development tools. Hence my current projects are focused on using a GHI FEZ Domino module, and recently their Panda module. I'd become familiar with porting Arduino Wiring code to .Net C# with the Watterott S65-Shield. So with the RedFly-Shield's quite complete Wiring library and examples, I've set about porting this across to managed C# code.<br />
<br />
Work-in-progress C# class library and testing solution can be found on Burt's GoogleCode repository (revision r92, 20th April 2011);<br />
<a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly/">http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly/</a><br />
<a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly-Tester/">http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/RedFly-Tester/</a><br />
<br />
So far I've managed to get the RedPine module; reset, obtained and decoded the firmware version and MAC address, scanning of broadcast WiFi access points (AP), joining an AP, and obtaining an IP via DHCP.<br />
<br />
Hopefully in the next week or so I can complete the port of the Wiring library and examples. Plus code up a Socket class.<br />
<br />
*Must resist Portal 2*<br />
<br />
Matt Isenhower's Blog - <a href="http://blog.ike.to/2011/03/01/microtweet/">MicroTweet - Twitter OAuth API Library for the .NET Micro Framework</a><br />
<br />
<br />
MicroLinq for the .NET Micro Framework -<a href="http://microlinq.codeplex.com/%20">MicroLinq for the .NET Micro Framework</a><br />
<br />
<a href="http://www.codeproject.com/KB/IP/dnslookupdotnet.aspx">C# .NET DNS query component</a><br />
<a href="http://code.tinyclr.com/project/256/netmf-ftp-server/">NETMF FTP SERVER</a><br />
<a href="http://code.tinyclr.com/project/306/netbios-name-server-for-wiz5100/">NETBIOS NAME SERVER FOR WIZ5100</a><br />
<a href="http://code.tinyclr.com/project/305/ntp-time-adjustement-for-wiz5100/">NTP TIME ADJUSTEMENT FOR WIZ5100</a>Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com3tag:blogger.com,1999:blog-5466408059280532516.post-48920978957943416132011-04-16T17:46:00.003+01:002011-04-16T18:09:39.681+01:00Project UpdateA pictorial update of my current projects.<br />
<br />
<table style="width: auto;"><tbody>
<tr><td><div class="separator" style="clear: both; text-align: center;"><a href="https://picasaweb.google.com/lh/photo/E5G_aWVEn2ecNVMOTGLFpw?feat=embedwebsite" style="margin-left: 1em; margin-right: 1em;"><img height="300" src="https://lh4.googleusercontent.com/_IyZ0gOKvN6Q/Tam-yG-qqcI/AAAAAAAAAdg/LpxMgWca4-c/s400/P1060009.JPG" width="400" /></a></div></td></tr>
<tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: left;">From <a href="https://picasaweb.google.com/riccro/ProjectBurt?feat=embedwebsite">Project: Burt</a></td></tr>
</tbody></table><br />
<a href="http://www.watterott.net/projects/redfly-shield?lang=en">Watterott RedFly-Shield</a> connected to a <a href="http://www.ghielectronics.com/catalog/product/133">GHI FEZ Domino</a>.<br />
Serial snooping via a <a href="http://www.sparkfun.com/products/718">Sparkfun FT232RL Breakout board</a>.<br />
<br />
<br />
<table style="width: auto;"><tbody>
<tr><td><div class="separator" style="clear: both; text-align: center;"><a href="https://picasaweb.google.com/lh/photo/B1-TsLJO51cSHaLpFVITGQ?feat=embedwebsite"><img height="300" src="https://lh3.googleusercontent.com/_IyZ0gOKvN6Q/Tam-xAsBpFI/AAAAAAAAAdc/7q-AIWhiPLw/s400/P1060006.JPG" width="400" /></a></div></td></tr>
<tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: left;">From <a href="https://picasaweb.google.com/riccro/ProjectBurt?feat=embedwebsite">Project: Burt</a></td></tr>
</tbody></table><br />
<a href="http://www.ghielectronics.com/catalog/product/135">GHI FEZ Panda</a>. Single row right-angle header allows for the Mode pin to be grounded.<br />
Double row right-angle header underneath the board exposing the JTAG interface.<br />
Not show: Olimex <a href="http://www.olimex.com/dev/arm-usb-tiny.html">ARM-USB-TINY</a> JTAG dongle.<br />
<br />
<br />
<table style="width: auto;"><tbody>
<tr><td><div class="separator" style="clear: both; text-align: center;"><a href="https://picasaweb.google.com/lh/photo/6j9yEvBWlpv9t-iZYAA9AQ?feat=embedwebsite" style="margin-left: 1em; margin-right: 1em;"><img height="400" src="https://lh3.googleusercontent.com/_IyZ0gOKvN6Q/Tam-2VjQcUI/AAAAAAAAAdw/BdkR4L7lfEk/s400/P1060010.JPG" width="300" /></a></div></td></tr>
<tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: left;">From <a href="https://picasaweb.google.com/riccro/ProjectBurt?feat=embedwebsite">Project: Burt</a></td></tr>
</tbody></table><br />
Simple Inertia sensing. I2C temperature sensor. UART and Reset control of the motor controller. Futaba servo mounted and ready to connect to a distance sensing array.Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-25114925830239193862011-02-28T13:30:00.009+00:002011-04-16T18:00:32.405+01:00RLE on the OLSWhen I started playing with the OpenBench Logic Sniffer (OLS), I came across the Run Length Encoding option in Jawi's SUMP client. The trouble was I couldn't get consistent results using it. Digging through the Dangerous Prototypes <a href="http://dangerousprototypes.com/forum/viewforum.php?f=23&sid=2809e69a3ea3347a76e7e77d92d29045">forum</a> showed some issues with RLE using the v2 firmware. Forum user 'dogsbody' has made a huge contribution <a href="http://dangerousprototypes.com/forum/viewtopic.php?f=23&t=1711">porting</a> the FPGA HDL to Verilog. Fixing up various issues with the firmware. It looks like the v3 FPGA and PIC firmware is now addressing RLE issues. Links to v3 can be found <a href="http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer#Software">here</a>. Make sure to also grab <i>at least</i> v0.9.3 SP1 of Jawi's SUMP client.<br />
<br />
Hopefully later I can repeat the previous posts testing, and see if RLE works and captures more that the ~450 micro-seconds of samples. Fingers crossed! And then, onto SPI sniffing...<br />
<br />
<table style="width: auto;"><tbody>
<tr><td><a href="https://picasaweb.google.com/lh/photo/UPKHRB7MVTcLIgQvkPp1Sg?feat=embedwebsite"><img height="300" src="https://lh4.googleusercontent.com/_IyZ0gOKvN6Q/Tam-z_KP2zI/AAAAAAAAAdk/U7UpRxjNkPo/s400/P1060003.JPG" width="400" /></a></td></tr>
<tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;">From <a href="https://picasaweb.google.com/riccro/ProjectBurt?feat=embedwebsite">Project: Burt</a></td></tr>
</tbody></table><br />
<b>UPDATE:</b> I managed to update the OLS to v3 of the PIC and FPGA firmware. Repeating the test in the previous blog post, but using RLE compression, looks like it is a lot more stable now. As expected the compression captures more than 10x the number of samples, with this simple UART test.<br />
<br />
Unfortunately it looks like the UART analysis plugin in Jawi's SUMP client hasn't been updated to cope with RLE. Sampling at 50MHz without RLE works great. But at the same sampling rate with RLE compression enabled, the UART analysis fails to properly decode the Tx data :(<br />
<br />
As you can see from the picture I have also moved to using the GHI FEZ Domino to squirt out UART data. I have put a Visual C# <a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/UART0+Squirter/">solution</a> up on my GoogleCode SVN repository that squirts data out of UART0.Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-8436307887510970952011-02-27T20:45:00.024+00:002011-04-16T17:51:21.983+01:00Getting to grips with the OpenBench Logic SnifferI haven't used a Logic Analyzer since the mid-90s. With new products on the horizon, it's starting to become something needed with this hobby work. Budget constraints have always made it difficult to justify picking up a second hand analyzer. So I was intrigued to come across the <a href="http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer">OpenBench Login Sniffer</a> (OLS). I ordered one from <a href="http://proto-pic.co.uk/">Proto-Pic</a>, here in the UK. They delivered version 1.01 of the OLS board.<br />
<br />
The first step was to make sure that the OLS was up-to-date with FPGA and PIC firmware. At the time of writing v2.12b of the OLS software is available <a href="http://gadgetforge.gadgetfactory.net/gf/project/butterflylogic/frs/">here</a>. Included is a simple application that can flash the OLS EEPROM with new FPGA bit-stream, and update the PIC firmware.<br />
<br />
The Gadget Factory has a <a href="http://www.youtube.com/user/GadgetFactoryDotNet">YouTube channel</a> with a few videos showing FPGA logic analysis and UART debugging. Setting up some UART transmission looked like the easiest way to try out the OLS, and quick to setup on the <a href="http://arduino.cc/">Arduino</a> <a href="http://arduino.cc/en/Main/ArduinoBoardDuemilanove">Deumilanove</a>.<br />
<br />
The OLS is limited with the number of samples it can record, so we need to tell the OLS when we are about to transmit over a UART line. The Arduino runs with a 16 MHz crystal, so the OLS should be able to pick up a pulse on one of the digital I/O pins.<br />
<br />
Below is the Wiring code to setup the UART on pins 2, and 3. Plus the trigger pulse output on pin 4. The <a href="http://arduiniana.org/libraries/newsoftserial/">NewSoftSerial</a> library is used to allow for higher baud rates to be tested.<br />
<blockquote><span style="font-size: xx-small;">#include <newsoftserial.h></span><br />
<span style="font-size: xx-small;">NewSoftSerial UART1(2,3); // rx,tx</span><br />
<span style="font-size: xx-small;">void setup()</span><br />
<span style="font-size: xx-small;"> pinMode(4, OUTPUT);</span><br />
<span style="font-size: xx-small;"> digitalWrite(4, LOW);</span><br />
<span style="font-size: xx-small;"> UART1.begin(115200);</span><br />
<span style="font-size: xx-small;">}</span><br />
<span style="font-size: xx-small;">void loop()</span><br />
<span style="font-size: xx-small;"> digitalWrite(4, HIGH);</span><br />
<span style="font-size: xx-small;"> digitalWrite(4, LOW);</span><br />
<span style="font-size: xx-small;"> UART1.print("hello");</span><br />
<span style="font-size: xx-small;">}</span></blockquote>This simple PDE file can be found <a href="http://code.google.com/p/burt/source/browse/trunk/Logic+Sniffer+Projects/">here</a>. Also at that SVN location is the project file used with the OLS alternative SUMP client (Jawi's version supplied with the v2.12b OLS software).<br />
<br />
I connected the OLS breakout probes to Gnd on the Arduino, and the digital I/O pins 2, 3, and 4. With the above Wiring sketch uploaded to the Arduino I was then able to start getting to grips with Jawi's Java SUMP Client. I ended up sampling at 50 MHz, and that was able to capture just over 450 micro seconds worth of data. The SUMP Client has plugins for analyzing common bus protocols. Below is the UART analysis. As you can see, the OLS managed to capture the UART Tx from the Arduino, result!!<br />
<blockquote><style type="text/css">
body { font-family: sans-serif; } table { border-width: 1px; border-spacing: 0px; border-color: gray; border-collapse: collapse; border-style: solid; margin-bottom: 15px; } table th { border-width: 1px; padding: 2px; border-style: solid; border-color: gray; background-color: #C0C0FF; text-align: left; font-weight: bold; font-family: sans-serif; } table td { border-width: 1px; padding: 2px; border-style: solid; border-color: gray; font-family: monospace; } .error { color: red; } .warning { color: orange; } .date { text-align: right; font-size: x-small; margin-bottom: 15px; } .w100 { width: 100%; } .w35 { width: 35%; } .w30 { width: 30%; } .w15 { width: 15%; } .w10 { width: 10%; } .w8 { width: 8%; } .w7 { width: 7%; }
</style><br />
<h1>UART Analysis results</h1><hr /><div class="date">Generated: 27 February 2011</div><table class="w100"><tbody>
<tr><th colspan="2">Statistics</th></tr>
<tr><td class="w30">Decoded bytes</td><td>5</td></tr>
<tr><td class="w30">Detected bus errors</td><td>0</td></tr>
<tr><td class="w30">Baudrate</td><td>230400 (exact: 122249)</td></tr>
</tbody></table><table class="w100"><thead>
<tr><th class="w30" colspan="2"></th><th class="w35" colspan="4">RxD</th><th class="w35" colspan="4">TxD</th></tr>
<tr><th class="w15">Index</th><th class="w15">Time</th><th class="w10">Hex</th><th class="w10">Bin</th><th class="w8">Dec</th><th class="w7">ASCII</th><th class="w10">Hex</th><th class="w10">Bin</th><th class="w8">Dec</th><th class="w7">ASCII</th></tr>
</thead><tbody>
<tr><td>0</td><td>23.280 μs</td><td></td><td></td><td></td><td></td><td>0x68</td><td>0b01101000</td><td>104</td><td>h</td></tr>
<tr><td>1</td><td>112.040 μs</td><td></td><td></td><td></td><td></td><td>0x65</td><td>0b01100101</td><td>101</td><td>e</td></tr>
<tr><td>2</td><td>200.780 μs</td><td></td><td></td><td></td><td></td><td>0x6c</td><td>0b01101100</td><td>108</td><td>l</td></tr>
<tr><td>3</td><td>289.520 μs</td><td></td><td></td><td></td><td></td><td>0x6c</td><td>0b01101100</td><td>108</td><td>l</td></tr>
<tr><td>4</td><td>378.280 μs</td><td></td><td></td><td></td><td></td><td>0x6f</td><td>0b01101111</td><td>111</td><td>o</td></tr>
</tbody></table></blockquote><br />
Next up SPI testing...Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-59008547494320648572011-02-23T21:36:00.003+00:002011-04-16T18:01:04.358+01:00GHI Electronics release Beta SDK, featuring RLP for all their devicesWhile away on holiday, it was a nice surprise to find out that Runtime Loadable Procedures (<a href="http://www.ghielectronics.com/beta_01979/Library%20Documentation/Index.html">RLP</a>) are now possible on the <a href="http://www.tinyclr.com/hardware/1/fez-domino/">FEZ Domino</a> (via a <a href="http://www.tinyclr.com/forum/12/2491/">Beta SDK</a>). Time to find some time to write Native driver code for that LS020 LCD controller :)Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-68483537391049560792011-02-13T11:36:00.001+00:002011-02-14T10:10:46.808+00:00Watterott S65-Shield with FEZ DominoI was looking a while back at Arduino LCD shields, and came across the <a href="http://www.watterott.net/projects/s65-shield?lang=en">Watterott S65-Shield</a>. A quote from their website describes the shield as;<br />
<blockquote>The S65-Shield is a plug-on module with color TFT-Display (176x132), microSD socket and rotary encoder for <a href="http://www.arduino.cc/">Arduino</a> Uno, Duemilanove, Diecimila and Mega Boards</blockquote>They chose to use a LCD module from a Siemens S65 mobile phone. This LCD module can be found with three different display controllers. The S65-Shield I got from Watterott contains the LS020 controller.<br />
<br />
A recent check of the <a href="http://www.watterott.com/">Watterott website</a> shows that this shield is no longer available. They have upgraded their <a href="http://watterott.net/projects/mi0283qt2?lang=en">Arduino LCD shield</a> to use a Multi-Inno MI0283QT-2 TFT-Display and a TI ADS7846 Touch-Controller .<br />
<br />
Fortunately, a variety of people have already worked on reverse engineering the LS020 LCD module. In particular -<br />
<ul><li><a href="http://www.superkranz.de/christian/S65_Display/DisplayProgramming.html">Programming the S65 Displays</a>, by Christian Kranz, and <a href="http://www.superkranz.de/christian/S65_Display/DisplayIndex.html">Using the Siemens S65-Display</a></li>
<li>Further work over at <a href="http://www.juras-projects.org/eng/lcd.php">Juraś-Projects</a></li>
<li>And possibly the original very long forum post started by Christian <a href="http://www.mikrocontroller.net/topic/31403">here</a></li>
</ul><a href="http://code.google.com/p/burt/source/browse/trunk/Arduino+Sketchbook/S65_Shield/">Stephan Watterott</a> and <a href="http://juras.yourbb.be/viewforum.php?f=2">Juraś </a>supply Arduino library and code samples to get this shield up and running. So it felt challenging to try this shield out on the FEZ Domino.<br />
<br />
The last time I dealt with writing low-level driver code for single pixel addressable LCD controllers was many years ago. Lots of fond memories and tricks came flooding back. Porting other peoples work to a new language and embedded environment is the easy part. Hopefully others can take further advances thanks to the port and the reverse engineering by many others that forms the basis of this port.<br />
<br />
I started first by porting Watterott's library code. Configuring the SPI bus and LS020 controller was quite straightforward to set up. The first expected challenge came from managed code loops within the clear screen (or area) function. Writing single pixels out over the SPI bus using a double for-loop is slow. To reduce delays throwing pixel data over to the LS020, I adopted a line buffer write approach. I did some performance profiling a while ago and recall getting a full clear screen down to around 33 microseconds. Not great, but showed the type of optimisation work required to speed up the ported Watterott Arduino library code. I managed to speed up quite a few library functions, but then got distracted by Juraś work on driving the LS020.<br />
<br />
One of the examples Juraś has on his forum does a nice job of showing off the other display addressing modes that the LS020 supports. Two eight bit modes and a 16 bit mode. Watterott's code relies on 16 bit display addressing, whereas Juraś opted for an 8 bit mode. With an unoptimised port of the forum example code, it's plain to see that an 8 bit mode has more potential when coupled with managed code.<br />
<br />
A future challenge coupled with optimising the low level LS020 driver code, is adding higher level functionality. The usual tricks involving dirty rectangle tracking and handling, bit blitting bitmaps that have been converted to tie in with the pixel addressing mode, etc.<br />
<br />
C# library and example code for this port can be found <a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/S65_Shield/">here</a> and <a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/S65_Shield_ExampleUsage/">here</a>. It's also over on Fezzer.com <a href="http://www.fezzer.com/project/238/s65-shield/">here</a>.<br />
<br />
With the arrival of a second Protoshield this week, I'm now moving on to look at the IMU side of Burt.Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com2tag:blogger.com,1999:blog-5466408059280532516.post-19329949893652867442011-02-05T17:47:00.001+00:002011-02-06T12:05:44.148+00:00Sparkfun WiFly shield with FEZ DominoAfter getting the Motor Controller interfacing completed I decided to join the few others that were developing an interface between the <a href="http://www.tinyclr.com/hardware/1/fez-domino/">FEZ Domino</a> and the <a href="http://www.sparkfun.com/products/9367">Sparkfun WiFly shield</a>.<br />
<br />
The class libraries and firmware from <a href="http://www.ghielectronics.com/">GHI</a> and Microsoft are limited in what devices they support. Unfortunately the WiFly shield is not catered for yet. So we need to create Managed code to drive this shield on the FEZ Domino.<br />
<br />
It's a different story with the <a href="http://www.tinyclr.com/hardware/16/fez-panda/">FEZ Panda</a> and the ability to add Native code to custom firmware (at the expense of GHI Native code assemblies). I'm curious as to whether the Panda can have a TinyCLR build reflashed via JTAG and OpenOCD considering Code Read Protection is enabled in the LPC2388. You can bypass this procedure and purchase a CRP disabled board straight from GHI.<br />
<br />
The first step was to make the WiFly shield pin compatible with the FEZ Domino. Others on the <a href="http://www.tinyclr.com/forum/4/294/">TinyCLR.com forum</a> had found a number of ways to do this. I opted for adding a diode between the 5V and Vin pins. This would allow me to use USB to power the Domino and Wifly shield, plus the option of running the Domino from an external power source.<br />
<br />
The next step was to sort out the code to handle the SPI to UART bridge. Getting the signal and startup sequence nailed others had managed to deal with. So it was fairly quick to get the <a href="http://www.rovingnetworks.com/wifly-gsx.php">WiFly-GSX</a> chip into it's command mode.<br />
<br />
Once in command mode the lengthier task was then getting the UART to talk properly, and deciding what state to get to with the WiFly-GSX initialisation and WLAN connection configurations.<br />
<br />
I created a custom class library for all of this. This source code, and example usage code, can be found over at <a href="http://www.fezzer.com/project/168/sparkfun-wifly-shield-with-fez-domino/">Fezzer.com (Sparkfun WiFly shield with FEZ Domino)</a>.Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com1tag:blogger.com,1999:blog-5466408059280532516.post-55231165906105858812011-02-05T17:01:00.004+00:002011-04-16T18:05:24.649+01:00FEZ Domino<div class="separator" style="clear: both; text-align: center;"><a href="http://www.ghielectronics.com/images/catalog/133-0_large.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="http://www.ghielectronics.com/images/catalog/133-0_large.jpg" width="320" /></a></div>A few months ago now I was drawn to the relatively new <a href="http://www.arduino.cc/">Arduino</a> semi-compatible boards capable of running <a href="http://www.microsoft.com/netmf/about/default.mspx">.Net MicroFramework</a> managed code. With a rich feature list I opted for the <a href="http://www.tinyclr.com/downloads/Domino/Broch_FEZ_Domino.pdf">FEZ Domino</a> and grabbed one from a local supplier. Curious to see how an ARM core would handle the CLR and managed code.<br />
<br />
The design of the <a href="http://www.tinyclr.com/hardware/1/fez-domino/">Domino</a> is very nice. There are key differences between it and an Arduino, particularly on the IO lines. So you need to be wary when using Arduino shields with the Domino.<br />
<br />
As for key features, here is a list from the <a href="http://www.ghielectronics.com/downloads/FEZ/FEZ_Tutorial.pdf">FEZ Tutorial PDF</a>;<br />
<ol><li> Lowest cost at available features!</li>
<li>Runs Microsoft's .NET Micro Framework 4.0.</li>
<li>Uses Free Visual C# 2008 express.</li>
<li>Run time debugging over USB or serial.</li>
<li>Program in modern managed language.</li>
<li>32-bit ARM processor, running at 72Mhz.</li>
<li>FAT file system for storage on SD cards and USB memory devices.</li>
<li>Easy upgrades to high end systems like ChipworkX or Embedded Master.</li>
<li>The FEZ core, USBizi, is widely used in commercial applications around the world.</li>
<li>RunTime Loadable Procedures </li>
</ol>After using Microsoft Visual Studio products for over a decade. One beautiful feature is the use of the free <a href="http://www.microsoft.com/express/">Express Edition</a> as an IDE, and single-step debugger! As well as a feature rich class library in the <a href="http://www.microsoft.com/netmf/default.mspx">Microsoft .Net MF</a> framework.<br />
<br />
My first task was to develop the interface between the <a href="http://www.sparkfun.com/products/9571">SparkFun ROB-09571</a> Motor Controller and the FEZ Domino. This turned out to be incredibly easy thanks to the breakout of a second UART to the Domino's EXT edge connector. Three female to female connecting wires hooked up TX, RX, and Gnd. The Domino's System.IO.Ports.SerialPort class can then be used to setup and communicate with the Motor Controller. I also hooked up digital pin 10 (FEZ_Pin.Digital.Di10) to the reset line on the Motor Controller. The MotorTest Visual C# solution can be found <a href="http://code.google.com/p/burt/source/browse/trunk/FEZ+Domino+Projects/MotorTest/">here</a> (revision r62).Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-19440138406036793582011-02-05T16:28:00.002+00:002011-02-14T10:09:32.292+00:00Modified firmware for the Sparkfun ROB-09571The Sparkfun <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9571"><span style="font-style: italic;">Serial Controlled Motor Driver</span></a> contains adequate firmware code for most purposes, but is begging to be tweaked. <br />
<br />
The latest version in my GoogleCode SVN repository can be found <a href="http://code.google.com/p/burt/source/browse/trunk/Hardware/Motors/Firmware/">here</a> (revision r59).<br />
<br />
Changes in this firmware are;<br />
<br />
<ul><li>CURRENT_THRESHOLD has been increased from 150 to 300<br />
</li>
<li>Motor current monitoring interrupt code now changes the Sense LEDs based on the ADC</li>
<li>The command buffer has been modified to accept 'b' as a command (Used to start both motors at a specified speed and direction)</li>
<li>The speed command is now 16 bits. It is decoded into the OCR1 register directly.</li>
<li>The UART reply from a command now passes back both Sense current readings from the ADC.</li>
</ul>Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-84882177288326078672010-10-16T15:21:00.013+01:002010-12-19T13:52:37.609+00:00Re-programming the ROB-09571 (Serial Controlled Motor Driver)Sparkfun's <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9571"><span style="font-style: italic;">Serial Controlled Motor Driver</span></a> is a lovely board. It has been working great in Project: Burt. One thing I've been meaning to do though is to change the firmware it is supplied with. Various comments suggests that this is possible with an Arduino, so I spent the morning having a look into this.<br />
<br />
The first thing is to get the <a href="http://www.sparkfun.com/datasheets/Robotics/SerialDualMotorDriver-v12.zip">firmware</a> re-compiled. For that we need to download and unzip the firmware supplied by Sparkfun. Inside the zip file are three files; main.c, main.h, and a Makefile. The Makefile points to using WinAVR to rebuild this code. A quick trip via the <a href="http://winavr.sourceforge.net/">WinAVR website</a>, takes us to the download location on SourceForge. I used the latest installer file called <a class=" ext_exe dload filename { url: 'http://downloads.sourceforge.net/project/winavr/WinAVR/20100110/WinAVR-20100110-install.exe?r=http%3A%2F%2Fwinavr.sourceforge.net%2Fdownload.html&ts=1287239366' }" href="http://sourceforge.net/projects/winavr/files/WinAVR/20100110/WinAVR-20100110-install.exe/download" title="/WinAVR/20100110/WinAVR-20100110-install.exe: released on 2010-01-20">WinAVR-20100110-install.exe</a> Choosing the default install options, and making sure that the PATH environment variable was updated.<br />
<br />
Opening up a cmd prompt and navigating to the unzipped firmware, it was then a simple case of using 'make clean' to verify that WinAVR was installed ok. Then 'make all' to rebuild the firmware. From the resulting files we only need the main.hex and main.eep files. These contain the hex dump ready for uploading to flash memory, and the EPROM (eep) file ready to burn into the ROB-09571.<br />
<br />
So far so good. The next step was working out how to turn an Arduino into an AVR ISP programmer.<br />
<br />
Looking at the Deumilanove and the ROB-09571, they both have ICSP headers breaking out the SPI lines.<br />
<br />
<div style="text-align: center;"><a href="http://picasaweb.google.com/lh/photo/WpQTcizmhesKof-pw7Lv9A?feat=embedwebsite"><img height="300" src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TLmmc49fohI/AAAAAAAAAbM/cwgApIswbNE/s400/P1040971.JPG" width="400" /></a></div><br />
On the Duemilanove the 6-pin header is clearly labelled. On the ROB-09571 you need to solder on a header (in my case, design of Project: Burt restricted me to a two row right angle header). On both boards pin 1 is conveniently labelled (top left of each header). A quick look at the <a href="http://arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf">Deumilanove schematic</a> and <a href="http://www.sparkfun.com/datasheets/Robotics/ROB-09571-Serial%20Controlled%20Dual%20Motor%20Driver%20-%20v11.pdf">ROB-09571 schematic</a> shows that all the neccesary ICSP lines are connected to the 328p ICs. So it should be a simple case of connected pin 1 to pin 1, pin 2 to pin 2, etc. That sounds far too easy, and it is :)<br />
<br />
Next is what code do we need to upload to the Arduino. I'm currently using version 018 of the <a href="http://arduino.cc/en/Main/Software">Arduino SDK</a> Included is a sketch called <a href="http://code.google.com/p/mega-isp/">ArduinoISP</a>. Looking at this code, it recommends adding three LEDs (and current limiting resistors) to three of the Arduino digital pins. A <a href="http://www.ladyada.net/learn/arduino/lesson3.html">tutorial</a> describing how to connect the LEDs to an Arduino can be found over at LadyAda. Below is my initial wiring setup.<br />
<br />
<div style="text-align: center;"><span style="font-weight: bold;">BEWARE</span>: This wiring setup will never work! Read on for why it doesn't work.</div><br />
<div style="text-align: center;"><a href="http://picasaweb.google.com/lh/photo/OU6Xf7woX9SxqDbIczx1Hg?feat=embedwebsite"><img height="300" src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TLmmXSidCeI/AAAAAAAAAbE/-DhIsHC175U/s400/P1040968.JPG" width="400" /></a></div><br />
<br />
All three LEDs use 470 ohm resistors to limit current, connected with a common ground (blue wire). The green LED is connected to D9 (green wire), the red LED connects to D8 (red wire), and the yellow LED connects to D7 (white wire). These LEDs are used by the ArduinoISP sketch to inform you of progress and/or errors. The six green wires connect the two ICSP headers.<br />
<br />
Uploading the ArduinoISP sketch to the Duemilanove we are now ready to try reflashing the ROB-09571. <span style="font-weight: bold;">But WAIT!!</span> One vital wire is in the wrong place!!<br />
<br />
Looking at the <a href="http://arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf">Duemilanove schematic</a> it clearly shows that pin 5 of the ICSP header is connected to the 328p RESET pin! This is fine to reset all boards connected via ICSP, but the ArduinoISP sketch requires a seperate <span style="font-style: italic;">slave reset</span>. A quick fix is to disconnect the green wire to pin 5 of the ICSP header, and connect D10 from the Arduino to pin 5 ICSP header on the ROB-09571. This now agrees with the expected wiring connections in the ArduinoISP sketch. An alternative is not to use the ICSP header, and connect to D10, D11, D12, and D13 on the Arduino.<br />
<br />
At last. A correct wiring setup! Now it's time to flash that hex file.<br />
<br />
<div style="text-align: center;"><a href="http://picasaweb.google.com/lh/photo/4VGK_aMhUOwUkQfL_dKf8w?feat=embedwebsite"><img height="300" src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TLmmnISewxI/AAAAAAAAAbY/romLro3JfZg/s400/P1040981.JPG" width="400" /></a></div><br />
<br />
We now need to use a program supplied with WinAVR called AVRDude. This communicates with the ArduinoISP sketch, and uploads the hex file to the ROB-09571.<br />
<br />
The first thing we need to do is test that the Arduino, plus ArduinoISP sketch, and the wiring is working ok. Use the following cmd prompt line (changing <span style="font-style: italic;">com21</span> to the port you have your Arduino connected);<br />
<blockquote><span style="font-size: 85%;">avrdude -p m328p -P com21 -b 19200 -c avrisp -v</span></blockquote>You should eventually see;<br />
<blockquote><span style="font-size: 85%;">avrdude: AVR device initialized and ready to accept instructions</span></blockquote>If you receive any form of errors (protocol, sync, etc.), check your wiring.<br />
<br />
We are now ready to upload our new ROB-09571 firmware. We can simply use the following commands;<br />
<blockquote><span style="font-size: 85%;">avrdude -p m328p -P com21 -b 19200 -c avrisp -v -U flash:w:main.hex<br />
avrdude -p m328p -P com21 -b 19200 -c avrisp -v -U eeprom:w:main.eep</span></blockquote>AVRDude prints out some nice progress text. And the yellow LED should flash rapidly when the programming occurs.<br />
<br />
When AVRDude has finished succesfully, you then have completed uploading new firmware to the ROB-09571 :)Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com8tag:blogger.com,1999:blog-5466408059280532516.post-91184147355468760252010-06-27T14:37:00.008+01:002010-06-27T19:30:31.000+01:00Project: Burt - Assembly #3 Motor Interfacing (Part 2/2)Now that we have the motor controller breakout board, and chassis insulation, we can fix in the Serial Motor Controller board.<br /><br />A small plastic 'pop' rivet came as a spare with the chassis kit. With the millimeters of thickness added by the insulation layers, it snuggly hugs the controller board when fastened in place.<br /><br /><div style="text-align: center;"><a href="http://picasaweb.google.co.uk/lh/photo/sBD9HuIcZAgA0zg9saDfvg?feat=embedwebsite"><img src="http://lh3.ggpht.com/_IyZ0gOKvN6Q/TCdQkOYT6CI/AAAAAAAAAZc/8LT1YevuoNA/s288/P1040917.JPG" /></a> <a href="http://picasaweb.google.co.uk/lh/photo/CsGLad34CpmIMMeiurvGQA?feat=embedwebsite"><img src="http://lh6.ggpht.com/_IyZ0gOKvN6Q/TCdQpYxZ_gI/AAAAAAAAAZk/nlZqY7Xeouo/s288/P1040920.JPG" /></a><br /><br /><a href="http://picasaweb.google.co.uk/lh/photo/oJiFQeEX4lrdw6xHLWKFfQ?feat=embedwebsite"><img src="http://lh6.ggpht.com/_IyZ0gOKvN6Q/TCdQuu9kcYI/AAAAAAAAAZo/p-JRtcg3HJ8/s288/P1040922.JPG" /></a> <a href="http://picasaweb.google.co.uk/lh/photo/8UxYzuAcfd3gvrrS_H707g?feat=embedwebsite"><img src="http://lh3.ggpht.com/_IyZ0gOKvN6Q/TCdQ71xw7nI/AAAAAAAAAZ4/HMXE05fsHcA/s288/P1040935.JPG" /></a></div><br /><br />Next we can add the Deumilanove board and route the IR sensor wires into the ScrewShield.<br /><br /><div style="text-align: center;"><a href="http://picasaweb.google.co.uk/lh/photo/XJxSBNvJPRYjt6Q0N9kzjg?feat=embedwebsite"><img src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TCdRAWQDsOI/AAAAAAAAAaA/Qx4p6NaMYCs/s400/P1040938.JPG" /></a><br /></div><br />Now for the rest of the Arduino stack. The three yellow wires (male to female leads) connect the Motor Controller TX, RX, and Gnd to the Arduino D2, D3, and Gnd. A WIP <a href="http://code.google.com/p/burt/source/browse/trunk/Testing/Motors/Motors.pde">PDE file</a> (Note 1) has been uploaded. The <a href="http://www.youtube.com/watch?v=blogH3vmHFM">video</a> below shows this simple test code running. The code uses the <a href="http://arduiniana.org/libraries/newsoftserial/">NewSoftSerial</a> library from Mikal Hart. This allows us to use the appropriate baud rate (115200) to communicate with the motor controller.<br /><br /><div style="text-align: center;"><a href="http://picasaweb.google.co.uk/lh/photo/k_5DrgQi7Aj0Ep5vy_BoUg?feat=embedwebsite"><img src="http://lh5.ggpht.com/_IyZ0gOKvN6Q/TCdRFvVXBnI/AAAAAAAAAaE/4xuAoSbyXeE/s288/P1040943.JPG" /></a> <a href="http://picasaweb.google.co.uk/lh/photo/ENwmLcf4egzp1pSWG1SpdA?feat=embedwebsite"><img src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TCdRKB2cFfI/AAAAAAAAAaM/Ko0jfGyM2nc/s288/P1040945.JPG" /></a></div><br /><br /><div style="text-align: center;">Everything squeezes in nicely.<br /></div><br /><div style="text-align: center;"><a href="http://picasaweb.google.co.uk/lh/photo/MAg5NwbTjoxuVzBe8oAcMw?feat=embedwebsite"><img src="http://lh3.ggpht.com/_IyZ0gOKvN6Q/TCdRPXTyt-I/AAAAAAAAAaQ/WHDtzs2k1ic/s400/P1040946.JPG" /></a><br /></div><br />Here is Burt moving around. The uploaded PDE code rotates the tracks and moves forward and backward. It clatters and drifts about on the smooth floor.<br /><br /><div style="text-align: center;"><object height="344" width="425"><embed src="http://www.youtube-nocookie.com/v/blogH3vmHFM&hl=en_GB&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"></embed></object></div><br />The current (original) firmware in the motor controller only accepts 9 different speeds per motor. So I need to change the code to ramp up to a certain speed (or reprogram the motor controller firmware, ideally).<br /><br />I've also removed the Pololu power switch from the breadboard, with it in place and hooked up it does provide smoother power on switching. So I'll likely add it back in, or swap it out to try passive filtering of the IR sensor signal. Alternatively I could hook in the spare button on the ProtoShield. Add code into the setup() function that waits for the button press before dropping into the main loop() function.<br /><br />Even with the accelerometer detecting the motion of the chassis, my current thoughts (in relation to the motion and drift) is to upgrade the accelerometer breakout board with a 6DOF IMU (including compass/gyroscope).<br /><br />Smoothing the motion and clatter needs some thoughts. The CMUCam3 shifts the centre of gravity quite high, helping to exagerate the movement of the camera and servo frame. Without smooth motion, object tracking with the CMUCam3 is likely to be bothersome..<br /><br />Notes:<br />1 - SVN revision r41 (at the time of writing)Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-80138459090294848892010-06-26T21:40:00.015+01:002010-06-27T19:15:58.803+01:00Project: Burt - Assembly #3 Motor Interfacing (Part 1/2)It's time to look deeper into adding the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9571">Serial Motor Controller</a>. A couple of custom items need fabricating.<div><br /><center><table style="width: auto;"><tbody><tr><td><a href="http://picasaweb.google.com/lh/photo/2I9V8SAHDYbplnlForNViA?feat=embedwebsite"><img src="http://lh6.ggpht.com/_IyZ0gOKvN6Q/TCZgyrFFM-I/AAAAAAAAAXk/pl289Qgwwxg/s400/P1040891.JPG" /></a></td></tr><tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;">From <a href="http://picasaweb.google.com/riccro/ProjectBurt?feat=embedwebsite">Project: Burt</a></td></tr></tbody></table></center><br />The first job was to add some insulation between the motor controller board and the chassis. <div>A local <a href="http://www.rcmodels.org/shops.htm">RC Models Shop</a> had some thin perspex sheets that are ideal for snipping and drilling. </div><div>With a simple paper template used to get the area right. Four holes were made to help it align over the battery containers <a href="http://www.robotshop.ca/robotshop-rover-arduino-package-contents.html">screws and rivet</a>. Taped down that sucker is not moving.<br /><br /><div style="text-align: center;"><a href="http://picasaweb.google.com/lh/photo/P7h-Kxe0kphKqzIrxV9aqg?feat=embedwebsite"><img src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TCZhb8kmuCI/AAAAAAAAAX0/-EtLT-tiOCE/s400/P1040897.JPG" /></a><br /><br /><a href="http://picasaweb.google.com/lh/photo/-FApX5jE_cVKXkLFh9YUsA?feat=embedwebsite"><img src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TCZhW18e39I/AAAAAAAAAXw/zujbhmPeUGA/s288/P1040896.JPG" /></a><a href="http://picasaweb.google.com/lh/photo/xgnk_Rhm4Kl3HSFI_sI6Hg?feat=embedwebsite"><img src="http://lh3.ggpht.com/_IyZ0gOKvN6Q/TCZhR-9t3vI/AAAAAAAAAXo/feBlH0mgCUM/s288/P1040893.JPG" /></a></div><br />The second item is a small strip board to connect the motor wires, motor power, and Arduino digital IO pins (for TX, RX, and Gnd). I've added one of the blocks from the <a href="http://wingshieldindustries.com/products/screwshield/">ScrewShield</a> to take in the 9V battery wires. The four motor wires connect to this strip board. The 9V lines feed into Gnd, and into Vcc via a switch plus LED (and resistor). Jumper wires routed underneath the switch make this the Off position. When toggled, it will be easy to trip this kill switch, and drain the power to the motor controller.<br /><br /><div style="text-align: center;"><a href="http://picasaweb.google.com/lh/photo/QvWrk3XQ5lGIUxCjDGxNIg?feat=embedwebsite"><img src="http://lh5.ggpht.com/_IyZ0gOKvN6Q/TCZhmwu_JII/AAAAAAAAAYA/lbjiICS33xU/s400/P1040899.JPG" /></a></div><br />I've added a <a href="http://wingshieldindustries.com/products/screwshield/">ScrewShield</a> to help with other interfacing. The three wires from the IR sensor (Vo, Gnd, Vcc) are hooked up (A2, Gnd, 5V).<br /><br /><div style="text-align: center;"><a href="http://picasaweb.google.com/lh/photo/upp74mctnmIAprp6lV10Cw?feat=embedwebsite"><img src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TCZhxHlZPtI/AAAAAAAAAYM/uxJGr7Ljo5Y/s288/P1040906.JPG" /></a><a href="http://picasaweb.google.com/lh/photo/1QYQBCytuUfv0hfK75w-tg?feat=embedwebsite"><img src="http://lh3.ggpht.com/_IyZ0gOKvN6Q/TCZh0_nRbTI/AAAAAAAAAYU/6YO5H7JQehE/s288/P1040912.JPG" /></a></div><br />Plus the addition of the CMUCam3 :)<br /><br />Tomorrow I'll be posting the second part, along with a video of Burt coming to life :D</div></div>Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-3751126564920465622010-06-26T19:46:00.010+01:002010-06-27T18:44:38.855+01:00Project: Burt - Assembly #2 SensorsOnto my second <a href="http://www.youtube.com/watch?v=gzw5PHlFuuY">video</a> showing the next assembly step.<br />(Head to 1:25 in the video to skip to the breadboard layout)<br /><div style="text-align: center;"><object style="background-image: url("http://i4.ytimg.com/vi/gzw5PHlFuuY/hqdefault.jpg");" height="344" width="425"><param name="movie" value="http://www.youtube.com/v/gzw5PHlFuuY&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/gzw5PHlFuuY&hl=en_US&fs=1" allowscriptaccess="never" allowfullscreen="true" wmode="transparent" type="application/x-shockwave-flash" height="344" width="425"></embed></object></div><br /><br />I've assembled and added a ProtoShield, partially using atomicsalad's guide <a href="http://www.atomicsalad.com/archive/2007/03/11/tutorial_sparkfun_protoshield_assembly_use.php">here</a>. <span style="font-weight: bold;">NOTE:</span> The usual way to assemble this shield, is to have the female to male connectors aligned with the others in the Arduino stack. I have changed this so that they line up next to the breakboard, and used male headers to connect to the <a href="http://arduino.cc/en/Main/ArduinoBoardDuemilanove">Duemilanove</a>. The height of this shield, with a breadboard and breakout boards, ensures that this will be at the top of the Arduino stack. Which won't be a problem, getting too high will shift the centre of balance.<br /><br />The breakboard nicely fits the <a href="http://www.pololu.com/catalog/product/751">Pololu Power Switch LV</a> and <a href="http://www.dimensionengineering.com/DE-ACCM2G.htm">Digital Dimensions accelerometer</a> breakout boards.<br /><br />The power switch was bought out of impulse. I only noticed during assembly that it is the LV version, Doh! It's too soon to work out the power consumption for the Arduino and sensors. So right now it's just there for testing. If the digital side of Burt can handle the 4x AAA 1.5V batteries, then I could use the switch (to power on the stack, and digitally power off the stack).<br /><br />After years of practice and a lot of patience, my Google'ing turned up a fantastic practical discussion of accelerometers by Starlino.com - "<a href="http://starlino.com/accelerometers_review.html">Accelerometers reviewed and tested. Part 1: DE-ACCM2G (ADXL322), LIS244AL, Pololu MMA7260QT</a>".<br /><br />I bought the <a href="http://www.dimensionengineering.com/DE-ACCM2G.htm">DE-ACCM2G</a> board a few years back. Digital Dimensions have updated that product to a newer <a href="http://en.wikipedia.org/wiki/Microelectromechanical_systems">MEMS</a> part since then. But thankfully for me I have the ADXL322 chip on my DE-ACCM2G board which fits in with Starlino's testing.<br /><br />For those that wish to dig further into the depths of MEMS response and filter issues, Starlino has a follow up post entitled "<a href="http://starlino.com/accelerometers_review_part2.html">Accelerometer benchmarks. Part 2: LIS331AL and DE-ACCM2G (ADXL322). Filters, amplifiers and vibration response</a>".<br /><br />I've uploaded Work-In-Progress (WIP) <a href="http://code.google.com/p/burt/source/browse/trunk/Testing/ADXL322/ADXL322.pde">PDE code</a> that grabs data back from the ADXL322. (See Note 1 below for SVN version numbering)<br /><br />Seeing how stable the data is, backed up with Starlino's analysis, was wonderful to see. After working on a few Nintendo Wii game contracts, I was familiar with analysing the ADXL322 feedback from the <a href="http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=43&page=">WiiMote</a>. But comparing what I remember about the WiiMote data and the buffered data it certainly is poles apart. So much cleaner. It also will save valuable cycle time not having to implement software filtering for this signal line, Result! I can now just play with thresholding the values to deduce what the chassis thinks it's doing, in relation to what the motor controller thinks :)<br /><br />Next up is the testing of the IR sensor. The Sharp IR sensor is hooked up to Analog pin 2 (Vo), Ground (Gnd), and 5V (Vcc) lines. More WIP <a href="http://code.google.com/p/burt/source/browse/trunk/Testing/IRSensor/IRSensor.pde">PDE code</a> (Note2) (and more <a href="http://code.google.com/p/burt/source/browse/trunk/Burt.pde">here</a>) (Note3) has been uploaded that tests the analog reading and converts it to an approximated distance value. The distance conversion function is described in this <a href="http://oomlout.com/">Oomlout.com</a> <a href="http://oomlout.com/PROX/PROX-Guide.pdf">PDF guide</a>. Initial testing shows the sensor sending back sensible values. Further testing is required with the IR sensor data. I'm curious to see how software filtering compares to passive filtering. Theirs certainly spare breadboard lines that could be used for it.<br /><br />Right, time to look at hooking up the motor controller...<br /><br />Notes:<br />1 - SVN version r35 (at the time of writing)<br />2 - SVN version r38<br />3 - SVN version r40<br /><br /><a href="http://picasaweb.google.com/lh/photo/nUsPXIR0yftpdOiuCSEPfQ?feat=blogger" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img src="http://lh4.ggpht.com/_IyZ0gOKvN6Q/TCZifWdMStI/AAAAAAAAAY0/bSWWt2hefMk/s512/P1040888.JPG" border="0" /></a>Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-76173688934229597262010-06-13T18:50:00.013+01:002010-06-27T18:41:59.122+01:00Project: Burt - Assembly #1 Chassis<a href="http://www.youtube.com/watch?v=VgWd517uwBo">Here's</a> a short video showing the initial chassis assembly.<br /><br /><div style="text-align: center;"><object height="344" width="425"><param name="movie" value="http://www.youtube-nocookie.com/v/VgWd517uwBo&hl=en_GB&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube-nocookie.com/v/VgWd517uwBo&hl=en_GB&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"></embed></object></div><br /><br />As mentioned in a previous blog <a href="http://robotics-visionexperiments.blogspot.com/2010/06/project-burt.html">entry</a>, I have assembled the <a href="http://www.robotshop.ca/robotshop-rover-arduino-tank-kit-6.html">RobotShop</a> Robot Rover for Arduino tank kit. I followed the excellent assembly video <a href="http://www.youtube.com/watch?v=-SG9IibwaRE">here</a>.<br /><br />On the front there is a Sharp IR sensor (<a href="http://www.sharpsma.com/Page.aspx/americas/en/part/GP2Y0A21YK/">GP2Y0A21YK</a>). It's three wires (Vo, Gnd, Vcc) are fed underneath the chassis and emerge through a hole. These three wires have also had male jumper leads spliced onto them, to make it easier to test via a breadboard. The 9V battery wires, and four motor wires are also routed through the chassis.<br /><br />From my first robot I have some standoffs that fit nicely to the servo mounting points on the chassis (<a href="http://www.pololu.com/catalog/product/1066">Pololu standoffs</a>). I also have the <a href="http://www.cmucam.org/">CMUCam3</a> assembled and ready for use, once the main robot is up and running. <b>Note:</b> that this won't be the final camera module. The CMUCam3 is just ready for me to use now. I need to get two cameras huddled on the front of Burt for stereo vision libraries.<br /><br />Underneath the chassis the four 1.5V batteries and 9V battery are ideally placed to connect to the motor controller and micro controller.<br /><br />On the left of the video is a hint as to the next update. The testing of the ProtoShield, IR sensor, PowerSwitch, and Accelerometer.<br /><br /><a href="http://picasaweb.google.com/lh/photo/69pZrUKJcmdunsjhITkVng?feat=blogger" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img src="http://lh6.ggpht.com/_IyZ0gOKvN6Q/TAu7Yj8cERI/AAAAAAAAAVg/zXDWrSFqXEw/s512/P1040880.JPG" border="0" /></a>Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-52091688634225360702010-06-06T17:38:00.002+01:002010-06-06T17:46:39.212+01:00[Burt] What are the chances?I was flabber-gasted to discover that no one in the world has ever thought of creating a Google Code project called 'burt'!! I must omit that the project name came before checking with Google Code to see if it could exist as a project name :D<br /><br />I've just finished the initial Google Code Project setup. The main index is <a href="http://code.google.com/p/burt/">here</a>, and also in this blogs 'Handy Links' section on the right of this page.<br /><br />Why 'Burt'? I may hear you cry. Simples really. "The Dukes of Hazzard" remake was on the TV at the time when I was trying to decide on the name, and Burt Reynolds steals every scene he's in.Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-64421400541029232172010-06-06T12:17:00.011+01:002010-06-26T22:40:04.967+01:00Project: Burt<span style="font-weight: bold;font-size:130%;">Introduction</span><br /><br />After a couple of years of life changes, the itch to revisit robotics has taken hold. The <a href="http://code.google.com/p/robotvisionexp/">first robot</a> was something that I rushed into and made some crutial, and costly, design mistakes. This time around I have had time to revisit new products and come up with a new robot design, '<a href="http://code.google.com/p/burt/">Project: Burt</a>'.<br /><br />It's been great re-visiting web sites and forums I have been to before, such as <a href="http://www.sparkfun.com/">Sparkfun</a> and <a href="http://www.pololu.com/">Pololu</a>. It was also encouraging to find two UK suppliers that I hadn't seen before, namely <a href="http://www.coolcomponents.co.uk/">Cool Components</a> and <a href="http://www.skpang.co.uk/catalog/">SK Pang</a>.<br /><br />Being away from the home-brew robotics community, for almost a year and a half, has meant that I had some catching up to do with the evolution of robotics parts. Immediately three parts jumped out at me; <a href="http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=46&products_id=233">Robot Rover for Arduino</a> (Tank Kit), <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9571">Serial Controlled Motor Driver</a> (ROB-09571, ATMega328), and the <a href="http://www.arduino.cc/">Arduino Duemilanove</a> (ATMega328).<br /><br />The <a href="http://www.atmel.com/dyn/products/product_card.asp?PN=ATmega328P">ATMega328</a> used in the Duemilanove and Serial Controlled Motor Driver (SCMD), looks like a perfect micro-controller to use as a sensor analyser and communications hub. Plenty of digital IO and analog inputs to play with. It was a bit overwelming, and warming, to see the rise of the Arduino products. A heathy development community has sprung up. As I thought about various sensors, controllers, communication sub-systems, most of my questions as to what to use, and how to use/connect them, were answered via <a href="http://www.arduino.cc/">Arduino's wonderfull web portal and forums</a>.<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Design List</span></span><br /><br />Within a few weeks my thoughts for '<a href="http://code.google.com/p/burt/">Project: Burt</a>' were starting to come together. As a starting list I had the following in mind;<br /><br /><a href="http://www.arduino.cc/">Arduino Duemilanove</a><br />- As the main controller.<br /><br /><a href="http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=46&products_id=233">Robot Rover for Arduino</a><br />- As the main chassis.<br /><br /><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9571">Serial Controlled Motor Driver</a><br />- As the motor controller (incl. overcurrent detection).<br /><br /><a href="http://www.pololu.com/catalog/product/751">Pololu Pushbutton Power Switch LV</a><br />- As a potential power switch for the motor controller.<br /><br /><a href="http://www.technobots.co.uk/acatalog/Shop_Front_2g_Accelerometer_660.html">Dimension Engineering Accelerometer</a> (<a href="http://www.dimensionengineering.com/accelerometers.htm">DE-ACCM2G</a>)<br />- A buffered ±2g accelerometer based on the Analog Devices ADXL332.<br /><br /><a href="http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=36_57&products_id=236">IR Range Sensor</a> (Sharp <a href="http://www.sharpsma.com/Page.aspx/americas/en/part/GP2Y0A21YK/">GP2Y0A21YK</a>)<br />- Included with the Robot Rover kit.<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Ordering</span></span><br /><br />Two orders later, I have a desk full of parts :)<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IyZ0gOKvN6Q/TAuXkHsleSI/AAAAAAAAAU4/xAGJeIwcWVo/s1600/P1040872.JPG"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_IyZ0gOKvN6Q/TAuXkHsleSI/AAAAAAAAAU4/xAGJeIwcWVo/s320/P1040872.JPG" alt="" id="BLOGGER_PHOTO_ID_5479640018423478562" border="0" /></a><br />Included in the orders we're a handfull of other goodies; An Arduino <a href="http://www.skpang.co.uk/catalog/product_info.php?cPath=140_143&products_id=553">Starter kit (C)</a>, an Arduino <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=7914">ProtoShield Kit</a>, and a couple of <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en021393">MCP23008</a> and <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010412">MCP23016</a> IO extenders (with I2C interface) for future expansion (e.g. LED segments, Servos, USB host connection, VirtualCogs interfacing, etc.).<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Physical Layout</span></span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IyZ0gOKvN6Q/TAufTLfVo3I/AAAAAAAAAVI/A9kLydxiXes/s1600/P1040883.JPG"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_IyZ0gOKvN6Q/TAufTLfVo3I/AAAAAAAAAVI/A9kLydxiXes/s320/P1040883.JPG" alt="" id="BLOGGER_PHOTO_ID_5479648523476902770" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IyZ0gOKvN6Q/TAue8gsr6pI/AAAAAAAAAVA/8Yi4adpdMtQ/s1600/P1040881.JPG"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_IyZ0gOKvN6Q/TAue8gsr6pI/AAAAAAAAAVA/8Yi4adpdMtQ/s320/P1040881.JPG" alt="" id="BLOGGER_PHOTO_ID_5479648134033042066" border="0" /></a><br /><br />The Arduino is placed on two stand-offs, so there is about a 1cm space below it to mount the motor controller. If any heat issues arise there are other mounting holes on the chassis to use. But for the moment this looks like a good starting point.<br /><br />The main boards that need individual testing;<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IyZ0gOKvN6Q/TAugFbGtIjI/AAAAAAAAAVQ/Jfv_CKjgzV0/s1600/P1040880.JPG"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_IyZ0gOKvN6Q/TAugFbGtIjI/AAAAAAAAAVQ/Jfv_CKjgzV0/s320/P1040880.JPG" alt="" id="BLOGGER_PHOTO_ID_5479649386662011442" border="0" /></a><br /><span style="font-size:130%;"><span style="font-weight: bold;">And so, it begins</span></span><br /><br />Over the next few weeks (months) I'll be continuing along like my first robot blogging. Fleshing out the <a href="http://code.google.com/p/burt/">Google code project</a> with links, Arduino PDE code, Eagle schematics, more photos and videos. A detailed step-by-step guide to getting Burt up and running.<br /><br />Unlike the muddled mess that was my first robot, Burt is so far shaping up to be a nice project to get back into robotics. Plus a new starting point for vision experiments. Maybe I'll be able to get the old Virtual COGs boards dusted off and make use of the lovely Freescale i.MX21 266MHz ARM9 processor, and maybe save up for something like the <a href="http://www.surveyor.com/stereo/stereo_info.html">Surveyor Stereo Vision System</a>...Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-32095383505989549982009-01-13T14:58:00.001+00:002009-01-13T15:02:27.800+00:00Turbulent timesThe end of last year became very turbulent, and resonates through the start of this year for me :( The company I have been contracting for is closing at the end of this week. And in light of the current economic climate it could be tricky to pick up new work. Mistakes made in initial purchase of parts for the robot put a spanner in the works, and it looks like it'll take some time to rectify that and purchase more appropriate parts. Need to keep a roof over my head first :) In the meantime though I do intend to get the bottom of using QTe using the only stable version of Linux I have on the COG system..Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com1tag:blogger.com,1999:blog-5466408059280532516.post-57010681782128278602008-10-26T11:42:00.003+00:002008-10-26T11:54:17.909+00:00Kernel booting - continuedThe Ubuntu install on the laptop is now complete. No more Windows :) After a quick and painless install via USB flash keyring, I followed the Wiki to setup the laptop for development. A few steps we're missing in the Wiki setup guide (particularly the GDB/Insight install), so that Wiki page has been updated.<br /><br />I also spent some time looking into Kernel booting. The 2.6.23 kernel decompresses the zImage, it gets to the 'Done' stage, but goes no further than that. I've checked the ldatags side of uMon and compared that to the setup code in the kernel, and they tied together (as they did in 2.6.22). I've also incrementally patched the 2.6.22 kernel up from the sub-version 6 in the VC CVS, all the way up to 2.6.22.19, and it boots fine (except for the usual MTD issues). It's only when I move to 2.6.23 that the boot fails. <br />So it looks like I need to debug further into the boot sequence. Potentially using the 3 LEDs on the VCMX212 board as a limited binary sequence counter to step through the boot sequence. I need to find some time to see whether I debug the kernel startup/boot via GDB. Just need a way of setting up the ATAG info to pass to the kernel.<br /><br />So I've got a choice. Continue advancing the kernel versions and sorting out the booting issues, to hopefully get to a point whether the MTD problems sort themselves out. Or, stay with 2.6.22 (with MTD/JFFS2 patches) and work out why it is spewing so many errors out (and once into BusyBox, why it is so unstable).....Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-13682619956290046732008-10-18T23:22:00.002+01:002008-10-18T23:35:59.879+01:00Fresh startSo I managed to revert the kernel back to the base version (2.6.22), and had that booting (until it hit the MTD issues, etc.). And it ended up being quite painless to patch to 2.6.23 A relatively small number of files that needed their rej files checking. Most we're VC changes to file header comments. A few we're deleted files.<br /><br />Unfortunately it fails to get anywhere booting :( The zImage decompresses fine, but halts straight after that. I'll probably take a step back from that, and incrementally apply the 2.6.22 patches first. Narrow down where the boot discrepancy starts. Rather than trying to run straight to 2.6.23<br /><br />Finally, for today, I've decided to blitz the laptop. The Ubuntu community docs describe a way of installing from a USB stick. I've tried the initial install of this and it works fine (it's a network boot).<br /><br />As I type the install is setting up the base system. Existing partitions have already been destroyed :O<br /><br />Tomorrow I should then have a brand new Ubuntu laptop to play with and setup (according to the Wiki) :) Plus 40GB of space to play with, rather than the FAT limited 4GB home space :SAnonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-7561078889422324852008-10-18T18:23:00.002+01:002008-10-18T18:28:47.500+01:00Interesting..I've reverted the VC CVS coglinux-2.6.22(.6) back to linux-2.6.22 base, and this boots more frequently than the 2.6.22.6 versions!! I'm still getting Magic bitmask issues from JFFS2 and lots of MTD do_erase_oneblock() timeouts :(<br /><br />I'm going to start applying patches, and see if further kernel versions become more or less stable.<br /><br />Plus close to deciding whether to blitz WinXP off the laptop and reinstall only Ubuntu on. (As well as testing out all the info on the Wiki to see if all the install and setup steps are correct and nothing is missing)..Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-49026034344300036882008-10-12T15:24:00.002+01:002008-10-12T15:30:23.050+01:00Kernel booting: Good News!! (well almost..)I persevered late into last night with Buildroot. Eventually I was able to get the make to finish. For it to make the toolchain, uClibc, BusyBox, Linux, and the root JFFS2 FS :)<br /><br />Reflashed the root FS and zImage to the VCMX212 and tried booting. At first I was getting lots of MTD error messages. After a few boots (usual to init the JFFS2 FS) I managed to get to the BusyBox prompt :)<br /><br />Unfortunately it is very unstable :( Likely to be issues with MTD. A quick google trawl before bed shown lots of MTD issues with various kernels.<br /><br />Today I'm going to start afresh with Buildroot and fill in any missing gaps in the Wiki page.<br /><br />Then on to start looking at the MTD problems...Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0tag:blogger.com,1999:blog-5466408059280532516.post-51180966000786148592008-10-11T16:36:00.002+01:002008-10-11T16:52:09.645+01:00Rebuilding JFFS2 file systemI've spent some time today trying to rebuild the COGlinux JFFS2 file system with a custom built (debug version) of BusyBox.<br /><br />It ended up being fairly easy to build BusyBox with the Crosstool, and then using the VC shell script and device table to rebuild the coglinux.jffs2 file.<br /><br />Reflashing this new file on the VCMX212 board, and booting into the 2.6.16 version of the kernel unfortunately produce issues with bad/missing magic numbers :( So VFS couldn't get this new JFFS2 FS mounted and the kernel panics not being able to exec post boot steps.<br /><br />I tried for a while to diagnose this, including creating what should be an identical coglinux.jffs2 file from the original extracted JFFS2 file from VC, and the VC CVS shell scripts. Annoyingly this still had issues getting mounted with the 2.6.16 kernel :( <br /><br />I've now fallen back to the original VC JFFS2 file and the 2.6.16 kernel image (both taken from the website). But this has allowed me to "rx" the new custom busybox executable to the FS via Xmodem.<br /><br />Running this new custom busybox executable produces the dreaded "Permission denied" (?) issues. Which is kind of expected considering that the JFFS2 FS contains cClibc libraries rather than libc ones.<br /><br />So at the moment I've got myself side tracked looking at sorting out a Buildroot setup. I'll persevere with this for a while. Before dropping back and looking into getting the libc shared libraries across to the VCMX212 FS to sort out running the custom busybox executable.Anonymoushttp://www.blogger.com/profile/04206514663069375579noreply@blogger.com0