by on Dorkbot

Its one am and though i studied and built circuit diagrams and layed out the parts and I went to work and communicated and wrote and coded but no arms have moved and while joints have been soldered no sound or movement has come out.

In the morning the list of shit I havent gotten done goes on.

Sorry emilliano.
/me sings in my worthless spanish

“Yo dice nada nada nada

manyana en la manyana

nada nada nada hoy!”

by on Dorkbot

A couple of weeks ago I took one of the projects that came to the meetings last year using the arduino called the bzztbomb. I am trying to take this Arduino project to the next level in two ways.

# to create a board which would cleanly amplify the sound from the arduino board as an above board add on.
# To create a low cost board which could be used to for the finished product.

The schematic for the V-1 in its current form is at http://www.digithink.com/embedded/hardware/arduinosound/rev1/noisinout_reva.pdf
The eagle files are at

http://www.digithink.com/embedded/hardware/arduinosound/rev1/noisinoutdip_a.sch
and
http://www.digithink.com/embedded/hardware/arduinosound/rev1/noisinoutdip_a.brd

http://dorkbotpdx.org/files/images/postapril.preview.jpg

When I finished my prototype I was able to get stereo output by modifying the example sketchbook called play_melody_faded_volume but found that the sound out of the pwm volume control sounded aweful.

I started looking at filtering the output to get smooth outputs. One of the missing pieces of the documentation of the arduino AnalogWrite is the duty cycle of the timer. A web search had the timer running at everything from 400 hz to 10-32khz. Once I finally put the sketch on a scope I found that the pwm duty cycle is 2ms long.

500hz.

The sound being modulated is in the range between 261(c) and 523(C) hz. which makes 500hz a very unuseful value.

In otherwords the model included in the examples doesdnt work with ardueno – 0007.

by on Dorkbot

My basic strategy is to pull from the parts that I have been building for my maze solving bot. I feel like I have spent more time creating the event and running from meeting to meeting than I have on building the bot. The nearest event like this is at the RoboGames in SF. At least with my maze solving bot I can go to robothon.

The upside is that this will be the first annual. And there should be a next year.

http://www.pdxbot.org/cms/uploads/media/Artbot_Rules.pdf

by on osx-avr

Go to sourceforge download area

AVRGCC20070131 contains patched versions of

  • avr-gcc-4.1.1
  • avr-binutils-2.17
  • and libc-1.4.5
  • gdb-6.5

This includes the new_devices patches posted to the freebsd ports collection as of 01JAN07.

  • AvrDude5.3.1 contains avrdude 5.3.1 plus the osxintel hack
  • LibUsb.pkg contains the library required by avrdude to talk to the Atmel AVR-ISP MKII
  • AvrA1.0.3 contains a version of avra based on avra1.0.1 with my new device.c added to it.
  • Mfile is Jeorg Wunsch’s Makefile Generator
  • XCodeAvrTemplates contain the templates created by Nick Lott to make the tool chain work within XCode
  • simulavr.pkg and avarice contain experimental versions of these emulators.

by on osx-avr

Go to sourceforge download area

This release contains:

  • avr-gcc-3.4.6
  • avr-binutils-2.17
  • and avr-libc 1.4.5
  • avrdude 5.2.

These versions are all patched using the patches released into the FreeBSD ports collection as of october first.

To keep the devices in sync I am also releasing avra 1.03 which adds the following to avra 1.02

  • AT90PWM2
  • AT90PWM3
  • AT90USB1286
  • AT90USB1287
  • ATmega164P
  • ATmega165P
  • ATmega169P
  • ATmega324P
  • ATmega3250P
  • ATmega325P
  • ATmega3290P
  • ATmega329P
  • ATmega48P
  • ATmega644P

(I will add this to the avra sourceforge project later)

The pre patched source for avr-gcc, avr-binutils, and avra are at http://www.digithink.com/OSX-AVR/sources/

by on osx-avr

General outline for creating AVR development environment for OSX.

Since the gcc chain serves a much greater community than just the avr and its stability is critical to the stability of the entire open software community the avr community has elected to maintain patches. The avr-binutils, avr-gcc and patches used are all to be found in the freebsd ports collection. The avr-libc does not require patching as it is seperate from gcc.

(If you would rather just download and install the resulting package it is here)

Process for multiple installations

  1. create a staging directory.
  2. patch, build and install (in order)
    1. avr-binutils
    2. avr-gcc
  3. clean and then rebuild them into the staging directory.
  4. build avr-libc into ste staging directory.
  5. use PackageMaker to build a package.
  6. add README and other utilities you want to include
  7. use disk-utility to create DMG
  8. mount and install the package
  9. put the dmg where it can be shared.

avr-binutils

