Simple FIFO to I2S CPLD, for MCU players / reclocking - Page 2 - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 13th November 2007, 04:31 AM   #11
diyAudio Member
 
Join Date: Nov 2006
this simple CPLD (FIFOtoI2S) works fine.
SN74ACT7808 or other generic FIFO can be used with this CPLD.

but...
It looks like I can not provide continuous data stream by FT245R and D2XX driver
D2XX driver does not eat data block > 128kbytes.

FYI:
Attached is current VHDL/ucf/fitting report/sample source code.
This code dumps PCM information,
read all PCM data into Memory,
then put 61440bytes data block to FTDI. (and I can hear 61440bytes/176400bytes cycle underrun noise, by SD goes to 0x0000 ...OMG. I need true FIFO between FT245R and CPLD)

finename = '01_Bach_147a.wav'
[RIFF] (36848820 bytes)
[WAVEfmt ] (16 bytes)
Data type = 1 (1 = PCM)
Number of channels = 2 (1 = mono, 2 = stereo)
Sampling rate = 44100Hz
Bytes per second = 176400
Bytes per sample = 4
Bits per sample = 16
[data] (36848784 bytes)
Attached Files
File Type: zip smplfifoplay01.zip (9.9 KB, 189 views)
  Reply With Quote
Old 13th November 2007, 11:12 AM   #12
diyAudio Member
 
blu_line's Avatar
 
Join Date: Jan 2002
Location: The Netherlands
Quote:
I need true FIFO between FT245R and CPLD)
Use a bigger CPLD/FPGA like an Altera MAX device or similar.

I have learned to choose a bigger FPGA device at start and scale down later.
Possibly you could have found this by running more simulations.

What you could do is to add more fifo's and add control to you cpld.

Can you PM me with you mail address so i can send the TB to you !


grtz

ST
  Reply With Quote
Old 13th November 2007, 11:20 AM   #13
matejS is offline matejS  Slovenia
diyAudio Member
 
Join Date: May 2007
Quote:
I wrote simple sample source (read wav / send blocks to FIFO) and there are still noize, by FIFO underrun. I will think later.
Are in and out clocks the same? If they aren't you should use PLL to sync them.
If clocks are not the same then size of FIFO should be "infinite" to handle clock difference.
You also have to wait until FIFO is, let say, more than full (or 75%).

Maybe all this is already taken care of - I did not have any time to look at VHDL.
Very nice and interesting project, though.

Matej
  Reply With Quote
Old 13th November 2007, 03:56 PM   #14
diyAudio Member
 
Join Date: Nov 2006
hi, thanks for response
>blu_line
I'm thinking to add Cypress small PLCC32 2KB FIFO, to keep VHDL simple and vendor independent, and for generic application.
or do you have idea for adequate device?
>matejS
There are no clock at FT245R side, or software. it just fill FIFO / wait for room available / then fill again. underrun caused by D2XX driver's time management.

The actual application I'm thinking is...

(a)MCU + SD/MMC, CF, IDE player.
MCU read 512bytes block, send to FIFO, repeat.
1024bytes or more FIFO can generate gapless I2S playback.
(b)Ethernet + MCU, passive device like Apple AirPort
When FIFO has room, PC can send 1024bytes UDP/IP packet.
MCU receive and send to FIFO, answer FIFO status. repeat.

In both case, maybe larger FIFO is better, and no "clock" at MCU side. MCU just watch FIFO status.
  Reply With Quote
Old 19th November 2007, 01:59 AM   #15
diyAudio Member
 
Join Date: Nov 2006
I wrote ver0.2 (with Cypress FIFO).
welcome for comments...

http://koonlab.com/FIFO_I2S.html
  Reply With Quote
Old 13th December 2007, 05:05 AM   #16
diyAudio Member
 
Join Date: Nov 2006
Ver.02 (with FIFO) is running. sounds great.
attached is schematic, and VHDL.
(I remember some howto write VHDL.. little bit organized)

maybe most interesting point is below.
This loop just repeats writing wave data to FIFO from memory.
There are no confusing sound API, handling driver, etc.

//Copy File to Memory
fread(p, len, 1,f);

dwToWrite = 61440;
unsigned long pCounter = 0;

