Tuesday, March 26, 2013

Reading back data over serial from the atmega

Just to add to my last post, I used the "minicom ama0", method of monitoring data from the atmega. Some more details here. I can't remember if I needed to change some special settings, but if anyone has issues I can check my settings if need be.

https://projects.drogon.net/raspberry-pi/gertboard/using-the-arduino-ide/

Sunday, February 24, 2013

Rasberry Pi Robot with L293, atmega8 using SPI communication

This project was to build a robot from the ground up using the raspberry pi because it has good support for wireless and eventually a built in camera (here I use a web cam).  Eventually the robot can be controlled remotely via key strokes or can also listen to some basic voice commands (via google voice recognition found in raspberrypi.org forums). A video demo is still to come because I want to improve how the voice works. Currently, switching the motors on makes too much background noise for it to detect the next information.

I went with connecting the Raspberry pi to the atmega via SPI because eventually it might be nice to use the atmega for analog input as well. Bi directional communciation should not be a problem. The atmega runs at 3.3V, so that should not cause issues. In addition, the atmega provides a buffer to the motor driver L293, so if some power backlash happens the PI is somewhat protected. Note I am a software guy, so forgive me if I do something electrically bad. 
The raspbot - crown is just some decoration and  yes raspberry pi is misspelt. 
The code for the atmega is located at https://github.com/arcanon/raspbot/blob/master/Blink.ino and the python script that talks to the atmega via Quick2Wire is at https://github.com/arcanon/raspbot/blob/master/ardspi.py. 

I used the raspberry pi as the programmer for the atmega using - https://projects.drogon.net/raspberry-pi/gertboard/. Note that that you have to make sure you use the right fuse settings I did something like this

avrdude -vvvv -c gpio -p atmega8 -U lock:w:0x3F:m -U lfuse:w:0xe4:m -U hfuse:w:0xda:m -i4000

At one point I "killed" the chip by using the wrong fuses (I set it to an external clock when I had none), but managed to fix it. See details -http://www.raspberrypi.org/phpBB3/viewtopic.php?p=235388#p235388.

Issue with bit banging via avrdude/SPI and using the SPI device. I could not do this at the same time, so every time I reprogrammed the atmega, I had to restart the PI so that I could use my python script again. Lame, but true :/.

To view the webcam I used: 
 ./mjpg_streamer -i "./input_uvc.so  -f 15 -r 640x480" -o "./output_http.so -w ./www"

Circuit diagrams and breadboard from Frizing 

Breadboard layout
Circuit diagram
Links:
Basic SPI tutorial from: http://mitchtech.net/raspberry-pi-arduino-spi/



Monday, December 24, 2007

Sometimes, we would like to live in sub-worlds that allow us to relax and escape the large conflicts of life. Like making money, getting a degree and christmas presents. The sub-world helps to correct the imbalance found in our world. I have yet to find a way in which we can correct imbalances found in a given world while still in that world.

This is a sub-world I found in Beverlac.
Posted by Picasa

My first Blog

This is the first time ever in history that I am writing on a blog. Interesting experience. The title speaks of me speaking of my part of the world. We each have our own part of the world and can rule it the way we want it. Whether its filled with princes and princesses or stocks and bonds. Hopefully each small part of the world will contribute to a greater world success.

This world idea, does not relate to the many world hypothesis given by some physisits, albeit a possibly related field.