Raspberry Pi Setup Memo

Search engine helps, but I'm so lazy that I don't like to do the same search repeatedly. Wireless LAN setup: Use application "Wifi Configuration" from GUI menu. Common WIFI dongle problem of falling of network: Power management feature is enabled in default for device 8192cu.  Having following file resolves the issue: pi@raspberrypi ~ $ cat /etc/modprobe.d/8192cu.conf # prevent power down of wireless when idle options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 See https://github.com/xbianonpi/xbian/issues/217 CAP/CTRL swap: See http://raspberrypi.stackexchange.com/questions/5333/how-to-map-caps-lock-key-to-something-useful Set static address to wifi interface: Edit /etc/network/interfaces.  If the setup for wlan looks like following, allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp modify as follows: allow-hotplug wlan0 iface wlan0 inet manual wpa-roam…

Noise Source Transistor — Conclusion

I have been working for a while to determine which transistor to use for noise source in noise generator.  I was using 2SC3311 which was obsoleted recently. I did several tests, mainly by listening, and chose BC547.  The reasons are: It has good taste as a noise source.  Easy to find sweet spots when using it with a filter and VCA. Noise level was close to 2SC3311, so my previous design works with simple replacement. Availability is good. Unlikely to get obsoleted soon. I started the test with listening "raw" noise without any modification and filtering.  However, it didn't work well.  Many of the candidates sounds similarly.  However, I found…

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. #!c:\Python32\python from msvcrt import getch import sys print("press ESC to exit") while True:     try:         key = ord(getch())         if key == 27: #ESC             break         elif key == 224: # special keys (arros, f keys, ins, del, etc.)             key = ord(getch())             if key == 75:                 print("left")             elif…

How to Play Sound with Python

This link helped http://stackoverflow.com/questions/307305/play-a-sound-with-python I'm working on Windows, so winsound worked.  It was as simple as #!/usr/bin/env python import winsound winsound.PlaySound("ex1.wav", winsound.SND_FILENAME)

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”.

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…

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.

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;
}