Problems with an Atmega 328 in a MIDI sync circuit

Hi,

I have been experimenting with Sebastian Tomczak's NanoSync, an Arduino app which will synchronise Nanoloop 1.x to a MIDI clock signal form a computer, etc.

My intention is to use the output from the stand-alone Arduino chip to drive an analog sequencer/synth I am designing, instead of the originally intended use with a Game Boy.

I use FL Studio 8 to send MIDI sync pulses to the 328 via a USB to MIDI cable. However, although MIDI clock is getting to pin 2 of the 328, the chip clock is running, and the special code has been uploaded successfully, I just cannot get the 328 to produce any output on pin 4.

Sebastian suggested trying a change to the Arduino code, which was duly implemented, but still no results.

Sebastian has not used an Atmega 328 for this code (he used an unspecified earlier version), so could there be something extra that needs to be done to get the circuit to work?

I would be very grateful if anyone can help me out!

You can see the story so far along with the code and schematic on Sebastian's blog "Little-Scale" , the link follows in the next post.

Many thanks in advance....

Here is the link to Little-Scale:

To simplify this post a little, what I am asking is, why does the Atmega 328 not work in an application designed for Atmega 168, when they are supposed to have pin for pin compatability?

I programmed the 328 in the Arduino Duemilanove board that it came in, incidentally.

How do you have it wired up? Did you remember the 16MHz crystal and supporting caps?

It is wired as a stand-alone chip, with 5V regulated supply, crystal and 2 x 22p capacitors, plus reset pullup resistor. The circuit is shown in a diagram here:

http://homepage.ntlworld.com/traxcontrols/arduino.gif

The circuit has been proven to work with earlier versions of the Atmega, but not the 328 for some reason!

STOP PRESS - I have tried the circuit with an Atmega 168 (with bootloader pre-programmed), but still no output.

I also changed the optoisolator to a 4N35, again no results.

I am new to all this, so maybe it is something very basic that I am doing wrong. If anyone has any suggestions, I will try them all!