Playing with a DAC

Home Forums Z80 Playground Early-Adopters Playing with a DAC

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #818
    Phil_G
    Moderator

    Just a bit of fun
    Cheers
    Phil

    Playing with a DAC

    #820
    GlynD
    Participant

    Fascinating Phil_G, were you thinking of doing a “mini how-to”?

    So many questions…
    I’m interested to see the schematic for the DAC board and how you interfaced it to the Z80 Playground.

    For the software are you able to stream from the flash drive or do you have to load into memory then do an i/o loop?

    Thanks for sharing.

    #821
    Phil_G
    Moderator

    Hi Glyn, each sound is a com file, so the sample is in memory, it doesnt read samples from disc, its only really simple.
    The DAC circuitry is here:
    EPE April 1994

    Its connected to the 8 bits of Port A on the 8255, the ZN426E datasheet numbers the bits ‘unconventionally’ in that its bit 1 is the MSB (PortA.D7) and bit 8 is the LSB (PortA.D0). Why on earth they did this I have no idea, its weird.

    The ‘software’ isnt really (!) its from my old CP/M ‘keepsakes’, just a few bytes of Z80, hand-coded in ZSID. I just typed it in ZSM for clarity, you can see theres nothing to it! the rest of the .com file from 300h on is the sample data:

    ZSM-2.8    Source file name: PLAY                   Page No:    1
    
    0000		; Simple sample player for Z80 Playground + 8255 IO + ZN426E DAC
    0000		; Keep samples below round 50KB, Change delay to suit sample rate.
    0000		; Phil_G 1994
    0000		
    0100 =			ORG 100H
    0100		
    0100 3E80		LD A,80H
    0102 D323		OUT (23H),A	; SET 8255 TO MODE 0
    0104 210003	LOOP1:	LD HL,0300H	; POINT TO SAMPLE
    0107 CD1501	LOOP2:	CALL DELAY
    010A 7E 		LD A,(HL)
    010B 23 		INC HL
    010C D320		OUT (20H),A	; TO DAC
    010E 7C 		LD A,H		; HIGH BYTE OF SAMPLE
    010F FEA1		CP 0A1H		; REACHED END?
    0111 20F4		JR NZ, LOOP2	; WORK THRU SAMPLE
    0113 18EF		JR LOOP1	; AND REPEAT WHEN DONE
    0115		
    0115 064C	DELAY:	LD B,4CH	; CHANGE TO SUIT SAMPLE RATE
    0117 10FE	DEL1:	DJNZ DEL1
    0119 C9 		RET
    011A		
    011A =			END
    
    Errors    0
    
    #822
    Phil_G
    Moderator

    More playground antics…
    https://youtu.be/f3FLlewxSAs

    #829
    GlynD
    Participant

    Nice write-up in the EPE and thanks for the code pointer. I’m going to have to build myself one of these when I have a bit more time.

    #830
    Phil_G
    Moderator

    Hi Glyn, I had an email today from JLCPCB, my 8255 I/O boards are on the way… I ordered 10 so a few will be up for grabs, assuming they’re ok

    I’ve looked but I cannot find the ADC board I used to record these clips 40 years ago… It was just another scrap of veroboard, with I think just a ZN435. Either module plugged into the printer port of the Ferguson Bigboard, ie directly from a Z80PIO.

    I do remember spending a long time trimming the loops by changing the end address with ZSID, this was long before audio editors like Cooledit or Audacity etc. It amused me to hear them again 🙂

    Cheers
    Phil

    #1042
    GlynD
    Participant

    Hi Phil,

    Bit of an old post now I know, but came across this post in The Register headed UK’s National Museum of Computing asks tunesmiths to recreate bleeps, bloops, and parps of retro game music.

    Wondered if this is up your street?

    All the best,

    Glyn.

    #1045
    Phil_G
    Moderator

    I do a bit of guitar Glyn but I’m far from musical 🙂 I was never a game fan, I dont have the reactions! But I’m always interested in microprocessor applications, and when I needed an I/O board I did think about the AY-3-8910 as I have a couple in my stash. Three channel sound plus two 8-bit ports. This led me to a chiptunes program for the RC2014 and an idea that one day I’ll have a go!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.