Thursday, December 5, 2013

Tools


Here are some tools I acquired for this particular project, which I hope to use often for now on and which I regret not having bought earlier:

  1. Hot Glue Gun: I glued the screen to the case using this. Seems like the kind of thing that everyone should have at home.
  2. Step Drill Bits: These are greats for making big diameter holes, for potentiometers or switches for example. If you do guitar stomp boxes or analog synths you need these, I regret not having bought them before, making big holes with small drilling bits is a pain. I got these from Dealextreme, here.
  3. USBtinyISP: Already mentioned about this one here. This was a replacement for my JTAG+ISP  AVR programmer.

Thursday, November 28, 2013

ADC error and Switch debouncing

Now that I have the IO hardware working, I have noticed a couple of issues in the potentiometers and switches inputs to the AVR:

  1. Potentiometers readings in the ADCs are not stable and seem to fluctuate
  2. Switch readings are bouncing on button press.
I found this great site: Newbie Hack where both topics are covered and clearly described. For the ADC stability issue, you can find this way of measuring the error. No info is giving on how to remove this problem, but I suppose a low pass filter should do. As for a way to do switch debouncing, you have it here

Still need to implement this solutions and try.

Update (12/03/2013):
Fixed the switch debouncing by only reporting switch changes after a certain number of unchanged reads, similarly as explained in the links above.
For the Potentiometers, I added some histeresys, I only report potentiometer changes when the read value exceeds the previously sent value by a certain amount, which gets rid of all bouncing issues, althought the cost is high as the potentiometer changes are not as smooth as they could be. still need to work on that.


JUNO6PM Enclosure

Been working lately on casing all the hardware. This is how the box is looking now:



And these are the internals:



Still need to add a power off switch, audio input jack (I plan to use the same hardware for guitar processing), external USB and Ethernet connector, but at least I have all the synth part hardware ready.

Sunday, November 17, 2013

Powering my RasPi

Just as many others, I got a small TFT monitor used in car reverse cameras. This monitor has a 12V DC input for power but, as SK Pang points out here, internally it has a 5V regulator and uses that for powering the unit. Unlike what SK Pang did, I did not need to replace the 12V power feed with a 5V one, what I did instead was get the 5V required for the Raspberry Pi from the monitor Regulator. 
My monitor is slightly different model from the one SK Pang has (although it looks identical externally).

The picture bellow shows how I connected a USB cable for feeding the RasPi:


And this is my RasPi powered by the monitor and showing a quick mock up of how the GUI will look. I used Mindchunk's OpenVG library to make that GUI (for now it is just a quick and dirty test).

Using Raspi Serial Port

Lately I have managed to find some time to dedicate to this project. I am currently working on the Hardware side, will have some pictures of the box I am making soon. I am also starting to do some GUI work using openVG. And just today I connected my AVR board to my Raspi via serial (was using PC before). I will be explaining the details of this last effort in this post.

So I am using the Raspberry Pi serial port to communicate with my AVR board handling all the control I/Os. I will explain here what I did for getting that to work:

The first step was to disable the console output via serial port. To do so, you need to edit the file /etc/inittab and comment out the following line:

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

And editing /boot/cmdline.txt removing the references to ttyAMA0. This:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Should look like this:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait 

This info is all coming from here.

Once that is done, since I am working at MIDI speeds, you need the change the the UART clock speed. I added this inside config.txt:

init_uart_clock=2441406
init_uart_baud=38400

And I modified the /boot/cmdline.txt again adding "bcm2708.uart_clock=3000000":

dwc_otg.lpm_enable=0 bcm2708.uart_clock=3000000 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait 

Then setting up your UART as 38400 magically makes it be 31250 and MIDI. This is coming from here, here and here.

Thursday, July 25, 2013

Did I say SW UART?? No... no... HW UART

After investigating the possibility of using SW UART for MIDI out, I decided to give up... I had lots of issues getting reliable serial baudrate conversion and did not have enough spare time to investigate further, as can be seen based on my lack of posts in the last few months. So I am now using HW UART, 31250 in, 31250 out... no conversions... and that seems to be working fine. Took me some time to actually get it right, I thought I was also loosing bits there, until I found out about the running status in Midi... dammed it.. should have read the midi specs!!!

On the Raspi side, I plan to do as explained here to get the serial port to work at 31250.

Monday, April 8, 2013

SW UART

My plan is to have my AVR board handle midi Input and send that to the Raspberry PI (as well as the potentiometer and switches status) through 38400bps serial port of the Raspberry Pi. To do so, the AVR will be receiving MIDI through the HW UART and will be sending serial data by bit banging.
I tried using the SW UART implementation of AVR lib, but it seems to be failing every now and then (actually very often). I was expecting it to "just work" and let me work on other stuff, but it seems like I am going to have to spend some time debugging the code from AVR lib or looking for other alternatives... I am not big expert on AVR coding, so I expect a few nights of intensive work.
Meanwhile, I am almost done modifying rtMidi to allow Midi comming through serial port.