Page 5 of 7

Re: ZX81 driving a SID 6581

Posted: Fri Jan 06, 2012 9:59 pm
by crankorgan
Pastbytes,
I am rewiring on my new Proto Board. The old one is worn out! I also swapped the Transparent Latches (74HC373) to standard Edge Triggered 74HC273. My first circuit that used three latches and three Poke locations worked. I have a complete 64 system. I like my ZX81 better because it is hard to kill and easy to fix. I lost my Battery Backed Up program when I ohm-ed out a connection. :| I am starting over with just one latch and the 8K to 16K signal off my buffer board.

John

Re: ZX81 driving a SID 6581

Posted: Fri Jan 06, 2012 10:20 pm
by pastbytes
If you have some CIA6526s perhaps you would want to read the datasheets. It's an interesting chip, it has two 16-bit timers, two bidirectional programmable parallel ports, parallel-serial conversion, and a real time clock (it counts the 50/60Hz cycles of the AC power line). ;)

Re: ZX81 driving a SID 6581

Posted: Sat Jan 07, 2012 12:36 am
by crankorgan
Pastbytes.
I have a program running. It does a Poke 8192,0 Poke 8193,0 Poke 8194,0 Poke 8195,0 Poke 8196,0 Poke 8197,0 Poke 8198,0 Poke 8199,0 When it goes to Poke 8200,0 It goes bad. I can also do 10240,0 ETC and it works 8 address. It is trying to tell me something. Maybe my buffer board is wired wrong? The LEDs count from 0 to 7 then repeat!


John

Re: ZX81 driving a SID 6581

Posted: Sat Jan 07, 2012 2:42 am
by crankorgan
Short on output buffer. I used the type of perf board with traces on the back. I cut unwanted traces but of course a teeny tiny piece of copper held on! I got the LEDS working a 1-2-4-8-16-32-64-128 pattern With 8 different pokes. This works off a BASE number of 8192 just like the commodore 64 does. Now to add DATA lines!

Re: ZX81 driving a SID 6581

Posted: Sat Jan 07, 2012 7:44 am
by pastbytes
Could you post the circuit you are using? I don't understand what those pokes do.

Re: ZX81 driving a SID 6581

Posted: Sat Jan 07, 2012 1:04 pm
by crankorgan
Pastbytes,
On a Commodore 64 (in BASIC) you Poke 54296,15 to turn up the volume all the way. The base address is 54272. So if you subtract the Base of address from 54296 you get 4. So a Poke 54296,15 becomes 4,15 4 on the Address Register lines and 15 on the Data lines. OR in binary 00100 on the address and 00001111 on the data lines. If you run a SID from a micro you have to hit it with an Address and Data followed by /CS. The /CS pulse has to be long enough to let the Address and Data Clock into the SID. The lines need to be CLEAN. I don't know if the SID can be wire directly to the ZX81. I am doing things in stages with LEDs on the Address and Data Lines. I can watch what is going into the SID. Each experiment has less chips as I better understand what I am doing.

I used a 74HC251 to make the Strobe /CS signal at Base address 8192 . It strobes from Low to High when a Poke 8192 to 16384 is run or Poked in! It is the same wiring as my BBUM seen here. I use a Base Address of 8192 so a Poke 8196,15 turns the volume of the SID hooked to the ZX81. It used to take Four Pokes. Poke 8192,4 For the Address then Poke 10240,15 for the Data. Then Poke 12288,1 and a Poke 12288,0 to make /CS go High then Low.


John

Re: ZX81 driving a SID 6581

Posted: Sat Jan 07, 2012 9:56 pm
by pastbytes
Ok, the SID's 29 registers have to be poked using base address 8192, that is addresses 8192 to 8220. Mode/Volume register is at base+24, not base+4 (control register for voice 1).
To make a 1KHz tone, you need to do:
POKE 8216,15
(maximum volume for the 3 voices)

POKE 8192,139
POKE 8193,65
(voice 1 frequency low/high)
The 16-bit value is determined by (for 1MHz clock): Frequency / 0.0596

POKE 8197,0
(minimum attack time (2ms) and decay time (6ms) for voice 1)
POKE 8198,240
(maximum volume for sustain (15) and minimum release time (6ms) for voice 1)

Then you can start the sound with POKE 8196,17
This is 16 for triangle waveform + bit 0 set to start the attack cycle. 2+6ms (attack+decay) later voice 1 will be in sustain cycle and will remain there with maximum volume until you start the release cycle with POKE 8196,16
You don't need to stop the sustain cycle to try other frequency values.
If you intend to use square wave, you have to set the duty cycle at registers 2 and 3 (8194 and 8195).

Re: ZX81 driving a SID 6581

Posted: Sat Jan 07, 2012 11:30 pm
by crankorgan
Pastbytes,
The new circuit let out a noise! I need to make the /CS pulse longer. I have an inverter on my latch signal to make the /CS. I had to go to a neighborhood meeting. Now I have to get dinner.
Then I will add a one shot to the /CS signal.

I used

POKE 8196,15 Volume High
POKE 8197,190 Envelope Gen 1
POKE 8198,248
POKE 8204,190 Envelope Gen 2
POKE 8205,248
POKE 8211,190 Envelope Gen 3
POKE 8212,248
POKE 8192,200 Tone Low
POKE 8193,80 Tone High
POKE 8196,17 Waveform

Re: ZX81 driving a SID 6581

Posted: Sat Jan 07, 2012 11:45 pm
by crankorgan
If I run

10 POKE 8216,15
20 PAUSE 10
30 POKE 8216,0
40 GOTO 10

I hear the Volume poping up and down but not evenly. It is hit or miss. After I put in the onshot I will adjust it so every /CS is long enough to clock the data in! Wish me luck!

Re: ZX81 driving a SID 6581

Posted: Sun Jan 08, 2012 12:55 pm
by sirmorris
Good luck!!

I'm enjoying watching your progress :)