Sounday

From TAMI
Jump to navigationJump to search

ATtami based low cost sound player/amplifier

what

a design for a minimlastic WAV player

we found the market missing a simple board including:

 
 ________
/ speaker\
|   amp   |
| player  |
|rtc | mem|
|   MCU   |
| charger |
| battery |
|USB plug |
----------

  • minimal design, the basic requirement is for
  • playing a WAV audio file
  • memory
  • press of button
  • at set time with trigger from the RTC (real time clock).
  • chargeable with a lipo battery over 5v usb plug
  • amplified
  • speaker

and

hardware

MCU

  • arduino pro mini

will need to mod it to enable sleep modes)

charging circuit

DFs6VXb.png

some more ideas

memory

what size we need?
10min is 50mb in WAV

  • SD module

TPA9zcW.png

  • SD card

~2$ for 4gig

speaker

  • parts-express [1]
  • 4ohm

KAuQhRH.png

3W full range, AE link ebay
UyZ7Ldf.png

Amplifier

  • PAM8403 Digital Amplifier Board 2*3W Class-D

the problem with this one, its expects 6V in.

EpwNX8G.png

  • PAM8013 (MONO)- wider range of input (2.8-5.5v) , PAM8603 - same as PAM8013 but stereo

octopart link datasheet package

RTC

module including battery
QgP6gKU.png

software

TBD

further reading

reading about playing WAV files without an encoder IC using DAC arduino capabilities

  • guy Ovadia wrote an Analysis of a minimalistic PWM DAC for

low-cost 8-bit microcontrollers PDF

ATmega382 / uno

SimpleSDAudio this looks like it
ydFv2PE.jpg

teensy

high end thing

3WIHH4Z.png

z3knHDg.png


ATtami/elmchan version [on hold]

ATtiny85 based solution, as we are following elm-chan path, might be worthwhile to look over his explanation of SDcard read/write
github for elmchan

this is current connections
LanLcGQ.jpg

bootloader

sadly, cant run the sd8p hex files without killing the current ATtami bootloader :(

$ micronucleus --run sd8p_mo.hex 
> Please plug in the device ... 
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device has firmware version 1.11
> Available space for user applications: 6330 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 99  page size: 64
> Erase function sleep duration: 792ms
parsing: 50% complete
> Program file is 426 bytes too big for the bootloader!

trying to upload the hex files using ISP also fails with "out of range" error
note im using avrdudess on windows, but similar problem on avrdude.

sd8p_mo.hex: 6,759 / 8,192 Bytes (82.51%)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 

avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e930b
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "U:\Downloads\sd8p_mo.hex"
avrdude.exe: input file U:\Downloads\sd8p_mo.hex auto detected as Intel Hex
avrdude.exe: ERROR: address 0x820003 out of range at line 426 of U:\Downloads\sd8p_mo.hex
avrdude.exe: read from file 'U:\Downloads\sd8p_mo.hex' failed

SOLVED: erase last three lines at hex file via avrfreaks

fuse set to 16Mhz internal

#USEOPT_t85 = -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m
#FUSEOPT_t85_DISABLERESET = -U lfuse:w:0xe1:m -U efuse:w:0xfe:m -U hfuse:w:0x5d:m
avrdude -c usbasp -p t85 -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m

load hex

 avrdude -c usbasp -p t85 -U flash:w:sd8p_mo.hex:i

prepare Audio

"The SD audio player supports only RIFF-WAVE format sound files known as Microsoft wave file in LPCM, 8/16-bit, mono/stereo and upto 48kHz sampling rate"

ffmpeg -i "input.mp4" -vn -acodec pcm_s16le -ar 16000 -ac 1 -f wav OUTPUT_FILE.WAV

Petit FatFs

Petit FatFs appnotes

based on

sd8p_hr.png mono (HI-res)