Lab Notes: 15/06/18

A tough but productive day in the lab all in all. After failed attempts to flash a ATTiny85 via a USBasp programmer obtained for a couple of pounds at Maker Faire Newcastle, I decided to resort to using an Arduino UNO as an ISP. Again I faced similar problems flashing the ATTiny85 via AVR Dude. The Mac Terminal complained of undefined references to registers. This problem was reported in the book ‘AVR Programming: Learning to Write Software for Hardware’. The book suggests that this could be due to an issue with portpins.h. Apparently there is an inconsistency between portpins.h provided in early versions of the Arduino IDE and portions.h supplied with the AVR library included with the book. This was when it occurred to me that perhaps it was the AVR Library which was the source of the error. I remembered seeing an MIT tutorial for writing to the ATTiny85 via the Arduino IDE which was conveniently linked to via the Bastl Instruments site. Suffice to say that after following the tutorial I was able to successfully flash the ATTiny85 using the Arduino IDE and an Arduino UNO as an ISP. My next question is can the Arduino UNO be replaced with the USBasp? Through the process of troubleshooting I managed to successfully update the firmware of the USBasp, so it’s ready to be tested but in the interest of time I’ve decided to leave this for another day.

Following guidance from Peter Edward’s tutorial on the ISD1820 I breadboarded a circuit which Peter had based on a circuit described in the ISD1820 datasheet. Pitch control is provided through a sliding potentiometer, and a toggle switch activates sample looping. Another feature taken from Peter’s suggestions is a line level input. Peter’s schematic provides two gain settings. I decide to opt for the high gain configuration only as the use case I have in mind is that of recording audio from a computer or phone. When I initially test the circuit, it appears to record but with a large amount of high pitch noise. After snooping around I was able to attribute this to the SPI connections coming from the Arduino Uno to the ATTiny85 which was still on the same breadboard. I was surprised by the amount of noise created. Removing these connections solved the issue immediately.

With the circuit now functioning without the additional SPI noise I was able to explore its operation. I enjoyed playing around with it. The ISD1820 is certainly lo-fi, however it has potential to be musically interesting and fun to use. Both the mic and line inputs clip very easily. I’m going to explore changing resistor values in an attempt to reduce the gain on both. Also, currently the mic and line inputs are recorded simultaneously – I wonder if there’s a way to cut the mic when a jack is connected to the line input? I did try temporarily disconnecting the mic from pin 4 of the ISD1820, however, this resulted in high-frequency ‘warbling’ being produced from the audio output, which I assuming is due to the fact the mic reference voltage was still connected to pin 5.

Another aspect which warrants further investigation is the unreliable behaviour of the ISD1820 if record is activated whilst the loop toggle switch is on. Essentially, not often than not the ISD1820 will fail to play ‘and loop’ after the record function is stopped. Switching loop off then on again usually fixes the issue. Pin 13 of the ISD1820 is used to signal when a sample has finished playing. An LED is connected to this pin, which is kept high until the end of the sample, when the pin is briefly set to low, which results in the LED flashing. Interestingly this means that looping functionality can be achieved by connecting this pin to either of the two play controls. My current thinking is that perhaps I could use a switching transistor to temporarily switch off loop when record is active. I haven’t fully thought this through but I’m keen to dig around in my component box and see if I can find a transistor to try during the next lab session.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s