Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Emfile problem:Not able to get whole data from a file

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Emfile problem:Not able to get whole data from a file
Moderator:
ANCY

Post Reply
Follow this topic



Emfile problem:Not able to get whole data from a file

BLD posted on 06 Apr 2013 3:43 PM PST
Senior Member
11 Forum Posts

 Hi,

Iam working on wav player, in which i want to play wav file from SD card. With the help of timer i generated interrupts and while interrupts coming PWM's duty cycle is varied. With this logic iam unable to reconstruct the wav file. I think the data from the SD card is not completely read. Can anyone suggest modifications to my code. Please help me. Iam attaching my project here.




Re: Emfile problem:Not able to get whole data from a file

Bob Marlowe posted on 07 Apr 2013 02:08 AM PST
Top Contributor
1768 Forum Posts

In Creator 2 there is integrated the function "Create Workspace Bundle" to be found under the "File" tab. I would suggest to use that to build compressed archives of projects since these can be handled by Creator.

 

Bob



Re: Emfile problem:Not able to get whole data from a file

danaaknight posted on 07 Apr 2013 04:02 AM PST
Top Contributor
1773 Forum Posts

Some observations -

 

1) Speech BW is ~ 3.4 Khz, for a POTS line, so you are oversampled by ~ 2X which is

OK.

 

2) Your PGA is set to low power, which is ~ 3 db down at 1.8 Khz, is that what you want ?

Seems like you want to set that to high power.

 

3) Your buffer size is 12 characters, yet you burst out 512 samples, maybe I am missing

something here........are you decimating here ?

 

 4) Your 24 Mhz CPU clock, 4 Mhz SPI clock, = .3 KPBS read rate from SDCARD. Is 300 bytes/

sec a fast enough sample update rate, then decimated by 12 / 512 ? Seems like this is off by

an order or magnitude.

 

5) PWM out must have a filter, hence a settling time, have you chosen filter components to

meet a settling time and ripple tolerance ? See attached.

 

Regards, Dana.



Re: Emfile problem:Not able to get whole data from a file

BLD posted on 07 Apr 2013 10:12 AM PST
Senior Member
11 Forum Posts

There are two buffers.One is globally defined with 512 bytes Size. From the PWMout iam connecting externally a single pole low pass filer.



Re: Emfile problem:Not able to get whole data from a file

BLD posted on 07 Apr 2013 11:17 AM PST
Senior Member
11 Forum Posts

 How the SD card reading rate becomes 300bytes/sec ?? Can u explain??



Re: Emfile problem:Not able to get whole data from a file

danaaknight posted on 07 Apr 2013 01:32 PM PST
Top Contributor
1773 Forum Posts

My error, I was mis-reading the table, looks like you should be

getting somewhere on the order of 100KBps.

 

 

 

Regards, Dana.



Re: Emfile problem:Not able to get whole data from a file

BLD posted on 07 Apr 2013 08:46 PM PST
Senior Member
11 Forum Posts

 Then what could be the problem??Still not getting audio :(






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20