The the binary utilities make up the loader and assemblers and other tools needed by gcc to create usable code for the target. Like gcc the binary utilities are not specific to the target but are built for the target. I built the binutilities out of the freebsd currents distfiles (ftp://ftp.freebsd.org/pub/FreeBSD/distfiles), and then applied all of the patches from the freebsd cvs directory (http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/avr-gcc/files/). The patch that changes most often is the new-devices patch which Jeorg Wunsch updates in order to keep the avr-libc current. Then the source tree is unpacked and “./configure”d with the –targe=avr flag. (For some reason I also had to –disable-nls to get this to work).

# tar -xzvf binutils-xxx
# cd binutils-xxx
# for p in ${avr-binutils-patches}/* ;do
       patch<$p
  done
# /configure --target=avr --disable-nls
# make && make install && make clean

avr-gcc

Once the avr-binutils are built and installed gcc is built exactly the same way.

# tar -xzvf gcc-xxx
# cd gcc-xxx
# for p in ${avr-gcc-patches}/* ;do
       patch<$p
   done
# /configure --target=avr --disable-nls

avr-libc

The libc for avr avr-libc is a seperate package from binutils and gcc and it is updated often. You can build this directly into the staging directory. If you are not preparing the code for packaging then you can build the libc directly into the target directory.

# tar -xzvf avr-libc-xxxx
# cd avr-libc-xxxx
# ./configure CC=avr-gcc --host=avr
# make && make install && make clean

Preparing the code for packaging.

If you are going to deploy the avrgcc chain on more than one system or if you want to back up and or share the software then you should at this point rebuild both binutils and gcc into a staging directory.

# rm -rf /usr/local/staging
# mkdir /usr/local/staging
# cd /usr/local/src/avr-gcc/binutils-xxx
# /configure --target=avr --prefix=/usr/local/staging --disable-nls
# make && make install && make clean
# cd ../../avr-gcc/gcc-xxx
# /configure --target=avr --prefix=/usr/local/staging --disable-nls
# make && make install && make clean
# cd ../../avr-libc/
# tar -xzvf avr-libc-xxxx
# cd avr-libc-xxxx
# ./configure CC=avr-gcc --host=avr --prefix=/usr/local/staging
# make && make install && make clean

PackageMaker

One of the applications included in the X-code suite is packagemaker. On my installation it is found under the folder in Developer->Applications->Utilities. PackageMaker can also ge called from the command line but this will require further investigation. .

  1. open packagemaker
    1. in the first tab describe the software.
    2. in the second tab (files) type the path of the staging directory (in our case /usr/local/staging)
    3. in the forth tab (info)
      1. put the default location of the software (/usr/local/)
      2. set the authorization required to “root authorization required”
    4. fill out the information as appropriate.
  2. create the package (command-K)

Creating the Disk image.

Once the package is created

  1. copy the resulting package into its own folder.
  2. You should probably create a readme file
  3. add any other software you want in your archive.
  4. open the Disk Utility (under Applications->Utilities)
  5. under the images menue select New->Image from folder

References.

by on osx-avr

AvrA

The assembler that comes with the GCC tool chain is generalized against itself and therefor can not be used to assemble code written for atmels native assembler. When working with new processors this is problematic since the code samples are often the best points of reference. There is good news and bad news here.

The good news

The good news is that there is an assembler avra that is in the public domain that assembles the atmel source. (avra.sourceforge.com?)

The bad news

The bad news is that the last stable version is missing most of the new parts and the developers are in the middle of retooling big chunks of the code.

The ugly

Last fall I blew up the last of the tiny 15s that I sampled a few years ago. When I went to order replacements the tiny45s were cheaper and they had more features. In order to get this to work I had to add the parts to both avrdude and avra. The avra source had not been generalized very well and there were some major annoyances but the resulting code worked. Once I moved from the tiny15 to the 45 I was able to program in C (footnote 1) so I didnt think much about it.

Six Months Later.

At some point in december I built avr from the latest source and it threw a bunch of buss errors. I didnt care (because my patched/stable version “Worked for me”) until I started working with putting together a complete tool chain for the AVR on OSX . At this point I looked at the best way to get all of the current devices into the stable branch of the assembler. Looking at the Partsdescriptionsfiles directory I discovered that I could parse the XML files and create the appropriate device_list table for device.c I wrote a php (cause thats what I was working in) and a tcl parser because some of the other tools that need to be created shoudl be written in tcl.

The resulting device.c file has been roled into a the stable branch of the avra assembler and a new(old) version was created 1.0.2 and I have been invited to help with the development of the current branch.

Footnotes

  1. (and when I found that I had to patch that chain as well boy howdy I was pissed).

by on osx-avr

Atmel (www.atmel.com)

I came across atmel because they made an inexpensive flash based 8051 product which could be programmed in circuit. It had been about 10 years since I had done anything with microcontrollers but I knew the intel 48/51 family pretty well. I had built a bunch of drawing robots around the chips when I started having a fight with the SDCC compilers optimizer (evelyn). I Decided at that point I wasnt going to use anything that wasnt supported by the gcc chain. A few months later I was using the AVRs. The chips are easy to use full of features and fairly inexpensive.

Avr Studio.

Like most manufacturers of microntrollers Atmel provides a relatively comprehensive set of tools on for free. Also like most manufactures these are only avalible on Windows. The development community has responded by creating several tools in the public domain. Examples of these include the gnu compiler chain (avr-binutils, avr-gcc, and avr-libc), several programming systems (avrdude, and uisp), and two compatible assemblers (avra and tavrasm).

There are a few pieces that are however trapped within the Avr Studio which would make life possible without windows.

Partsdescriptionfiles

Part Description XML Files

Appnotes / Device specific include files.

<devicename>.inc?

by on osx-avr

Download Package (PPC)

It contains a meta package containing the following:

* avr-gcc 3.4.5 (+ may 06 newdevices patch)
* avr-binutils (+ may 06 newdevices patch)
* libc 1.4.4
* avrdude 5.1
* avra 1.0.2
* mfile
* Xcode templates

by on Drawing Machines

I finally said to heck with it and abandoned my previous stepper based system. This is an avr based design with one avr providing the step function as an 12c device.