• AVR Freaks

USB MP3 Audio Streamer

Page: < 12 Showing page 2 of 2
Author
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/12 22:02:56 (permalink)
0
Hi Tsuneo:

Thank you for your reply. As of my project, I'm not using any file system, so I'm using just raw SD sectors for storing MP3 data.
As mzoran also mentioned, it seems that the PIC18LF2550 is not the best option as it even can't run at full 48 Mhz.
I'm getting the microcontroller mzoran suggested and see what happens. Getting the MP3 data from USB using HID class, buffering on PIC's RAM (512 or 1024 bytes) and feeding the VS1011e should work fine.

Let me know if I'm wrong ;-)

Andy

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#21
Kiwi Mike AZ
Super Member
  • Total Posts : 2056
  • Reward points : 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/12 22:06:07 (permalink)
0

PIC24FJxxxGB10x and PIC32 MX4 families are worth looking into.

The PIC24's can often be price comparable to the PIC18's, and the PIC32's are only a little more.

Far more memory to play with in both RAM and FLASH, as well as a notable performance boost.

Mike
#22
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/12 22:11:58 (permalink)
0
Yeah Mike, you are right, but unfortuately PIC24 (not all devices) and PIC32 are difficult to prototype as they have tiny packages unsuitable for a simple breadboard. I don't know if I'm wrong but I like to make the hardware in a breadboard because buying special kits and boards is more expensive.

Also, I just have a PICStart+ to program my devices (which I know is very old). Another option would be to use ICSP, but the tiny-packages problem remains.

Am I wrong? ;-)

Andy

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#23
Kiwi Mike AZ
Super Member
  • Total Posts : 2056
  • Reward points : 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/12 22:20:03 (permalink)
0

There are breakout boards so that you can do that.

have a look at www.sparkfun.com

http://www.sparkfun.com/commerce/product_info.php?products_id=8971

If you want a PIC24FJ256GB110 instead... ask them nicely and they might populate it for you.

I used to have some breakout boards for them, but closed down my business

Mike
#24
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/12 22:25:30 (permalink)
0
It's good to know. Maybe I'll get one of those to experiment with. :)

Thanks Mike.

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#25
bien_van_khat
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2006/05/11 20:41:17
  • Location: Vietnam
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 00:01:27 (permalink)
0

ORIGINAL: andyolivares

Yeah Mike, you are right, but unfortuately PIC24 (not all devices) and PIC32 are difficult to prototype as they have tiny packages unsuitable for a simple breadboard. I don't know if I'm wrong but I like to make the hardware in a breadboard because buying special kits and boards is more expensive.

Also, I just have a PICStart+ to program my devices (which I know is very old). Another option would be to use ICSP, but the tiny-packages problem remains.

Am I wrong? ;-)

Andy


A bit of side information, when we was student (have lot of free time but not much money)
we used to make single-sided prototype PCB with TQFP footprint by hand, with Iron and laser printer Smile

0.4mm lead pitch footprint (100 pin -PT type) require to work very carefully

however, 0.5 mm lead pitch footprint (100 pin -PF and 80, 64 pin -PT) is simpler
#26
freestyle
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2006/08/01 07:33:55
  • Location: Moscow, Russia
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 10:52:12 (permalink)
0
hi guys,
so, bandwidth calculation: 64 B x 1 ms = 64K bytes / s = 512 kbps (compare to most common 128 kbps MP3 stream).
however double-buffering is needed for gapless playback.
if it comes to performance, any of MCHP USB-enabled parts will fit the application without external components like SPI SRAM. the finest solution for me would be 14K50 (but it needs ICD header for full-featured debugging).
for quick-and-easy development 18LF2550 is the best choice

#27
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 11:25:30 (permalink)
0
Yeah, based on calculations, a standard MP3 of 128 Kbps should play correctly without glitches (with a proper buffer), but apparently (after many tries and experiments) it seems like the 18LF2550 is too slow for all the processing. The USB stack is a procesor-consuming part, add to this the process of feeding the MP3 decoder (which should be do with a speed of 4 Mbps).

