Jump to content
IGNORED

Pokeymax v2


foft

Recommended Posts

Wow, I just saw Phaeron post the spectogram view in audacity. I didn't know about this!

 

Very interesting to look at these with it... Can visually see the whirring sounds from the original pokey.

 

edit: vhs vs dvd ;)

 

image.thumb.png.56f2fdf76523cbf6965b699535401bfe.png

Edited by foft
  • Like 5
Link to comment
Share on other sites

Hi everyone,

 

andymanone was so kind to get me a PokeyMax Quad + SID so I can add support to MidiJoy.

I am encountering a strange problem that I managed to narrow down to PokeyMax:

 

First of all, everything works fine upon starting the Atari. Booting Yoomp works as does the stereo detection. Great :)!

But then after a while the keyboard stops responding. It takes around five minutes or so. At first, I was thinking that I didn't connect the keyboard cable correctly (triple checked by now) or that the PokeyMax was not completely sitting in the socket (also triple checked, and since I had a socketed POKEY on my 800 XL, there can't be any issues with soldering in the socket etc.).

Upon reassembling the computer, everything worked again - until it didn't.

So I made a test with MidiJoy: It works, and the program itself even runs after the PokeyMax seems to have crashed because I can still see the MIDI data coming in over the joystick port, but no sound is playing any more. Once I press a key then, the system hangs. I can still enter the Freezer, but since I cannot press any keys, that is no help.

 

Resetting the machine (still powered on) brings the blue screen with the white cursor in the corner, but no buzz or SIO sounds. The system just hangs there (again, Freezer works, but no key presses accepted). Even shortly (3-5 seconds) turning off the Atari does not help, still no booting (which normally is a perfectly fine duration for getting a hung machine working again). I have to turn off the Atari and wait a minute or longer until the system boots up normally again. That duration was apparently the cause why things worked after reassembling the Atari after the first failures.

 

Finally, I put in my original POKEY and things work as expected. No issues with running software, such as MidiJoy, for half an hour.

 

The question is whether I / andymanone got a faulty device or whether this is some kind of weird bug that you can fix remotely through a firmware update (I have a JTAG programmer for Arduinos laying around here). What do you suggest?

Edited by freetz
Clarified that even turning off the Atari for 3-5 seconds does not fix the problem.
Link to comment
Share on other sites

Yes I guess on pokeymax.

 

I'm wondering, did you connect the extra address lines or are you running it in mono mode?

 

Could you check please -> is pokeymax still scanning the keyboard lines?

Edited by foft
Link to comment
Share on other sites

Sorry, I don't (at least not in the place where the Atari is)...

But as I said above: When running MidiJoy, first the sound is getting away and when I then press a key, the system hangs. So there seems to be some kind of keyboard reading and (faulty) reaction taking place...

Edited by freetz
Link to comment
Share on other sites

Freetz, my experience (gained when supporting other users) says that pokey socket may be bad, or soldering to PCB may be unstable. None of PokeyMAX chips were faulty so far, all problems were coming from other hardware or software issues. Very frequent mistake is that users connect wires wrong. Firmware update will not help in your case. 

Of course I cannot exclude that device can be faulty, and if you like, I can check and replace it.

Link to comment
Share on other sites

@foft: Can do, do you have a listing in mind that I should run?

@Duddie: If the socket was bad, it should produce the same problems when running with the original POKEY, shouldn't it? And what kind of wrong wiring could cause anything remotely as severe what I have observed? The wires are only necessary for addressing more than one POKEY plus the audio output. But if you really think that this could possibly be a reason, I can insert the PokeyMax without any cables attached (I can unplug them from the pin header) and confirm if the result is the same.

Link to comment
Share on other sites

@freetz, please notice the difference in pin thickness. I said only what was diagnosed at the end in some cases, it is only a suggestion for you and the others. If you think that chip is bad, please send it back to me, I will replace it (or check).

Link to comment
Share on other sites

