ZX81 driving a SID 6581

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
crankorgan
Posts: 163
Joined: Thu Oct 20, 2011 12:53 am

Re: ZX81 driving a SID 6581

Post by crankorgan »

(OK I got more info from Mike! I also gave him some links to my projects and pictures. Here is what he says)
(Mike Wrote)

I was going to say... I still didn't quite understand what you wanted,
but I think I get it now :). So you just need to know what you need to
poke into that thing to make a tone.

If you download the source code I posted, I think everything is in
serialio.c. To initialize the chip I do:

POKE(54296,15) // volume control (15=full blast!)
POKE(54277,190) // envelope generator 1
POKE(54278,248)
POKE(54284,190) // envelope generator 2
POKE(54285,248)
POKE(54291,190) // envelope generator 3
POKE(54292,248)

off the top of my head, 54296 just sets the volume all the way up
and the next 6 lines set how all 3 voices should sound like (attack,
decay, susain, release).

To play the sound:

POKE(54272,sid_freqs[tone]&255)
POKE(54273,sid_freqs[tone]>>8)
POKE(54276,17)

The frequency is a 16 bit number at 54272, 54273 ... and the waveform
I believe is 54276. I'll have to check the addresses later.

All of these addresses are offset from 54272 btw.. if you just ignore
the upper byte of the address you should okay.

Do you have any pictures of your project btw? That might be cool to see :)

/mike
crankorgan
Posts: 163
Joined: Thu Oct 20, 2011 12:53 am

Re: ZX81 driving a SID 6581

Post by crankorgan »

Picture of SID "Vicious" setup

ZX81 with BBUM and Buffer Board feeding first Proto board with three output buffers. That is going to drive
the second proto board with the SID, amp and speaker.


http://crankorgan.com/SID1.jpg
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ZX81 driving a SID 6581

Post by Andy Rea »

I love it
what's that Smell.... smells like fresh flux and solder fumes...
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: ZX81 driving a SID 6581

Post by sirmorris »

crankorgan wrote:SID "Vicious"
:lol: :lol: :lol: :lol:
crankorgan
Posts: 163
Joined: Thu Oct 20, 2011 12:53 am

Re: ZX81 driving a SID 6581

Post by crankorgan »

Thanks to Mike my worst fears were realized. In a Commodore 64 the SID gets it's address values from the computer. A Poke hits the chip with two values. One binary number from the address lines and one from data lines. The R/W seals the deal. My circuit has to Poke four times for each value. The first Poke puts the Address in latch one. The second poke puts data into the Data Latch. The third and forth Poke turns the /CS signal on and off to load the data from the latches to the SID! So if the SID makes noise I then work from there.
You might also have notice you have to load the SID up with Data before you can send in notes. You also have to send in more data if you change voices. Yea! this is going to get interesting!
crankorgan
Posts: 163
Joined: Thu Oct 20, 2011 12:53 am

Re: ZX81 driving a SID 6581

Post by crankorgan »

As I am wiring up this beast it hits me that I can use the ZX81 address. Each one of my three latches works within a segment of addresses. The SID address wants 0 to 31, 8 bits of data and a /CS so I should be able to fire two latches at once. One pulling out the address of the Poke and one the Data. A One Shot will extend the /CS signal so the SID clock can move the data. None of this will be any good if I can't understand the loading of the SID registers. Back to wiring the beast.
crankorgan
Posts: 163
Joined: Thu Oct 20, 2011 12:53 am

Re: ZX81 driving a SID 6581

Post by crankorgan »

A quick review! The SID has 5 address lines and 8 data lines.

A POKE 54296,15 on a Commodore 64 means what? (Turn up the Volume)

Here we go! you take the Poke 54296 and subtract the Base address of 54272
and get 24!!!

So 24 in Binary goes on the Address lines

A4 A3 A2 A1 A0 Address Lines Pins 9 to 13
.1..1...0...0..0

Then the 15 after the comma is Data in Binary

D7 D6 D5 D4 D3 D2 D1 D0 Data Lines 15 to 22
.0..0.. 0..0...1...1..1..1

Then /CS has to go from High To Low long enough so the 1MHZ OSC can shift it into the SID


Picture of "The Beast"

http://crankorgan.com/sid2.jpg
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: ZX81 driving a SID 6581

Post by sirmorris »

You got it!
crankorgan
Posts: 163
Joined: Thu Oct 20, 2011 12:53 am

Re: ZX81 driving a SID 6581

Post by crankorgan »

I did some cooking and a long walk today. I put some of the numbers in and watched them work the lights. I am using the PAUSE in my basic so I can see the numbers going into the buffers and the /CS then turning on and off. The /CS light lights but I use a buffer to make the signal go from High to Low. I will do the rest tomorrow. I don't want to go to bed with it not working. :o It would keep me up! :lol: I got a handle on the SID to a certain point. I am also working my next moves if I get sound. :roll:
crankorgan
Posts: 163
Joined: Thu Oct 20, 2011 12:53 am

Re: ZX81 driving a SID 6581

Post by crankorgan »

Still no sound! My next step is to have my basic program set all registers to zero. Easy in a Commodore 64. With my setup it will need lines of code because I am using three output latches with different addresses. Thinking it over I can let the DATA latch stay at all zeros as the others are poked. :?
Post Reply