I have hope that the other PIC mentioned, PIC18F26J50 could be better and work at full 48 Mhz. I'll get one soon and test.

Andy

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#28
freestyle
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2006/08/01 07:33:55
  • Location: Moscow, Russia
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 11:55:27 (permalink)
0
if we say about single non-commercial device, I think you can try 18LF2550 at higher clock rates than mentioned in specs. just make sure to place blocking 0.1u right on VDD/VSS pins.
also set Default Storage Class to "static" in compiler preferences and use polling for USB driver if possible - this will improve performance and tasks sheduling.
another solution - to try CCS HID implementation (object code from CCS 8-bit compilers seems to be little faster)
#29
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 12:00:54 (permalink)
0
I'm currently using the CCS HID implementation as a base for my project. Also, I'm using a 20 Mhz crystal using the PLL to run the PIC at 48 Mhz at 3V. I don't know that if doing this I can achieve the full 48 Mhz, I think not.

Andy

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#30
freestyle
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2006/08/01 07:33:55
  • Location: Moscow, Russia
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 12:15:53 (permalink)
0
can't guess your current config bits settings. post them here, pls

I'm pretty sure this project can be done on LF2550
#31
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 12:18:36 (permalink)
0
For the CCS PIC-C compiler, I'm using:

#include <18F2550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)

At the beginnig of the main file.

Regards,

Andy

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#32
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 12:20:13 (permalink)
0
I've been reading the datasheet, and I can't find where it says that the LF version can run at a maximum speed of 16 Mhz.

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#33
freestyle
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2006/08/01 07:33:55
  • Location: Moscow, Russia
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 12:35:49 (permalink)
0
that's nice. you're running 48MHz already, so moving to 26J50 will give nothing.
maximum recommended at 3.3 V is approx. 24 MHz (Figure 28-2 in datasheet)

so if you still have performance issues, only hand-tuned coding will help.
I would start from procedure writing 32 bytes to SPI in single burst. maybe you'll need inline assembly.
also secondary buffer must have cyclic structure to reduce data moving
#34
andyolivares
Junior Member
  • Total Posts : 118
  • Reward points : 0
  • Joined: 2006/11/29 07:46:48
  • Location: 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 16:05:10 (permalink)
0
Well, aparently not. I need about 4.2V to get the full 48 Mhz, and my board only has ~3.3V.

Visit my website: http://www.andyolivares.com
You might find useful projects and example codes.
#35
Kiwi Mike AZ
Super Member
  • Total Posts : 2056
  • Reward points : 0
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/13 17:36:00 (permalink)
0

For the LF parts the PLL and oscillator does not operate at the higher frequency any longer.

BUT using a 48MHz external oscillator it operates fine.

Mike
#36
freestyle
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2006/08/01 07:33:55
  • Location: Moscow, Russia
  • Status: offline
RE: USB MP3 Audio Streamer 2009/07/14 00:26:51 (permalink)
0
MCU can't prevent you from overclocking them. configuration bits are hardware logic without any ambiguity.
your settings (USBDIV, CPUDIV1) means that you take Fosc directly from internal USB VCO (48MHz). at last, you can check internal frequency in hardware

btw, have read previous posts thoroughly - it is surprising information for me about DMA in 26J50. definitely, it will speed up

#37
audioman
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2011/06/23 10:26:08
  • Location: 0
  • Status: offline
Re:USB MP3 Audio Streamer 2011/06/23 10:55:08 (permalink)
0
Hi Andy  , may be this can help .
i am not  professional one ,but seems we have the same problems . you use VS1011 , but we use VS1003 with AVR mcu , we use the MCU to read the SD card, but we try long time , only can make it support 2GB SD card , can not be higher  ,because the MCU speed is not enough ,  need ARM solutions .  You know we are not building a computer , the production cost is important . ARM will cost high  .  finally , we give up ths solution . and we found one serial mp3 module ( with TXD , RXD ) and control by one low cost PIC mcu  (OTP type)  ,  the module called  "TDB380 "  , you can find it here www.tendaelectronics.com
 
This module help me too much , Hope this also can help you  . 
#38
Page: < 12 Showing page 2 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5