A full-blown newb on the way to a POKEY synth

As some of you might have read in the chat or across the forum, I started working on a POKEY synth. My plan is to start with a board designed by Mike Hill way back in time that hooks up to the LPT Port of a computer to test the POKEY and fiddle around with it a bit and hopefully finally come up with an mbPokey board and the MIOS app to go with it.

I’ll try to use this thread as a blog, mainly to keep me from quitting the project when that damn little chip does what it wants rather than what I want it to =)

First up, a few links (most of them have been posted around here somewhere before):

http://en.wikipedia.org/wiki/Atari_POKEY - Wikipedia entry for the POKEY chip (polish version is much more in-depth, but my polish isn’t really all that good)

http://krap.pl/mirrorz/atari/homepage.ntlworld.com/kryten_droid/Atari/800XL/atari_hw/pokey.htm - HTML version of the datasheet of the Pokey. The original datasheet can be found on the web as well - only god and smashTV now where they got it =)

http://www.hillsoftware.com/atari/index.html . Mike Hill’s website. He’s the guy who created the LPT-Pokey schem and wrote a DOS app for it (won’t work on Windows obviously)

http://www.pokey.nl/xoops/modules/books/index.php?op=viewarticle&artid=10 - Some information on what to do with the POKEY

So far, I built the LPT interface on a piece of perfboard and ported Mike’s application to Windows and added a complete (well sorta) CS to it, so that I can access all registers. I have a small and rather random sound test right here.

I really want to thank SmashTV, Mike Hill, stryd_one and jimp at this point - without those guys I wouldn’t even have gotten this far :smiley:

I’ll post some pictures later on today =)

Cheerio,

nILS

Hi!

Where do you source this chips?

Are they as hyped as SIDs are?

Kind regards

Michael

Normally you have to have some documentation in the wiki for a post in this forum, but I think that given you have a semi-working PCB we can overlook that :wink: But please share it soon!

s1: Yeah, I did read the “read before you post”-thread =) It’s just not anything *new* worth documenting here yet. I will put it all down in the wiki when I get a bit further.

Wild_Weasel: I bought a “Ballblazer” cartridge for the ATARI 7800 on eBay for ~$5. The commando “Commando” cartridge has a Pokey chip inside as well. Most of the 8bit ATARI computers have one inside, they’re a lot more expansive though. You can buy the chips at a lot of outlet type stores (www.batescomponents.comwww.loadparts.com, …) for about $5-7 a chip. Problem with that is, you have to order >100 chips.

Problem with that is, you have to order >100 chips.

If the POKEY will get as famous as the SID, that won’t be a problem

I think you can rest assured that’s not likely to happen anytime soon! The Pokey is a very limited chip for musical applications. Doesn’t it have problems in terms of pitch? Personally, I think it has some limited application for bass sounds and chiptune leads, but not much else. Still, if it was simple enough to build I think it would be a neat toy.

SLP: I seriously doubt that the pokey will become anything as hyped as the SID is =) It *is* a pretty simple chip. Yet I find it to create some nice sounds if handled right. Since availability of the pokey is great due to ATARI’s overproduction right before the crash, not being able to order bulks isn’t that big a problem.

jaicen: That is very true =) Especially the NTSC version clocked at ~1.79MHz has serious problems with the pitch. I did some calculations today (thanks stryd  ;)) and found the PAL version at ~1.77MHz to be way more accurate. At the moment I’m running the pokey on 1.8432 since it was the closest crystal available w/o any frequency dividers - the pitch difference is noticeable =)

About the “simple to build” part: Well, the core module is obviously the same and the pokey module is extremely close to the SID board. What would/will keep this simple is the fact that the CS (which is really the only “hard to build” thing) will be a lot smaller and simpler than for the SID. Basically, all you would need is 5x8 buttons to control the 5 relevant registers - that’s it =) This is obviously not the most usable version, but it gives you an idea of the dimension we’re talking about.

Some minor updates:

  • Since the PAL version isn’t that much better when it comes to the pitch and due to the fact that it is virtually impossible to get a hand on a matching crystal, I’m going with the NTSC version. (Thx to SmashTV, stryd_one, jimp and DrBunsen for looking for alternative solutions)
  • Port of my test application (screenshot below) has been ported to C for easier translation to the PIC.
  • Since there’s got to be a stereo version I’m looking into ways to drive (at least) 2 pokeys from a core atm.

EDIT: I attached the pokey test app so you guys can fiddle around with it, too. Apparently I’m not the only one: sd2000/sparx has a Pokey board as well :wink:

Cheerio,

nILS

[pokey_test_app.zip](< base_url >/applications/core/interface/file/attachment.php?id=439)

[pokey_test_app.zip](< base_url >/applications/core/interface/file/attachment.php?id=3581)

You can buy the chips at a lot of outlet type stores (www.batescomponents.comwww.loadparts.com, …) for about $5-7 a chip. Problem with that is, you have to order >100 chips.

Not here:

