Jump to content
IGNORED

Questions about DACs


42bs

Recommended Posts

I am struggling with the DACs or better the description of them.

I understand, each DAC has a range from -$800x to $7ffx, right?

So writing "toggling" the DAC with 4kHz from $8000 to $7fff should give a tone?

Or do I also have to setup JIT1?

 

Link to comment
Share on other sites

The PWM DACs (DAC1, DAC2) don't work correctly, and they're not even connected to anything in the Jaguar. Forget about them.

 

If you want to use sound, you need to use the synchronous serial interface (I²S):

- Set SMODE to $0000000D

- Set SCLK according to the sample rate you want: SCLK = (system_clock / (64 * sample_rate)) - 1 (system_clock = 26593900 Hz for PAL, and 26590906 Hz for NTSC)

- Set IMASK and D_I2SENA in D_FLAGS

- Set bit 8 in JOYSTICK (to disable the audio mute)

 

You'll get a DSP interrupt at the sample rate frequency. Write the output values to L_I2S and R_I2S, and clear the interrupt flags as usual.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Zerosquare said:

The PWM DACs (DAC1, DAC2) don't work correctly, and they're not even connected to anything in the Jaguar. Forget about them.

 

If you want to use sound, you need to use the synchronous serial interface (I²S):

- Set SMODE to $0000000D

- Set SCLK according to the sample rate you want: SCLK = (system_clock / (64 * sample_rate)) - 1 (system_clock = 26593900 Hz for PAL, and 26590906 Hz for NTSC)

- Set IMASK and D_I2SENA in D_FLAGS

- Set bit 8 in JOYSTICK (to disable the audio mute)

 

You'll get a DSP interrupt at the sample rate frequency. Write the output values to L_I2S and R_I2S, and clear the interrupt flags as usual.

and what about a 'bitnes'? are those DAC's 16bit or 14 bit?

Link to comment
Share on other sites

42 minutes ago, 42bs said:

As I understand I2C is 16bit signed.

Yes.

 

42 minutes ago, 42bs said:

But it really is a pity one has to setup DSP code to handle sound. My goal was to have a bytebeat intro 256 bytes ... well, let's see.

You can "cheat" by not enabling the DSP interrupt, and writing to the L_I2S/R_I2S when you want (you still need to configure SCLK, SMODE and JOYSTICK).  That's not recommended because it can introduce audio artifacts, but this is a 256-byte intro, so...

 

I don't know if doing everything with the 68k will work, but it's worth a try. I guess you could use a timer, or maybe even sync with the I²S stream by reading and clearing the I²S interrupt flag with the 68k.

 

Good luck :)

Edited by Zerosquare
  • Thanks 1
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...