Sound Processor AY-3-8910, clock rate is different to CPU clock rate

Discussion about other targets
Post Reply
RVF400
New member
Posts: 6
Joined: Thu Feb 19, 2009 11:03 am

Sound Processor AY-3-8910, clock rate is different to CPU clock rate

Post by RVF400 »

Hello, in my new target myrdk I have a Sound Processor AY-3-8910. This is operated with its own clock of 2 Mhz at pin 22. The file psgtest.c is now running on my system.
The entire system with the Z80 CPU runs at a clock rate of 4 Mhz.
Question: in which file do I set the clock rate for the sound processor?
Is it the file psg.h with the lines
#ifdef __MYRDK__
#define psgT(hz) ((int)(2000000 / (hz)))
#endif
Answers are welcome :)
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: Sound Processor AY-3-8910, clock rate is different to CPU clock rate

Post by stefano »

You're right.

https://github.com/z88dk/z88dk/blob/mas ... lude/psg.h


The main CPU clock, for bit-banging code, in turn, would go here:

https://github.com/z88dk/z88dk/blob/mas ... de/sound.h
Post Reply