Last edited by keoni29 on 23 Dec 2013 07:09:00 am; edited 3 times in total

Edit: New video

Old news and old sourcecode!
Old picture, yet gives a good overview of the hardware.
Newer picture with the on off switch, midi connector and jumper settings for midi/sid mode selection.

This is an atmega microprocessor emulating a SID soundchip. (found in old c64 homecomputers) I used a library for the emulation and I wrote my own link protocol. The calculator shifts out the data and the arduino code processes it. This thing works with everything with two free GPIO pins. The link protocol is pretty simple to implement. I designed it with the TI84+ in mind, but you can hook it up to any calc with a bidirectional open-drain linkport. I programmed the link protocol in AXE.

Hardware:
The tip of the 2,5mm plug is connected to arduino pin 2 (DIP pin 4) and the ring is connected to arduino pin 3 (DIP pin 5.) Remember that the pinout of the arduino is not the same as the microcontroller. Check the pinouts before you build this.
Pin 9 (DIP pin 15) is the audio output.

Isn't this a duplicate of your old topic? Or am I thinking of the UARTunes project for the Prizm? At any rate, this seems like a cool project. Do you have any better or more extensive sound samples? How many bytes per minute is the music? How many channels does this support? You specified that it requires a bidirectional open-collector linkport; why? Is the protocol like the TI linking protocol, in that to acknowledge a state change on one line, the peer pulls the other line low?

I'd assume, since it is emulating the SID, It would have 3 channels monophonic.

KermMartian wrote:

Isn't this a duplicate of your old topic? Or am I thinking of the UARTunes project for the Prizm? At any rate, this seems like a cool project. Do you have any better or more extensive sound samples? How many bytes per minute is the music? How many channels does this support? You specified that it requires a bidirectional open-collector linkport; why? Is the protocol like the TI linking protocol, in that to acknowledge a state change on one line, the peer pulls the other line low?

I want to add "hardware" pitch bending with different modes such as LFO, portamento and sweep. The sound processor will also have a lookuptable with musical notes' pitch values. If you write to one of the three dedicated "musical note" registers it will relay it to the freq-hi and lo registers and it will turn on the gate of the channel. This saves a lot of memory and time on the calculator side!

Creating "shortcut"-style commands is definitely a good idea to save space. I'm going to play around with the PWM in the TI CC430 processor that Tari, geekboy, and I are thinking of using for our wireless CALCnet adapter to see if I can make a MOD tracker; that sort of compression trick would be very handy.

After I shot this video and put it all back together it worked for a while and then it just stopped working. Perhaps some dodgy soldering or short circuit. I took the mods out and started optimizing source code and what not.

void loop()
{
if (!bitCount){
// Pull down clock line to make sure the calculator does not send while the atmega
// is processing the incoming data.
SET(DDRD,3);
Serial.println(get);
get = 0;
bitCount = 8;
CLR(DDRD,3);
// Released the clockline.
}
}

The arduino can only receive the data sent from the calculator and it cannot send anything. It can reach speeds up to 2KB/sec because it uses interrupts. That is 32.000 Baud!
There is a bi-directional version I'm working on. It works, but I want to optimize it further and make it really stable before I release it. There is a sneak peek version on omnimaga: http://ourl.ca/18162/341428
Once the linking is reliable I plan on adding the SID emulator back in as well as some I/O operations the calculator can access such as digital to analog conversion and analog to digital conversion.

I put this project on a hold for a few days because I am working on a game that will eventually make use of the soundchip (but this game will not be dependent on the presence of the soundchip.) This is to give people a reason to build one of these things. I might write a simple chiptune tracker as well because I have to

There is not a lot of free ram available on the microcontroller. Just 2K and the emulator and communication software uses some of that. Songs can get large pretty quickly when you have a lot of swirls and effects in them. The calculator has a lot more memory compared to the microcontroller.

Last edited by Luxen on 14 Mar 2013 07:02:28 pm; edited 1 time in total

nah, i mean if you made the sound card with its own storage and all. even so, i think the practicality may be a bit difficult. but, essentially you could have the card do all the audio parsing, freeing up the z80 for more processes.

That would make it more expensive and more difficult to make and thus less attractive for people to build themselves. For those who want something more demanding could also send data via serial to the pc which makes mp3's play for example.

I am working on a minimalistic music editor that I am going to use for composing music for my Hero Core port.
16 step 3 channel loop. All triangle waves.
64 step 2 channel loop. All triangle waves. No use of ADSR volume envelope.

Edit: Some notes might sound a bit off. That's because I am using a frequency table made someone else and it's not very accurate. I will calculate a new one in excel.

That sounds great, keoni29! I must say that so far I don't hear anything terribly different from what a mod music player like MobileTunes could generate directly, so I look forward to what you can generate with different waveforms and dynamics. Percussion would be much easier for you, for example.

Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.