Page 1 of 5

Hybrid SID Player

PostPosted: Sun Apr 17, 2011 4:25 am
by Markus Gritsch
Hi,

I am currently working on a kind of hybrid between an emulated and a hardware SID Player. The CPU and CIA stuff runs emulated on a PIC32 and the sound is generated by a hardware SID chip.

I had the TinySID emulator already running [1] on a PIC32 board I built some time ago [2], and now had the idea, that it would be cool to have the sound being generated by a real SID. To say it with NVIDIA's words: The way it's meant to be played ;)

The emulation routine runs as previously, but every time new values for the virtual SID chip are calculated, I write this virtual registers to the corresponding ones of the real SID chip. It works pretty well.

Two pictures of my initial setup are attached. After this proof of concept, it took me quite some time to get the analog part to a level, where I was satisfied with the audio quality. In the process of experimenting with different power supplies and voltage regulators to get rid of the noise and supply-hum, I subsequentially destroyed all three SID chips, I had. These old chips are quite sensitive -- not comparable with todays ESD protected chips.

On eBay, SID chips are not as cheap as they used to be, and I had to wait another long time to receive one I bought there. But finally it seems I have a working setup with quite good audio quality. I recorded two examples and attached them also. (I had to put the MP3s into .zip files since this forum software prohibits .mp3 as extension x-)

Have fun,
Markus

[1] http://www.youtube.com/watch?v=ZNu0-MZ9WLI
[2] http://overtone-labs.ning.com/forum/top ... ent%3A1805

Re: Hybrid SID Player

PostPosted: Sat May 21, 2011 2:27 pm
by Markus Gritsch
Hi,

just a quick update -- the breadboard prototype and the firmware (attached to this post) are fairly complete.

The PIC32 acts as USB host to the attached memory stick, which contains all my favorite tunes in .sid format from the HVSC [1]. I used Elm Chan's FatFs library [2] because it hat LFS (long filename support) together with the Microchip USB stack [3].

The SSD1308 OLED displays the filesystem, and the rotary encoder is used to scroll up and down. By pressing the rotary encoder button one can change into a subdirectory or start a .sid tune for playing. The screen content is rendered into a framebuffer in RAM and transferred using DMA autonomously. In playing-mode the OLED displays some tune information, the selected subtune and the playing time.

The two small push-buttons on the beadboard are used to temporarily suspend playback (pause) and change the playing speed to 10x (fast forward).

[1] http://www.hvsc.c64.org/
[2] http://elm-chan.org/fsw/ff/00index_e.html
[3] http://code.google.com/p/cui32/source/b ... s_Test_MGr

Re: Hybrid SID Player

PostPosted: Sun May 22, 2011 7:14 am
by Markus Gritsch
Hi,

here are some pictures of the shield I made for my CUI32 using a perfboard. Since I needed the vertical space to stack the OLED display, the "socket" for the SID chip consists only of the precision drilled pins. They can easily be sunk-in by widening the perfboard wholes using a 1.5 mm drill. The two switches on the upper-right side are for the left and right channel where one can select between the emulated TinySID output of the PIC32 and the analog output of the SID chip, as shown in the schematic.

Re: Hybrid SID Player

PostPosted: Sun May 29, 2011 3:06 pm
by Markus Gritsch
To conclude this project, I added a headphone amplifier to the perfboard. I had this in my mind when soldering the other parts on it, so luckily there was enough space left :) Here is the updated schematic and some pictures of the finnished board.

Re: Hybrid SID Player

PostPosted: Sun May 29, 2011 4:18 pm
by Markus Gritsch
A YouTube video is available here: http://www.youtube.com/watch?v=gw-TQaskkQ8

And here is a follow-up video http://www.youtube.com/watch?v=1nCUBvLy_ps demonstrating digi-support.

This video shows some level-meters: http://www.youtube.com/watch?v=95nSrqpmLa0

Re: Hybrid SID Player

PostPosted: Mon May 30, 2011 2:55 am
by ian
Amazing work, as always!

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 1:14 am
by Gianni
This is one of the most interesting projects I've ever seen. I hope you'll release the firmware and that a kit will be soon available. I really like this project... I need to have this

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 1:39 am
by Markus Gritsch
The firmware is attached to the second post. As for the kit, I'm afraid you will have to build it yourself from the schematic.

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 1:57 am
by Gianni
Where I can get the SSD1308 display you've used?

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 2:25 am
by Markus Gritsch
I got mine from SeeedStudio, but it seems they no longer carry this exact board. Further, since they made only the slow I2C interface available, I modded it so that the much faster SPI interface can be used.

Mind you, the PIC32 board is also custom built and uses a PIC32MX795F512H, because it has 128 kB RAM.

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 2:51 am
by Gianni
Sigh... Then is impossible for me to realize this project... Why don't you make a complete kit, without the sid? Many people will be interested in this... I'm the first.

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 3:20 am
by ian
It would be a killer kit!

The SID availability seems like a big issue though - in the original post Markus said it took a while to get a replacement for the broken test chips. Now, if you could make a DIP-shaped adapter that dropped in if you don't have an SID chip...

Another problem is SMD components. I don't think any PIC32s come in DIP, or even an easy TQFP-44. In my (humble) experience with SMD kits, more people order them by accident than want to build them, once SSOP or TQFP64 parts are involved.

I would *love* to see something like this as a kit though. It's retro fun.

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 1:16 pm
by voidptr
great project , real cool results ! :-)

now it needs to be "more mobile", some battery pack will be needed so you can replace your ipod with it !
:-)

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 2:19 pm
by Markus Gritsch
Well, it actually *does* replace my first generation iPod nano running Rockbox [1] which can play .sid tunes :) I commute by train, and they usually do have power outlets, so no problem there. I can only imagine how geeky I must look plugging earphones into this "thing" ;)

It was not really designed for battery use, since there are some limiting factors for power saving: The USB stick gets quite warm. USB memory sticks are not designed to conserve power, but to be fast. Second, the PIC32 runs at 80 MHz and thus also gets warm. Third the SID chip itself is vintage design dissipating a good part itself :)

The whole thing draws about 370 mA, so I decided to use a small switch mode wall wart.

[1] http://www.rockbox.org/

Re: Hybrid SID Player

PostPosted: Wed Jun 01, 2011 7:16 pm
by voidptr
:o)