Reading Keypress with Python

This works for windows.

http://stackoverflow.com/questions/12175964/python-method-for-reading-keypress

However, you cannot use this feature from cygwin.  You need to invoke python script directly from Windows.  Double-clicking the python script works, but you need to catch exceptions in the case (otherwise, you don’t know what happened when an exception was raised).

Here is the sample program to read arrow keys.

SPI / RX collision test

spi_rx_collision_testDone collision test between SPI and RX in the comm driver.  The driver would receive RX signal any time, even while the host processor is accessing the driver via SPI to send or retrieve data.  Currently, the serial RX is handled in external input interrupt handler, so any bug in RX handler may break registers (i.e., states) for SPI communication.  I actually saw those bugs several times.  The bugs are fixed now and load test has passed.  In the test, the load generator keeps sending data via serial channel.  I’ve changed the timing of data retrieval in the host of the receiver so that SPI / RX collisions frequently happen.  Actually, they are happening every other packets in the test.  The test ran for 10 hours so far and there is zero communication error.  Session keeps going without freezing.

Dragon’s Tail

dragons_tailAs mentioned in my previous post, AVI Dragon’s SPI pins in debugWire interface have to be disconnected during debug run in order to properly run an application that uses SPI / USI.  I also noticed that the Dragon dominates RESET pin, too.  In my project, I’m resetting target chip from Arduino.  The Dragon is killing this functionality as well.  This makes me quite uncomfortable with my development work, so I’ve enhanced the switch I made on bread board previously, and made a helper device.  It’s nicely working.  I named it “Dragon’s Tail”.

Continue reading “Dragon’s Tail”

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.

Decoupling SPI pins from AVR Dragon

photo (3)AVR Dragon provides on-chip debugging feature through debugWire interface.  The debugWire utilizes the ISP six-pin header to control the target device as shown in the following link:

http://www.atmel.no/webdoc/avrdragon/avrdragon.section.zrr_osd_lc.html

However, the target application does not work correctly with SPI feature during debug run.

Continue reading “Decoupling SPI pins from AVR Dragon”

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 “Candidates for Noise Source Transistor”

Latency of Serial.println() with Arduino UNO

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

Continue reading “Latency of Serial.println() with Arduino UNO”

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 “Phase one experiment”

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 “Inter Module Communication”