Jump to content
Jagware
LinkoVitch

Interupt timing with the PIT (68k)

Recommended Posts

LinkoVitch    0

I am experimenting with some sound stuff, and to help with my sanity I am prototyping it on the 68K first.

 

First off I have sample playback working fine, noises come out and all sounds as it should...

 

Now, I need to have my 68K routine in these experiments fire off at my desired sample rate. I can achieve 8kHz no probs, I can it seems attain 11-12kHz no probs, but that seems to be the limit!

 

Regardless how I set PIT0 and PIT1, I cannot seem to get it beyond around 12kHz tops!

 

The way I am calculating the frequency is my PIT interrupt simply adds 1 to a variable, then every VBI the buffer is echo'd to the console and cleared. So I have a 60Hz sample of the count, get the count, multiply by 60 and bingo, interrupt frequency.

 

Can someone tell me what I am doing wrong?

 

I am computing PIT0 and PIT1 by diving 25,000,000 by say 100 to give 250,000Hz, then setting PIT1 to something like 11 which should result in an interupt of around 22kHz (I know PIT is n+1, and the clock isn't 25,000,000 but these are just rough figures :) )

 

Hope someone out there can help me with this.

 

Cheers

Share this post


Link to post
Share on other sites
LinkoVitch    0

I have just added a similar routine (counter wise) within the DSP and using the JPIT timers, it gets exactly the figures I am expecting. Am I just trying to interrupt the 68K too much? It feels wrong that this should be the case given there were a variety of sample playback routines on the ST which could manage more than 20kHz playback (I think 32kHz was the top I saw) and that was a ~9MHz 68K

Share this post


Link to post
Share on other sites
ggn    1
I have just added a similar routine (counter wise) within the DSP and using the JPIT timers, it gets exactly the figures I am expecting. Am I just trying to interrupt the 68K too much? It feels wrong that this should be the case given there were a variety of sample playback routines on the ST which could manage more than 20kHz playback (I think 32kHz was the top I saw) and that was a ~9MHz 68K

 

Just to make it worse, recently there has been released a 50khz soundtracker for a plain 8mhz st :)

 

Anyway, maybe a method of checking would be to output the value to BG and see the color changes?

Share this post


Link to post
Share on other sites
Tursi    0

Are you sure you aren't just running into trouble with the speed of printing?

 

I would first try measuring for a full second before output (or even just half a second), and see whether that makes any difference.

Share this post


Link to post
Share on other sites
LinkoVitch    0
Are you sure you aren't just running into trouble with the speed of printing?

 

I would first try measuring for a full second before output (or even just half a second), and see whether that makes any difference.

 

Don't think that is the issue, I only started doing that once I noticed the sample playback rate wasn't changing how it should, I then started counting and found out why it never sounded like 16kHz or higher.

 

(this is all prototype code so I am not too fussed about my sample routine being on the 68K right now :D )

 

 

Share this post


Link to post
Share on other sites
LinkoVitch    0

Actually, I take that back, Tursi, you may be onto something.. I'll test once I have completed my current round of fiddling :)

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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.


×