TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (405 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (133 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (142066 times)
  2. FAT32 Library (75294 times)
  3. Network Ethernet Library (59491 times)
  4. USB Device Library (49522 times)
  5. Network WiFi Library (45288 times)
  6. FT800 Library (44914 times)
  7. GSM click (31432 times)
  8. mikroSDK (30441 times)
  9. microSD click (27802 times)
  10. PID Library (27622 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Example

Interrupt Driven State Machine MP3 Player for Smart MP3-Board

Rating:

0

Author: Dick Berry

Last Updated: 2016-02-18

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: Audio & Speech

Downloaded: 794 times

Followed by: 1 user

License: MIT license  

This is a real time state machine that plays MP-3 files from the SD Card using the Smart-MP3 board. Now I can service the GLCD and Touch Panel while playing Audio Files. I've included the five songs I tested with. Just copy them to your SD Card.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Interrupt Driven State Machine MP3 Player for Smart MP3-Board" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Interrupt Driven State Machine MP3 Player for Smart MP3-Board" changes.

Do you want to report abuse regarding "Interrupt Driven State Machine MP3 Player for Smart MP3-Board".

  • Information
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Example Blog

I wanted audio in my Camper Light Project but didn't want to give up Touch Panel functions while playing a MP3 file. So I modified the Example for the Smart-MP3 board to make it a State Machine rune during a Timer 0 Interrupt. The Interrupt comes at 250 ms intervals and the state machine uses about 100 ms of that time, so I got better than 50% of the CPU time back for GLCD and TP processing. I needed to up the processor to a 18F46K22 for this project because the MP3 and GLCD use a lot of memory. I also run it at 64 Mhz to keep the eight bit controller from dragging the screens out. A shout out to MikroElektronica  for the example program which spelled out the requirements for the VS1053b. It will run at 32 Mhz on a 18F45K22 but the music will be choppy. You'll recognize it but don't try to dance ;-)

 

I'll be using this in my Camper Light Project along with a Speak-Up board.

I'll attach a picture of the scope showing timing, look for the PortA.0 twiddleing in the Interrupt routine to make sence of it.

Thanks for looking

Dick

Picture of the &quot;O&quot; Scope showing timing

Picture of the "O" Scope showing timing

This is the start to finish timing in the Interrupt routine.

View full image

I intregrated this into my Camper Light Project and got many Re-Entry conflicts. They were unresolvable because they were calls in the Libraries. A serch here led me to the Legacy Mcm Libraries. After installing them and changeing the calls in my SD Card access software all was well. Thanks again to MikroElektronica for leaving them on LibStock. In addition to working fine they use less resources. Thank goodness I only needed to read from the card.   Dick

While Normalizing the Volume levels of the MP3 files I tried an experiment and re-sampled them at 8000bps. The music wasn't any different but the time in the Interrupt routine went from100ms to 20ms to 30ms. This meant I could change the Interrupt timing to 500ms. Now I'm spending only 4.45% of the time in the MP3 server. The Touch Panel and GLCD is much more responsive. Here is a picture from my new OWON VDS3102 "O" Scope. If you can afford one it's really worth the money.

Thanks Dick

Scop Picture of Interrupt Timing # 2

Scop Picture of Interrupt Timing # 2

After re-sampling the MP3 files at 8000bps. Explanation in the picture lower right corner.

View full image

ALSO FROM THIS AUTHOR

Saving Glcd Calibration Data in internl EEPROM

0

Calibrate the Touch Panel (only if required) with saved data that is check summed. Displays Cal Data and EEPROM Data on GLCD PIC 18F46K22

[Learn More]

ExpressPCB Schematic and PCB Layout (FREE Software)

0

A very nice Schematic Drawing Tool and PCB Layout Software (Free Download) Extensive Library with component building. Up to four layer PCB can be ordered from them but not required. Software is not a trial and is fully enabled. Many PIC Controllers in the Library. http://www.expresspcb.com/index.htm Enjoy! Dick

[Learn More]

RV Monitor System Two Displays, Battery Voltage, Fresh Water Level, Outside Temp, Inside Temp, With Cycleing Mode

10

This is a Monitor system for Travel Trailers, Pop Up's and other RV's. I have made provisions for two displays, one inside and one outside. A single button for each display steps through the modes. Modes include Battery Voltage: Fresh Water Level: Outside Temp: Inside Temp: Cycle The Data Displays: Off: Thanks For Looking Dick

[Learn More]