Go Down

Topic: Playing back audio question (Read 709 times) previous topic - next topic


The Arduino playgraound article http://playground.arduino.cc/PWMAudio/PWMAudio

published a  code where the UART is read at a 62.5 Khz rate in order to playback a wave file.

The computer program in Python is sending the wav file at 1 Mbaud but the UART is being read at a 62.5 Khz rate using a timer overflow interrupt.

Is not a bunch of data loss ? The Python program will sent bytes like crazy at 1 MB one after the other just limited by the computer clock  speed but the Arduino code  is reading the UART at the sampling rate.

The way I've understood this to be done is to set the computer side to send byte by byte at 1MB but at a rate of,  for this example 62.5 Khz , then on the Arduino side,  use the UART rx interrupt. This will synchronize the data in the proper way.

Is there something missing on the code published at above link ( either Arduino or Python)? or what am I missing or not quite understanding ?

Thanks a million in advance for any comments!



Does nobody experienced this. I will appreciate any comment please !!!!!!!!!!!!!


Does seem like some flow control is needed to prevent loss of data.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Jan 14, 2015, 08:11 am Last Edit: Jan 14, 2015, 08:11 am by Nick Gammon
What is enough, pray?
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up