Go Down

Topic: SID Chip and 8 Bit Arduino DAC (Read 7497 times) previous topic - next topic

D4p0up

Jul 13, 2011, 05:58 pm Last Edit: Mar 08, 2013, 01:39 am by D4p0up Reason: 1
Hi people there,

I'm new to the Arduino community and started to play with an Arduino board 3 weeks ago. I have been through several schematics, eventually implemented a good Midi interface, played a lot with PWM and R2R ladder DACs, and made a simple but efficient shield for the Commodore SID chip.

Just wanted to share two things here :

A "DIY" SPI 8 bit DAC worth 0,85€ using R2R ladders and a 74HC595. It has been proved to work very well and allowed 8 bit R2R DAC on my Uno without using 8 pins of the board, and reaching output rate of 330kHz, far higher than any audio rate you'd expect.

The SIDaster shield is an Arduino shield for the SID (MOS6581 and nexts) audio chips from Commodore. It has been test proven to work well with diodes and a real SID chip.

However, I'm sharing the stuff, and would be glad to gather any feedback you have.

Loving the Arduino,

Vincent
Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

robtillaart


Hi Vincent,

Would make a very nice signal generator.

about extending to 16 bit:  by using 2  595's you could create a stereo 8 bit too

Can you post some code you used to test?

Thanks,
Rob


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

D4p0up

You're right ! added some code samples and digged a little into the details of how my DDS works.
I hope this helps,
Vincent
Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

robtillaart


Hi Vincent,

Thanks for the code, is an improvement,

not to nag, a complete running sketch is what most people (and I) like the best ;)

Rob



Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

D4p0up

This looks like a small bump indeed, but thanks to the help of another enthusiast Arduino SID user, the SID shield has produced its first sounds a few hours ago. The code will be updated with the bugs found, but it's alive, ALIVE ! :)
Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

Feliksas

So did anyone had any luck in interfacing with MOS 6581 \ 8580 SID? I want to do that, but have no idea where to start =( For instance, if I have Arduino mega2560 and MOS 6581 - I'd like to be able to play sound directly from the arduino itself (take the sound bytes from an SD, and put them into 6581's registers - no emulation, no external MIDI source). And, possibly, seeking a way to decode SID files into registers that I can send to the SID and play. Any ideas? Googled a lot, still haven't found a decent solution, where everything's explained.

D4p0up

#6
Sep 15, 2011, 01:47 pm Last Edit: Sep 15, 2011, 01:50 pm by D4p0up Reason: 1
To answer your question : the Arduino SID Shield & Library I propose >>here<< is the solution to control a SID side. Thanks to the help of another SID enthusiast Matthew (who kindly gifted me with one of his SIDs when i broke mine), it has been proven to be working good.
We both made our SIDs sound great using the same schematic. For the library itslef, matthew and i are improving it at the moment, I shall release an updated version end of next week.

But the schematic in itslef is perfectly working: you can use an Arduino to both :
- generate the SID clock and manage it
- access its memory registers using HW SPI through two 74hc595

I also have a shield prototype under construction, as you can see in the image attached.

Concerning the SD card: you need to dig elsewhere, like the shields from Rugged Circuits which are a good choice. You will however encounter SPI concurrent access though, so you'll have to make chip select tweaks.



Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

Feliksas

So I guess I just need to omit the MIDI IN part of the scheme, and I'm good to go =) I've decided to use an external 1MHz quartz generator to minimize pain with clocking; and, concerning SD, I believe, I am gonna read the SID data in 512B blocks to an internal buffer in RAM, and I'll have to switch between two fours of SPI pins on the fly: SPI to SD -> Read data to a buffer -> switch to SID -> resume playing from RAM. Hopefully I will have enough time for all this to not to interrupt playing =) I just need to wait for my SID package to arrive =)

D4p0up

Timing is THE thing I'm working on actually.

As per now, a SID 8 bit Write takes rouglhy 600us, including the 300us delay needed byt the SID to "digest" the data before being available for a new Write.
Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

Feliksas

By the way, could you share the full code, that can play the midi from midi-in according to your schematic? =)

D4p0up

#10
Sep 15, 2011, 10:40 pm Last Edit: Sep 15, 2011, 10:42 pm by D4p0up Reason: 1
Sure, here it is, the debug code for a mono 3 harmonics Synth.

Note that the Midi handlers are built to maintain memory of the previous note played, to enhance the playability of the synth when playing legato on a keyboard (i.e. pressing the nex note while the previous one is still pressed, to avoid note off collison).

The SID library is being updated atm, but it shall work with this one.

Have fun !

(and again : credit for the SID Library last release goes to Matthew D.)
Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

Feliksas

I am damn very much grateful!!!!  XD Since I'm a newbie, that'll help me greatly to adapt the code for my project for the ongoing 8bit event =) I would certainly mention that it would not be possible without this library (well maybe it could be, but I wouldn't have finished my work in time =) )
Can't wait for my SID to arrive to start tinkering around with SD read. I'm planning to make it switchable: option 1 - play from SD, option 2 - play from a midi synth, option 3 - input 8bit pcm and decode it. I'll post here when I achieve at least something =) also it would  be nice to see lib updates here, as they occur =) Thanks again !!!  :smiley-mr-green:

Zapro


Thanks to the help of another SID enthusiast Matthew (who kindly gifted me with one of his SIDs when i broke mine), it has been proven to be working good


Would you please update your website, stating that it indeed does work with a working SID chip ? I stumbled upon your site earlier, and left because the site tells me that you never really had it working besides with an "dummmy" SID...

// Per.

D4p0up

#13
Sep 19, 2011, 10:59 am Last Edit: Sep 19, 2011, 11:03 am by D4p0up Reason: 1
Hi.

Sorry you stumbled upon it, unfortunately it has been successfully "Real-Sid-tested" last thursday night ... and i could only update the website yesterday night.

So now the article has been updated, and more than anything : MAH SID IZ MAKIN NOYZ !

http://fullmaj.rd-h.fr/wordpress/?page_id=262

Regards
Arduino sound Reseach - http://bit.ly/fullmaj [fr][en] | Homemade Free VST - http://zomg.zxq.net [en]

Zapro

Ohh, nice!!

Can you upload a sound sample somewhere so i can hear the noise ? ;-)

// Per.

Go Up