Category Archives: MIDI

AVR Board Works Only After Reset

As a not-so-new-but-still-a-novice electronic enthusiast, I recently have my second version ATTINY84 board in my hands and have everything soldered on, program burned.

What this custom AVR board does is collect signal from 1 or 2 piezo sensors, translate that signal into a C structure, and transmit that structure wireless via a cheap NRF24L01 module I bought from the ubiquitous site: taobao.com(淘宝). I have another NRF24L01 module, which receives the structure and decomposes it if it is valid, then sends via SPI interface the decomposed data to an Arduino UNO, which is turned into a class-compliant USB MIDI device. This Arduino uses this data to compose a standard MIDI message and send it to a Mac via USB cable.

Everything seems to work well, except one little glitch: the microcontroller freezes after the first sensed signal and never goes on. I solder an extra 47uH capacitor between Vraw and GND to ease out the sudden voltage rise, but nothing changes. Luckily I have a friend Google(well, not a so friendly friend because I live in China). After a few hours of googling, I get some hint from this post, then I burn another bootloader with attiny addon inside Arduino IDE to use the internal 8 MHz oscillator as the clock source, then the freezing goes away. As per my understanding, wrong fuses must be the cause. After searching for the correct fuse values, I get this advice: Always go with the longest setting 14CK + 65ms unless you know for a fact your clock source needs less time and 65ms is too long to wait. I take this advice and re-calculate fuses with this utility: Engbedded Atmel AVR® Fuse Calculator, then write the result to the ATTINY84

Voila! The 20 MHz external crystal oscillator works, too, and the indicator LED blinks as expected, so I can move on to improve my code.

How to Program Attiny84 to Use nrf24l01 Module with Arduino IDE

I want to create a drumkit that transmits MIDI signals wirelessly, to some MIDI processing device, say, a Mac or an iPhone. Arduinos are powerful and easy enough to get started with, but I want my project to be more portable and task specific, so I decide to shrink it down to an attiny84 powered board.

Lucky as I am, I found this Optimized High Speed NRF24L01 library by TMRh20, which is powerful and easy to use, and also supports Attiny series microcontrollers. Continue reading How to Program Attiny84 to Use nrf24l01 Module with Arduino IDE