Electronics > FPGA

FPGA VGA Controller for 8-bit computer

<< < (683/734) > >>

nockieboy:
On a separate tangent,  I'm working on integrating an HDL PSG and, initially at least, am looking to output audio via the TV rather than the DECA's DAC.  What do I need to do to the project to get the audio output via HDMI again? (Just after the test audio tone we worked on some time ago?)

I've uncommented the two blocks that instantiate sys_pll and AUDIO_IF, and added those files back into the project from a previous version (though maybe not the working version of those files.. :-// ).  Getting no audio at the moment.

BrianHG:
Make sure that the I2C setup for your HDMI transmitter is set to HDMI instead of DVI to get audio through the HDMI out.

Line 141 in I2C_HDMI_config.v:

--- Code: --- 25 : LUT_DATA <= 16'haf14;  //*********************************16'haf14=Select DVI mode //16'haf16=Select HDMI mode

--- End code ---


Once you get the 1kHz sine tone in the HDMI audio, you should tie the I2S audio lines of the HDMI audio to the audio DAC audio output and you should have parallel copy of the audio on the HDMI and line out jacks in parallel.  Though, check to see if the line out DAC has I2C controls of it's own, then you need to make sure it is set to the same audio bit depth and clock rate of the HDMI transmitter so both will be expecting the same data.

Worry about first getting the existing 1 khz tone generator working on both.

They worry about adapting your sound synthesizer HDL.

(Don't forget to try a new HDMI cable, or a different input on your monitor to see if that blue garbage disappears.  My old desktop garbage LG Flatron monitor is garbage with it's HDMI input and the DVI in wont even accept a HDMI encoded video signal.)

BrianHG:
Get the data sheet on the 'TLV320AIC3254'.
Check the DECA .pdf.

It uses a 1 bit data I2S while the HDMI transmitter seems to have a 4 bit one.  However, this may be due to supporting more than 2 channel audio.

Wire up an IC2 transmitter with a configuration for 16bit 48khz audio in with a quality over-sampled sound out at full volume wired to the line-out or headphone jacks according to the DECA schematic.  Also use it to pass the reset line.

Make a module which will generate your 48khz pulse from the bclk and wclk, taking in 16 bit stereo sampled on that 48khz, and sending out the serial data to the audio codec.

Go to my HDMI serialize and get the 1khz test tone generator to make the 16 bit data using the 1khz pulse.

Also remember that my 'BrianHG_GFX_PLL_i50_o297  VGA_PLL', ~line 1121 in the GPU top.sv has a 54MHz output you can use.

You probably want an MCLK of 48000 x ( 16bit L + 16bit R ) = 1536000 Hz for the BCLK
For your serializer, use 4x that clock so you may plan the clk and data bit outputs at timing edges, ie: 6.144 Mhz exactly, where the 48khz pulse is generated once every 128 clocks.

Or, just use the DECA HDMI example which runs their audio serializer exactly at 1536000Hz and use their serializer code tied to the 'TLV320AIC3254' I2S inputs noting that you only need 1 data bit.
(Note that their dumb serializer uses posedge and negedge clocks instead of a 2x/4x source clock to set the outputs, but they have the right PLL for you potentially wasting a valuable clock which may be needed for the FM synthesizer, or you may generate your own compatible PLL if needed...)

nockieboy:
Yes, that was it - had to update line 141 in I2C_HDMI_config.v.   I have tone.  8)



Good suggestion re: getting audio out to the DAC before worrying about the PSG.

I'll hopefully have time tomorrow to hit the datasheets, manuals and guides but, in the meantime, do any of these outputs from the sound generator HDL appear to be usable?

* unsigned 12-bit output x 3 channels
* unsigned 14-bit summation of the channels
* signed 14-bit PCM summation of the channels, with each channel converted to -/+ zero-centred level or -/+ full-range level

Which will be best to use, bearing in mind I'll need to take a look at how to convert it to I2S (won't look at conversion right now, want to get some sleep and not have my brain working all night!)

Ah, you beat me to it whilst I was writing the above reply! ;)


--- Quote from: BrianHG on July 05, 2022, 09:25:26 pm ---Get the data sheet on the 'TLV320AIC3254'.
Check the DECA .pdf.

It uses a 1 bit data I2S while the HDMI transmitter seems to have a 4 bit one.  However, this may be due to supporting more than 2 channel audio.

Wire up an IC2 transmitter with a configuration for 16bit 48khz audio in with a quality over-sampled sound out at full volume wired to the line-out or headphone jacks according to the DECA schematic.  Also use it to pass the reset line.

Make a module which will generate your 48khz pulse from the bclk and wclk, taking in 16 bit stereo sampled on that 48khz, and sending out the serial data to the audio codec.

Go to my HDMI serialize and get the 1khz test tone generator to make the 16 bit data using the 1khz pulse.

Also remember that my 'BrianHG_GFX_PLL_i50_o297  VGA_PLL', ~line 1121 in the GPU top.sv has a 54MHz output you can use.

You probably want an MCLK of 48000 x ( 16bit L + 16bit R ) = 1536000 Hz for the BCLK
For your serializer, use 4x that clock so you may plan the clk and data bit outputs at timing edges, ie: 6.144 Mhz exactly, where the 48khz pulse is generated once every 128 clocks.

Or, just use the DECA HDMI example which runs their audio serializer exactly at 1536000Hz and use their serializer code tied to the 'TLV320AIC3254' I2S inputs noting that you only need 1 data bit.
--- End quote ---

I'll make a start on all this tomorrow, hopefully, if work allows.

At the moment, I've only got two questions - the first is the one asked above - which is the best output from the synthesizer to use, and the second is easier perhaps - I need a 1.789MHz clock, or as close as possible to it for accuracy of tone, for the sound generator module.  I know there's the 1.536MHz signal from the HDMI's audio PLL, but just wondered as you'd mentioned a 54MHz clock I'd not known about, if there were any other clocks in the project I could use/divide down?  That 54MHz clock will divide down to 1.6875MHz, which is even closer than the HDMI audio PLL I was intending to use, but is there anything I could use that would get me closer to 1.789MHz?

nockieboy:
Oh, one last thing - putting the output into HDMI mode seems to cause the layering to fail.  In DVI mode, the display is 720x480, but with a layer 40 pixels thinner and shorter than the display resolution, centred on the screen to show a 20-pixel wide border around the edge.  When I switch to HDMI mode, it's as if the layer becomes 720 pixels wide and the border disappears except for a thin strip and the top and bottom.

Any ideas?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod