Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Please guide me to match this timing diagram

Status
Not open for further replies.

kurukuru

Junior Member level 1
Joined
Jun 1, 2009
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Japan
Activity points
1,412
The attachment is timing diagram of DAC codec IC PCM3008 (16 bit serial) that I would like to interface using FPGA.
As in the diagram I have already create LRCK (which is sampling freq. 32kHz) and BCK (which is bit shifting freq. 512kHz) by divide my clock input.
The problem is I don't know how to detect when to start shif my data from first bit to last bit respectively since LRCK and BCK is freely run from the start.
Would anyone guide me by provide me some guide? VHDL code also appreciate as well as others suggests.

Thank you
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,447
Helped
14,039
Reputation
28,331
Reaction score
12,690
Trophy points
1,393
Location
Bochum, Germany
Activity points
275,962
I have already create LRCK (which is sampling freq. 32kHz) and BCK (which is bit shifting freq. 512kHz)
Not correct. Even in your unclear diagram (there are much better in any TI PCM chip datasheet), you see, that BCK must be at least 32*fs respectively 1024 kHz.

I don't know how to detect when to start shift my data.
LRCK is the frame synchronisation.
 

kurukuru

Junior Member level 1
Joined
Jun 1, 2009
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Japan
Activity points
1,412
Thank you very much FvM for you answer.

Sorry for my stupidly mistake on BCK. But may you explain more that LRCK is frame synchronization.

For my understand, I have to shift all off my L-Channel audio during '1' of LRCK and R-Channel during '0' of LRCK.
But what I would like to ask is when my digital data is ready to be sent, which I don't know when on this time diagram,
are there better way to create timing diagram than use latch to detect rising egge of LRCK then count variable parameter and shift Din to meet BCK timing.

Thank you in advance.
 

shitansh

Full Member level 5
Joined
Jan 6, 2009
Messages
296
Helped
50
Reputation
98
Reaction score
28
Trophy points
1,308
Location
India-Gujarat
Activity points
3,019
Hi,

Say your shifting clock is BitClk and slower clock is FrameClk. So for your case BitClk = FrameClk x 32.

So when posedge of FrameClk detected in BitClk domain you need to start shiting your data which is 32 bit wide. You will achive this staisfactorly as your FrameClk = BitClk/32.

So on next rising edge of FrameClk your data will be available at out put.

Same way on reciver side you have to do.

--
Shitansh Vaghela
 

kurukuru

Junior Member level 1
Joined
Jun 1, 2009
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Japan
Activity points
1,412
Thank you very much shitansh,

Did you mean put both BCK and LRCLK in the sensitivity case of process and then something like

detect rising edge of LRCLK then start shift my digital data with BCK?

But I know mean to detect rising edge only use lach and double latch then comparing both to find rising edge.

Do you think this is the best way to detect rising edge or if there are others way pls tell me.
 

shitansh

Full Member level 5
Joined
Jan 6, 2009
Messages
296
Helped
50
Reputation
98
Reaction score
28
Trophy points
1,308
Location
India-Gujarat
Activity points
3,019
kurukuru said:
Did you mean put both BCK and LRCLK in the sensitivity case of process and then something like
I am not getting what you understand please be more clear

kurukuru said:
detect rising edge of LRCLK then start shift my digital data with BCK?
Yes exactly this you have to do.

kurukuru said:
But I know mean to detect rising edge only use lach and double latch then comparing both to find rising edge.

Do you think this is the best way to detect rising edge or if there are others way pls tell me.
Yes this is one way you can do this another way to detect rising edge of FrameClk in BitClk domain is FSM. But use only synchronized output in that.



I hope this link may help you for this. This is simulation result of attached verilog file.
http://images.elektroda.net/50_1252300669.jpg


--
Shitansh Vaghela
 

kurukuru

Junior Member level 1
Joined
Jun 1, 2009
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Japan
Activity points
1,412
Thank you very much again shitansh,

I finally matched this timing diagram and get sound out from my codec IC already.

By the way, It's still a lot of noise. I think may be because by un-continue CODEC data input cause by my code which I'm going to fix.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top