Avrdude command line

The command line format is:

avrdude -p {partnumber} <options>

To see the list of part numbers, run avrdude -p ?

Options that I will use programming AVRs are:

-c <programmer>            Specify programmer type.

-P <port>                  Specify connection port.

The typical command line will be : avrdude -p attiny2313 -c stk500v2 -P /dev/cu.usbserial-id.
* todo – plug in new usb to serial dongle when it arrives, ls /dev/cu.* and find out what I should replace usbserial-id with above..

LCD across ports

Using CodevisionAVR in the past, it has been great to use the LCD library to interface with an LCD. When this is not so great is if you have a non-standard setup and wish to connect the LCD to the AVR across different ports. I have this issue with my next project – a LCD interface for other microcontrollers. I am going to use the Tiny2313 and it can accept commands via either serial or i2c interface. The interface will be selected by 2 input lines (configured by jumpers). These 2 input lines will also configure the serial communication speed if it is used. The one issue I have come across so far is that the USI pins and serial pins are on separate ports and will need to be available. This does not leave a full port for the LCD interface, requiring the LCD data lines (4 pins) and the control lines (3 pins) will have to span ports. The upshot of this is that I cannot use the built in LCD library in CodevisionAVR. This is what has lead me down the path of programming the AVR on my OS X machine.

The google gods have guided me to this site http://winavr.scienceprog.com/example-avr-projects/avr-4-bit-lcd-interface-library.html which is pretty much exactly what I’m looking for.

Xcode and AVR development

First I have to note that apart from creating the “Hello World” application in Xcode, I have not used Xcode for any application development. Most of my avr code development has been fairly dodgy C code using CodevisionAVR (and assembly code when I was first introduced to microcontroller programming)

So I decided to try and do all my AVR development on my mac. First thing to do was download and install CrossPack from http://www.obdev.at/products/crosspack/index.html. These folks have done a stella job of packaging pretty much all the required software.

The first place I went to to get the OS X avr development tools was http://www.digithink.com/OSX-AVR/ but he pointed users to the CrossPack instead of his package. He did make note however that he was going to contact them and ask them to include the Xcode templates.

I had a look at the Xcode template that is supplied with OSX-AVR (created by Nick Lott) and it looked ok. Installing just the Xcode templates however, put them in the wrong place for my system   (I’m running Xcode 3.1.2 and OS X.5.6). They were installed into /Library/Application Support/Apple/Developer Tools. I moved them to ~/Library/Application Support/Developer/Shared/Xcode/

I created a new project using the Basic AVR C project and Built it. The build failed because it was trying to find avr-gcc and it was not in the Xcode project template path. So I edited the project.pbxproj file in ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/AVR/Basic AVR C Project/AVR.xcodeproj directory and removed PATH = “/sw/bin/:/usr/local/bin/:$PATH”; and replaced it with PATH = “$(PATH):/usr/local/CrossPack-AVR/bin”; I had to replace about three instances of this path. After making these changes I was able to successfully build the sample code provided with the template.

Record of type dsRecTypeStandard:Config named: ‘ServicesInformationXXXX’ already exists

So I went to my development OS X.5.6 server yesterday and it was taking forever to do anything, with nothing but the spinning beach ball happening.

Looking at the logs, it seemed that servermgrd was having issues (also noted that DirectoryService was running at 100% cpu) trying to create/edit a OD record in the local node.

The following error appeared in the log:

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation’ already exists in /Local/Default. Trying with new name: ServicesInformation1

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation1’ already exists in /Local/Default. Trying with new name: ServicesInformation2

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation2’ already exists in /Local/Default. Trying with new name: ServicesInformation3

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation3’ already exists in /Local/Default. Trying with new name: ServicesInformation4

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation4’ already exists in /Local/Default. Trying with new name: ServicesInformation5

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation5’ already exists in /Local/Default. Trying with new name: ServicesInformation6

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation6’ already exists in /Local/Default. Trying with new name: ServicesInformation7

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation7’ already exists in /Local/Default. Trying with new name: ServicesInformation8

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation8’ already exists in /Local/Default. Trying with new name: ServicesInformation9

Apr 17 09:20:21 tur-macdev1 Python[47]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation9’ already exists in /Local/Default. Trying with new name: ServicesInformation10

Apr 17 09:20:22 tur-macdev1 servermgrd[53]: Record of type dsRecTypeStandard:Config named ‘ServicesInformation’ already exists in /Local/Default. Trying with new name: ServicesInformation1

And this went on for quite some time, creating several thousand extra records in the local directory.
After checking the contents of the /var/db/dslocal/nodes/Default/config directory, it would seems that /var/db/dslocal/nodes/Default/config/ServicesInformation.plist was for some reason empty.
To fix this error, I deleted all but one of the newly created ServicesInformationXXX.plist files, renamed it to ServicesInformation.plist and restarted the server. This seemed to do the trick and now the server runs ok.
As a side note, this record seems to have something to do with web services – blog, wiki etc. As stopping this services initially stopped the system trying to create this file.