- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I need make the wav player on PSoC4 device, but it not so easy..
First I add the FatFs example to my project, i can read the wav file and the setting data, no problem..
Second I true read data with f_read function byte by byte .and put the results to PWM and change the output pin state to see the maximum speed.
And what I see, after 512 byte reads, i see 50msec delay..
Not matter if I read 1 byte or 512 bytes once, if 150Mb or 32Gb SD card, it same delay 50msec between 512bytes and next 512bytes read..
Yes I can use expensive chip with 16k RAM and make two buffers, but the best solutions it using the same way like the one from SD Player from Chen cite..
So..there presents two version FatFs library ,the small one and the standart ..And the sample wav player build with the small version, with command of stream data read pf_read(0,...) A NULL pointer specifies the streaming read mode
I don't know how it exactly work, but find the asm file (asmfunc.S) ,in timer interrupt make manipulations with FIFO buffer and send data to the UART (I not find how)..
Next step I true to use the same function in my project, but here is the full version of FatFs, and other function to stream read, f_forward..
Even I see the example of make wav player above, but still can't understand how..
Next step I find the source of the function in my project, and it look inactive and work only in AtTiny devices?
But if I remove the #if ... I can add the function to the project and make build without errors..the
Maybe anyone know, if can I make stream read on my PSoC4 ?
I cannot confirm email and add messages due to a bug on your site, the email section is not active
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I try to use 8000 samples/sec and two 512bytes buffers, one read and other load data by f_read function, it work, but i see sound with 15Hz click noise, it look like sd card reading disable the interrupt of timer and the PWM periodically can't update the new values..
WINSTAR OLED ,PSOC4 WAV player test - YouTube
It's done
The problem of noise is my mistake
incount++;
PWM_WriteCompare1(Buff1[]);
changed to
PWM_WriteCompare1(Buff1[incount++]);
and reading delay it mistake in the library
#define M_DELAY_US 100 in file sdcard.c ,
changed to 1
and the result here
I cannot confirm email and add messages due to a bug on your site, the email section is not active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I try to use 8000 samples/sec and two 512bytes buffers, one read and other load data by f_read function, it work, but i see sound with 15Hz click noise, it look like sd card reading disable the interrupt of timer and the PWM periodically can't update the new values..
WINSTAR OLED ,PSOC4 WAV player test - YouTube
It's done
The problem of noise is my mistake
incount++;
PWM_WriteCompare1(Buff1[]);
changed to
PWM_WriteCompare1(Buff1[incount++]);
and reading delay it mistake in the library
#define M_DELAY_US 100 in file sdcard.c ,
changed to 1
and the result here
I cannot confirm email and add messages due to a bug on your site, the email section is not active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please refer this link for Music Player example:
For SD card usuage plaease refer this link for PSoC4:
https://www.hackster.io/hima/psoc-4-sd-card-interface-3e2270
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, but
"4) Insert an empty SD card (upto 2GB size)"
Where can you buy now SD card less of 2Gb?
The my project support up to 32Gb
I cannot confirm email and add messages due to a bug on your site, the email section is not active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am sorry to inform that right now we don't have a officially released component for SD CARD for PSoC4.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The FatFs (link in my question) library support up to 32Gb, just need change the delay value in SDCARD.C file
I cannot confirm email and add messages due to a bug on your site, the email section is not active