@Duddie: I'm aware of the difference between standard and precision pin headers, that's why I double (or in fact triple) checked. The pins are all the way up to the plastic row inserted into the socket.

I can send you the chip of course, could you PM me the address where you'd like it to be posted to?

Link to comment
Share on other sites

I have now been running PokeyMax in my Atari without any cables attached for about one hour without a crash, will test more to see if that was just a lucky coincindence or not, but having it running in mono-POKEY-mode, I had to attach the audio cable from the monitor to my soundsystem (which I haven't done before after installing PokeyMax) and made this strange discovery:

Each of the four channels plays a note perfectly fine when no other note is being played on any other channel (like in the audio self test). But once two, three or four channels are being played at the same time, all there is to hear is a low frequency static noise (like in some games where a rocket starts its engines for example). Also, the first, single note on any channel is no longer heard, it's just this static noise.

I then reconnected the audio speaker wires to the PokeyMax, and there all four notes can be heard perfectly fine! So when connecting both the monitor audio output to one speaker and the stereo output to another, I hear the same note when just one channel is used, but static noise on one speaker (from monitor output) and correct notes (from stereo output) on the other.

 

Would anyone of you know how this comes about or what to do to get correct sound via the standard monitor audio output?

 

EDIT: When setting each channel with a different note and subsequently setting three of the four channels to zero (SOUND X,0,0,0), the last remaining note is being heard correctly again.

Edited by freetz
Link to comment
Share on other sites

1 minute ago, freetz said:

I have now been running PokeyMax in my Atari without any cables attached for about one hour without a crash, will test more to see if that was just a lucky coincindence or not, but having it running in mono-POKEY-mode, I had to attach the audio cable from the monitor to my soundsystem (which I haven't done before after installing PokeyMax) and made this strange discovery:

Each of the four channels plays a note perfectly fine when no other note is being played on any other channel (like in the audio self test). But once two, three or four channels are being played at the same time, all there is to hear is a low frequency static noise (like in some games where a rocket starts its engines for example). Also, the first, single note on any channel is no longer heard, it's just this static noise.

I then reconnected the audio speaker wires to the PokeyMax, and there all four notes can be heard perfectly fine! So when connecting both the monitor audio output to one speaker and the stereo output to another, I hear the same note when just one channel is used, but static noise on one speaker (from monitor output) and correct notes (from stereo output) on the other.

 

Would anyone of you know how this comes about or what to do to get correct sound via the standard monitor audio output?

This is a 'feature' of the current SID version only, which is kind of an early preview release.

Each device has a range of 0-1. These are added up to get an output level.

SID defaults to 0.5 when quiet.

So we end up with a range 0.5 to 1.5 when pokey is playing. Or 0.5 to 2.5 when both pokeys are playing.

 

Translating this into voltage on audio output: We try to output 2.5v to 7.5v on the AUD pin, which clips at 5v. Hence the noise.

 

The left/right outputs are fine since they have post-divide set to 4 by default, so they output from 0.625v to 1.875v with a single pokey playing. With both pokeys playing they output from 0.625v to 3.125v.

 

Its possible to set the post divide on the internal output to something other than 1, see the developers guide pdf for details.

Link to comment
Share on other sites

@Duddie and @foft: I stand corrected, after removing all cables, it turned out to be the connection to A4 that made the Atari hang after a while. I can't understand why this didn't happen instantly but only after a while, plus the connection measured 0 Ohms, so should have been okay, but after desoldering all cables from the CPU, resoldering them and replugging the POKEYmax one more time, things are working stable now - sorry for the confusion!

 

Now I have another problem to solve which is not POKEYmax related; the Teensy 2.0 (which I use in MidiJoy) or the respective USB-Midi library are only capable of receiving six notes at the same time. So while it already sounds much better having six instead of four voices, it would be quite a pity to waste two to ten voices. The loss would be less noticeable when you use 16-Bit resolution on all channels so that you have eight voices on a Quad Pokey of which six could be used, but still...

  • Like 1
Link to comment
Share on other sites

@foft: Apparently, the issues with the distorted sound also appear on the external audio outputs: Depending on the volume used for the POKEYs, the distortion kicks in here as well. In this example:

			AUDF1 = $d200
			AUDC1 = $d201

			AUDCTL = $d208
			SKCTL = $d20f

			org $3c00

			lda #0
			sta AUDCTL
			sta AUDCTL+$10
			sta AUDCTL+$20
			sta AUDCTL+$30

			lda #3
			sta SKCTL
			sta SKCTL+$10
			sta SKCTL+$20
			sta SKCTL+$30
			
			lda #164
			sta AUDC1
			sta AUDC1+2
			sta AUDC1+4
			sta AUDC1+6
			lda #168
			sta AUDC1+32

			lda #240
			sta AUDF1
			lda #220
			sta AUDF1+2
			lda #200
			sta AUDF1+4
			lda #180
			sta AUDF1+6

			lda #80
			sta AUDF1+32

testloop 	jmp testloop

...the sound gets distorted once I increase the sound for AUDC1+x from 164 to 165. The lesser notes I play, the higher I can go with the volume, that's why I assume it's the same issue as the one I mentioned before on the monitor connector's sound output.

 

You mentioned that the internal configuration could fix that, and thanks again for the developer guide, but I couldn't figure out how to set the settings so that this issue does not arise anymore at least on the external audio output.

 

Also one more question: Does this mean that it's not possible (or feasible) to use several POKEYs and one or two SIDs together? That was one idea I had about implementing in MidiJoy...

Edited by freetz
Link to comment
Share on other sites

For the external outputs it’s set to use a divider of 4 by default. So up to 4 devices with all channels at max volume can play at once. For each of left/right. There is an option to set this divider to 8.

 

So with 2 pokeys at max volume (and half a Sid) it should not distort. Let me run your code this evening and check what is happening. 

Edited by foft
Link to comment
Share on other sites

I just tried to read $D2F1 and $D2F2, and when reading it from an assembler program and outputting the value to a screen location, I get 0 for both registers. When I enter the Freezer, I get A8 and DC respectively. Both does not make sense to me. Do I have to activate something to read these registers to figure out what kind of configuration and divider setting is applied?

 

EDIT: When setting D2F2 to 255 (which should set all channels to divider 8), this does neither get rid of the noise, nor is it possible to immediately afterwards read the value that has just been set (again returns 0 instead of 255).

Edited by freetz
Link to comment
Share on other sites

2 hours ago, freetz said:

Thanks, just one more observation: As I said, with 164 for POKEY 1, it still works fine, with 165 noticeable distortion sets in and with 169 no other note can be heard in the noise.

So for four POKEYs and two SIDs the divider should be set to 8 then?

No, 4. Since they are on different channels.

L:pokey1,pokey3,sid1

R:pokey2,pokey4,sid2

Link to comment
Share on other sites

2 hours ago, freetz said:

I just tried to read $D2F1 and $D2F2, and when reading it from an assembler program and outputting the value to a screen location, I get 0 for both registers. When I enter the Freezer, I get A8 and DC respectively. Both does not make sense to me. Do I have to activate something to read these registers to figure out what kind of configuration and divider setting is applied?

 

EDIT: When setting D2F2 to 255 (which should set all channels to divider 8), this does neither get rid of the noise, nor is it possible to immediately afterwards read the value that has just been set (again returns 0 instead of 255).

Ah sorry use the other d210 access method.

 

d2fx was planned but is not accessible until we have A4,A5,A6 and A7 connected. We don’t have these on  any devices yet. Anyway I think I will remove it since I don’t want the os to reconfigure it on boot!

 

So to access pokeymax config:

read d20c. If 1 we have pokeymax.

write 3f to d20c to activate config in d21x region

read and write in the d21x region

when done, write 0 to d20c to reactivate normal d21x range

 

Edited by foft
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...