http://www.mikesarcade.com/cgi-bin/store.pl?sku=CO12294

Thanks tilted. I must have come across that page earlier, cause when I got there it had 3 pokeys in the shopping basket =)

I don’t think it actually matters wether you use NSTC or PAL, if you’re not going to be clocking it to a display. As long as you can get the timing fixed, you should be able to get it in tune more or less.

jaicen: “More or less” is exactly the problem. I really wanted to go for “more” rather than “less” The pokey uses a divide-by-n counter to generate the output frequency from the oscillator it’s clocked with. Therefore, there’s a direct correllation between Fosc and Fout.

In “default mode” the clock frequency gets internally divided by 28 leaving you with ~64kHz as Finternal. The formula for the output frequency in that case is rather simple:

Fout =  Finternal / (AUDF+1) * 2

AUDF being a register holding a byte determining the frequency. Even though the difference in the Finternal is rather small between NTSC and PAL (633337.39Hz for PAL, 63920.45Hz for NTSC), NTSC tends to be a little bit more off. Not enough to justify going through custom-crystal-shaving or anything like that though.

I finally put sth. in the wiki (http://www.midibox.org/dokuwiki/midibox_pokey). It needs to and will be extended :slight_smile:

For everyone interested, the first of the pictures below shows what the preliminary version of the mbPokey board looks like. A later version will probably sport a serial out to allow for multiple pokeys.

The second one is a picture of the schematic that shows how to hook up a pokey to a printer port on a PC (this is the schematic assuming a 1.77Mhz or 1.79Mhz crystal. It works “kinda” well with a 1.8432Mhz crystal, which is widely available).

EDIT: Some feedback on the first schematic would be greatly appreciated.

The second one is a picture of the schematic that shows how to hook up a pokey to a printer port on a PC (this is the schematic assuming a 1.77Mhz or 1.79Mhz crystal. It works “kinda” well with a 1.8432Mhz crystal, which is widely available).

Have you tried diving an OPL3 crystal?

The OPL3 board uses a 14.318 MHz crystal.

14.318 / 8 = 1.78975…

also, I hope later today to upload a crystal to oscillator schem onthe wiki. stand by.

Have you tried diving an OPL3 crystal?

The OPL3 board uses a 14.318 MHz crystal.

Yes, we’ve discussed that in the chat. There’s no need to use a 14.318Mhz crystal and divide it by 8 (for instance by using 3 flip flops), since 3.579545Mhz oscillators are widely available and only need to be divided by two (one flip flop) as seen in the first schematic.

Using a crystal and building an oscillator circuit has been discussed as well, but it doesn’t really lead to any better results as basically all crystal “speeds” come as oscillators, as well.

So, the bottom line is that I think adding a single IC (a dual D-Flip-Flop (i.e. 74HC74)) to the circuit is the best and easiest solution.

Yes, we’ve discussed that in the chat.

Did we ever! LOL ;D

Did we ever! LOL ;D

I should have put “extensively” or something similar in that sentence :smiley:

LOL

The attachment is an excel table that calculates the output frequency depending on the crystal. Possible values for columns A and E are B2 / 28, B2 / 114 and B2 (for the left side, atm being PAL) B2 is the clock frequency.

Happy fiddling tilted =)

[Pokey_Note_Table.zip](< base_url >/applications/core/interface/file/attachment.php?id=433)

[Pokey_Note_Table.zip](< base_url >/applications/core/interface/file/attachment.php?id=3575)

At the moment I’m trying to set up the Core -> Pokey module data transfer. I figure it’s going to be similar to what TK did in the SID app.

Buuuut, I’m kinda stuck. So here’s for all code gurus:

The parallel output source:

#define ACTIVE 0
#define INACTIVE 1
#define STROBE 2

#define PORT 0x378
#define PORTCONTROL PORT
#define PORTDATA PORT + 1

void WritePokey(unsigned char addr, unsigned char byte)
{
    PLatchAddress(addr);
    PLatchData(byte);
    PChipSelect(STROBE);
}

void PLatchData(unsigned char val)
{
    Pokey_Out(PORTCONTROL, 0);
    Pokey_Out(PORTDATA, val);
    Pokey_Out(PORTCONTROL, 2);
    Pokey_Out(PORTCONTROL, 0);
} // PLatchData

void PLatchAddress(int add)
{
    Pokey_Out(PORTCONTROL, 0);
    Pokey_Out(PORTDATA, add);
    Pokey_Out(PORTCONTROL, 8);
    Pokey_Out(PORTCONTROL, 0);
} // PLatchAddress

void PChipSelect(int mode)
{
    if (mode == INACTIVE) Pokey_Out(PORTCONTROL,0);
    if (mode == ACTIVE)   Pokey_Out(PORTCONTROL,1);
    if (mode == STROBE) 
    {
        Pokey_Out(PORTCONTROL,1);
        Pokey_Out(PORTCONTROL,0);
    }
} // PChipSelect[/code]









This is basically what I need to port to serial output for the Core.







Any pointers would be greatly appreciated =)