for (count = 0; count < 0xFFFFFFFF; count++)
{
if (pCounter > len) goto loopend;

//Write to FTDI, from Memory.
if (FT_Write(ftHandle, (p+pCounter), dwToWrite, &dwWritten) == FT_OK)
{
if ( dwToWrite == dwWritten)
{//FT_W32_WriteFile OK}
else
{printf("FT_W32_WriteFile TimeOut\n");}
}
else
{
printf("FT_W32_WriteFile Failed\n");
goto loopend;
}
pCounter += dwToWrite;
}
Attached Files
File Type: zip fifo_i2s_v2_sch.zip (48.2 KB, 178 views)
  Reply With Quote
Old 10th January 2008, 06:34 AM   #17
diyAudio Member
 
Join Date: Dec 2006
Hello there,

I have been reading your Koonlab website projects for quiet some time now. I am a newbie to DIYAudio and Pro audio parse.I am starting to design my Audio DAC that would have a SPDI/F input that would enable me to connect my Desktop PC to a stereo amp. I am very interested in your FIFO 2 I2S implementation. I think it is a very smart way of generating I2S format audio that could be fed to my DAC apart from the direct SPDI/F input. I do have a couple of questions that are hindering my progress. I would sincerely appreciate it if you could take some time to answer those.

(1) I do not understand from your photographs and schematic as to what your transport is?? Are you connecting your Desktop PC to the Asynchronous FIFO??

(2) What is the role of the FT245R?? Is this used to get the CD audio stream through the USB to the FIFO??

(3) What do you use the simplfifoplay01.cpp for?? Is this the driver for the FT245R??

If you could just provide an overview of your setup that would be great. Your other works are equally inspiring. I guess I need to start somewhere.

I do appreciate your help.
Thanks,
DF
  Reply With Quote
Old 11th January 2008, 04:09 AM   #18
diyAudio Member
 
Join Date: Nov 2006
Quote:
Originally posted by duddface
(1) I do not understand from your photographs and schematic as to what your transport is?? Are you connecting your Desktop PC to the Asynchronous FIFO??
(2) What is the role of the FT245R?? Is this used to get the CD audio stream through the USB to the FIFO??
(3) What do you use the simplfifoplay01.cpp for?? Is this the driver for the FT245R??
DF
Hi,
(1) Transport is IBM ThinkPad note PC.
(2) FT245R provides "simple 8 bit parallel, streaming(not perfect continuous)" data output interface for PC.
(3) This source code is WAV file player on PC. It reads WAV file provided as argument, and open FT245R, read WAV PCM data into memory, then writes data stream to FT245R.

Do it step by step.. this project requires knowledges about,
How to handle I2S signal, WAV file format, C language, FT245R handling, VHDL, schematic and board design, debug, etc etc.
And only you can get is "I'm handling I2S direct, not through SPDIF!" DIY satisfaction only
  Reply With Quote
Old 18th September 2008, 01:30 PM   #19
elnec is offline elnec  India
diyAudio Member
 
Join Date: Mar 2006
Hi Koon,

is it possible to use MCU instead of pc for data input?
if yes, then tell me how it can be done?
  Reply With Quote
Old 18th September 2008, 03:00 PM   #20
diyAudio Member
 
Join Date: Nov 2006
Hi, Yes it will be possible.
MCU interface is 8 bit data + FIFO signal.
Please see Cypress FIFO datasheet to write FIFO from MCU.

Data rate is 176.4KB/sec, or 5.7usec per byte.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decoder output: how jittery, worth reclocking? And "double" reclocking hollowman Digital Source 0 17th July 2009 02:39 PM
cdm12 fifo digital out purer Digital Source 1 31st March 2007 08:18 PM
Using large buffer FIFO on SPDIF fed DAC wa2ise Digital Source 8 2nd February 2006 04:43 PM
CPLD based DIY Pre-Amp and display Kit (PGA2310) solomon2773 Swap Meet 0 3rd June 2005 06:12 AM
CPLD vs. uC for PGA2310 ajm8372 Solid State 6 20th January 2004 11:40 PM


New To Site? Need Help?

All times are GMT. The time now is 12:37 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2