Author Archives: Gan

About AVR Dragon

Memo about AVR Dragon basics.

What can be done with AVR Dragon:

  • Run the program in the target device in debug mode.
  • Stop at break points.
  • Do step execution.
  • Examine processor internals, such as memory and registers (capable only in stop mode).
  • Program the target device.

Tips

  • The doc provided by Atmel worked best for me for “getting started” document.
    http://www.atmel.no/webdoc/avrdragon/index.html
  • There are several ways to connect Dragon to the target device for debugging.  However, only debugWire is available for ATTiny* chips.
  • debugWire commonly utilizes 6-pin header for ISP (In Circuit Programming).
  • Dragon can be used both as OCD (On Chip Debugging) and ISP devices.  However, these modes cannot be run simultaneously.  The device is modal.  AtmelStudio has capability to switch modes.  In order to close debug mode and return to normal, do debug -> disable debugWire and close from AtmelStudio.  This functionality is available only when running debug execution.
  • AVR Dragon interferes Arduino over USB hub.  If you connect both into the same USB hub, serial interface of Arduino eventually freezes.  Connect different USB ports to avoid this problem.

Candidates for Noise Source Transistor

Typical analog noise generators make signal by amplifying AC component coming out from zener current of transistors reversely biased between emitter and base (here’s an example circuit).

Any bipolar transistor would work as such a noise source, but noise quality in listening is different from part numbers.  2SC828A is well known as good noise source, but it’s been obsolete for long.  So for Analog2.0, I have been recommending 2SC3311 instead.  But this part becomes obsolete as well.  Now I have to find another one.

Continue reading

Latency of Serial.println() with Arduino UNO

As a part of my current experiment, I’m running following piece of code:

   if (digitalRead(pinDeviceReadReady) == HIGH) {
    Serial.println("DATA READY");
    spiSend(0x20); // command "read request"
    readBuffer.deviceId = spiReceive();
    Serial.println(readBuffer.deviceId);
    readBuffer.wireId = spiReceive();
    Serial.println(readBuffer.wireId);
    readBuffer.length = spiReceive();
    Serial.println(readBuffer.length);
    for (int i = 0; i <= readBuffer.length; ++i) {
       readBuffer.data[i] = spiReceive();
       Serial.println(readBuffer.data[i]);
    }
  }

where

inline void spiSend(uint8_t data)
{
  // wait for device ready to write
  while (digitalRead(pinDeviceWriteReady) == LOW);
  SPI.transfer(data);
}

inline uint8_t spiReceive()
{
  while (digitalRead(pinDeviceReadReady) == LOW);
  uint8_t data = SPI.transfer(0);
  return data;
}

Continue reading

Phase one experiment

Continued from this article.  I’ve done with the phase one experiment.

The goal of phase one experiment is to implement end-to-end application with minimum struggle for hardware design and implementation.

What does the application do?

I am sure there will be a lot of testing work before I put the communication device in real applications.  So I first want a tool to test the driver and protocol.  Thus, the application for the first phase is a protocol tester that provides command line interface and several diagnostic commands / functions.

Continue reading

Inter Module Communication

I’m going to try making a digital communication bus for synthesizer modules.

Analog synth has a very simple control language which is voltage.  Any message is translated to voltage that can be read by any modules that accept voltage input. So for example, VCO output is basically audio output but also can be used as control voltage of some other modules, such as VCO cross modulation.

This simple data exchange methodology makes analog synthesizer very versatile and flexible.  However, as a drawback, patch wiring would become too complicated as you make complex module network.

One solution for making the wiring simple is to use a single common data bass where all modules are connected, and exchange data selectively using some software.  Apparently, making such a bass for analog signals is impossible or extremely difficult. So I’m going to try making it using a digital bass.

Continue reading

Basic Study of Voltage Controlled Envelope Generator – Full Calculation Approach

I did basic study of voltage controlled envelope generator based on analog circuit approach.  However, I found the implementation quite complex, although its quality was good.  So, I next tried another approach that has simpler circuit.  This version calculates the EG curve using micro processor, and makes analog output using PWM with minimum external filtering circuit.

This version is inspired by Tom Wiltshire‘s Voltage Controlled ADSR Envelope Generator.

 

Continue reading

Basic Study of Voltage Controlled Envelope Generator – Analog Approach

I’ve started studying voltage controlled envelope generator designs, since I have several use cases of it.

An envelope generator usually is implemented by an RC charging circuit with potentiometers as resistors.  However, such design does not capable of quick parameters change.  So voltage control (or digital control) functionality is necessary for better articulation.  Also, non-potentiometer control is crucial to polyphonic voices.

There are several approaches to design voltage controlled envelope generators.  This article describes about an analog approach which I tried first.

Continue reading

Matching Transistors, 2SC1815 or 2N3904

You need to use well matching transistor pairs to make a good quality transistor ladder VCF.

Above is the classic methodology to find matching transistor pairs.  I tried this procedure with 2SC1815 and 2N3904 I have.  Next version of Analog2.0 boards will support the both types of transistors, so I wanted to know how different they are in VCF perspective.

Here is the result:

The result shows that 2N3904 has less variability.

This comparison might not be fair since my 2SC1815 transistors are very cheap ones purchased from Akizuki-Denshi, so these might have different quality control in manufacturing than usual retail transistors.  But at least I learned following:

  • 2N3904 is good enough to be used for VCF (Naturally.  Actually, 2N3904 is more common than 2SC1815 to be used for VCF).
  • It’s always better to check matching of transistors when you make a VCF.