Trying to setup an encoder, please help

  • Hi I have recently finished building a monome from the kit, it works great and I love it. I want to add an encoder for my own patches in Max/Msp. I have purchased the us digital S4 256 and the jtag programmer from olimex and have soldered the encoder on. Where I get royally confused is with the installing of Dev tools and Avarice and all of that. I am not a programmer and have never used the terminal app in OSX. I am on an ibook with OSX 10.4.8. I was wondering if someone could shed some light on this subject for me. Is there a simpler way to do this without having to necessarily understand it?

    Any help is much appreciated.



    good starting point. let me know where you get stuck.

    after it's all installed, you should be able to go to the folder where the 40h_enc source files are located and type "make pro" and everything will program

    you might need to change the makefile so that it knows where your programmer is... type:

    ls -lrt /dev

    and look for a usb**** device similar to that listed in the makefile

  • man, im a programmer, and i still get scared of makefiles!

    egon, you'll get it, you jus have to be persistant. setting these type of things up is never easy, but always rewarding when its done.

  • Hi, Sorry for the late reply. Thanks so much for your quick reply. I have been perusing this forum for awhile and I do notice the speed with which things are solved around here.

    So here is my problem: As I said I have no experience with programming so some of the most base stuff is foreign to me. Where I get stuck in the tutorials and documentation for installing Devtools and Uploading firmware is that they all say to go to a directory and then type something. I don't know where to type these things. If it's in Terminal, how do I specify which directory will feel the effects of this code?

    I have installed the Xcode tools as well as the OSX-AVR toolchain. I am assuming it is installed because I installed the packages from the digithink site. They are located in the usr/local directory. The ENC download from the monome site is located currently on my desktop. I am not sure what to do next or exactly how to do it.

    I must now apologise for my lack of experience but I will try to make this forum entry helpful to those who are like me and could use a more detailed description.

  • hey there,

    you're on your way. open up a terminal.

    1. make sure things are installed, type:


    you should see:

    AVaRICE version 2.6.20070222, Jun 17 2007 22:06:15

    or something similar, with some other messages.

    2. figure out "where" your programmer lives. plug it in, type:

    ls /dev | grep tty.usbserial

    you should see something like:


    since you looked inside the /dev folder, my programmer lives at


    note that this will probably change if you use a different usb port.

    3. edit the Makefile

    inside the 40h_enc folder, edit the Makefile with any text editor. make sure to save it as plain text when you're done.

    replace every occurrence of "/dev/tty.usbserial-1B1" with your own programmer's location

    4. in the terminal, navigate to your 40h_enc source folder. if it's on your desktop, for example:

    cd Desktop/40h_enc

    to make sure you're there:


    (you should see a file list of the contents of the zip)

    5. plug in the programmer, plug it into the circuit, power the circuit via usb, then type:

    make pro

    and you're done.

  • Thanks again for your help. So here is where I am at. I now understand terminal better. I realized that I didn't have avarice installed correctly. After much trouble trying to get it installed I decided that I probably created some kind of conflict because of all the installations I performed. I tried too many different versions of things that I think that it could be a problem.

    So what I did was move to my G5 desktop which has been untouched by all this and started fresh on the installations on the installing OSX dev tools tutorials. Binutils, libbfd, libiberty seemed to install fine. I downloaded gcc-3.4.3 and was a little confused about the instructions: pasted below

    first make sure that /usr/local/bin is in your path. /usr/local/bin is software from step 2 was installed. you can add /usr/local/bin to your path like this if you are using bash as your shell (if you don’t understand what this means, you are probably using a bash shell):

    agentcooper:/tmp/binutils-2.16/bfd lake$ export PATH=$PATH:/usr/local/bin

    nevertheless I typed in the code above except mine was: /Users/charlievisnic/Desktop/binutils-2.16/bfd charlievisnic$ export PATH=$PATH:usr/local/bin

    it said something to the effect of: that is a directory.

    I then cd'd into gcc-3.4.3, configured, made and installed and it seemed to work correctly. Then I downloaded avr-libc-1.4.4 and cd'd in and went to configure and it gave me an error. It said: Wrong C compiler found; check the PATH! This is where I got stuck. I didn't want to try a bunch of things in fear of contaminating THIS computer with more incorrectly installed software.

    I did try to skip ahead to avarice and it gave me a similar error. It said error: C++ compiler cannot create executables

    So this is where I am at. I'm sorry it is such a long entry but I want to be as specific as I can. Any help is really appreciated. I can't wait to get this knob working.

    Thanks again

  • did you try this?

    it sounds like you're working off the individual steps, which is incredibly difficult. it's probably not a good thing that i posted those howto instructions, because it seems that the procedure is never the same. (i recently upgraded something, had to redo the process, and it was different and harder.)

    the problems with the PATH is that when compiling the new apps, it's finding the avr-gcc before the normal gcc. so it's treating normal code like microcontroller code, which doesn't produce executables.

    you can remove the microcontroller PATH temporarily by doing something like this:

    echo $PATH

    (which gives you something like:)

    the thing you *don't* want in there is /usr/local/avr/ so copy this line, remove the /usr/local/avr/ and then paste below (instead of /usr/local:/usr/local/bin)

    export $PATH

    then you should be ok, with the /avr/ folder removed

  • You know I had tried installing the OSX-AVR download, but I didn't know really how to verify it. So I continued installing and searching for documentation to help. Until I read your reply, which told me to type avarice in terminal, when I typed it in it gave me an error like command not understood. So that is why I ended up starting fresh on my other computer.

    But I have good news, after reading your last reply I decided to try again. I am at work so we have lots of fresh macs here. I downloaded and installed Xcode tools, then downloaded the PPC version of OSX-AVR from Jan 07 and installed only the OSX-AVR-JAN07.mkpg and the avr-gcc-toolchain-JAN07.pkg and went to terminal and typed avarice and it came up with:

    AVaRICE version 2.5, Feb 2 2007 03:55:04

    Defaulting JTAG bitrate to 1 MHz. Make sure that the target
    frequency is at least 4 MHz or you will likely encounter failures
    controlling the target.

    Failed to open /dev/avrjtag: No such file or directory

    I can't try uploading to the monome because it is at home but will definitley try tomorrow and report back.

    should I worry about the Failed to open /dev/avrjtag note or is that because I don't have my jtag programmer connected?

    Thanks again,
    BTW once this finally works out I will post a picture of my totally cool retro 50's all wood monome.

  • you're all set.

    the error is because it's looking on /dev/avrjtag by default, but you'll specify the location of your actual programmer (as i described above)

    do post pics!

  • you managed a wood faceplate! sweet! I totally want to see it.

  • It worked! Thanks alot Tehn for your help. It turned out in the end I just needed the OSX-AVR download and those two pkg. files I listed above to get it ready for upload. For all others interested in adding an encoder it is much simpler then it may seem. On a side note, I dowloaded the PPC version of the OSX-AVR and after it worked I was informed by a co-worker that it was actually an intel mac, this probably just confuses things but it worked anyway.

    and here is my all wood monome. It was a bitch to do the faceplate, truly. I marked each of the buttons center point on a bit of plywood, then drillpressed. Then I took a file, yes a file, and grinded all the corners out so the buttons would fit nicely through. It took three solid days of grinding and was a challenge on my mental stability. But in the end I am definitley happy with the outcome. I've been joking about adding a built in ashtray in the corner just to emphasize that 50's retro thing.

    Thanks again

    2816 x 2112 - 399K
  • incredible!

  • That is beautiful.

  • I can't believe you did that.
    The steampunk 40h.

  • That's really beautiful !

    Any tip to drill the 64 holes ? Don't tell me you did them manually, I would become mad just thinking about it !


    I actually read the whole thread and noticed you did it manually. The white guys are coming.

  • the original arc!

  • remember this?

  • @tehn no i've never seen that before. beautiful.

  • Hey that's my monome! I'm flattered by the comment, Jred.

    It's too bad that I never really used the encoder that much. I did start an additive synth app in Max/Msp that used the encoder to tune the oscillators. It got jumbled and ugly when I attempted to make it polyphonic.

    Perhaps I will pull that old patch out and give it another days work now that encoders will be the next big focus in app design.

    I ended up pulling that encoder because I picked up a couple of analog joysticks to replace it with. Perhaps, I'll stick with the encoder now.

  • I love bringing a dead thread back to life. What happened to the old links like @tehn's above? I'd love to see this: but i fear it is gone.

    I imagine that I own the beast in question.

    Wait: saves the day:

    It is my beast!