interfacing a texas instruments pcm1725 digital to analog converter

Upload: jennifer-neal

Post on 04-Jun-2018

230 views

Category:

Documents


1 download

TRANSCRIPT

  • 8/13/2019 Interfacing a Texas Instruments PCM1725 Digital to Analog Converter

    1/4

    Interfacing a Texas InstrumentsPCM1725 Digital to Analog Converter

    (DAC) to a PIC16 6!"

    I've recently become interested in adding sound to some microcontroller projects, anddecided to use the PCM1725 manu actured by !e"as Instruments# !his chip is relativelycheap and comes in a $%IC pac&age, hich, hile not as convenient as a (IP, is mucheasier to or& ith than an $$%P# !his project is a minimalist approach and does not

    provide C( )uality audio due to the lo sampling rate, but I believe it is enough to shothe concepts involved ith ma&ing the PCM1725 or

    !his project only includes three integrated circuits* a !I PCM1725 digital to analogconverter that produces audio rom binary data, an +tmel +!25( -.1+ memory chip tohold the binary sound ile, and a Microchip PIC1/ /0- that controls the other chips# Iused the internal cloc& on the 1/ /0- running at Mh ith cloc&out on the 3+. pin,

    hich provides the system cloc& or the PCM1725 at 2Mh # !hus, the sampling rate islimited to around 7, -- samples4sec# since the system cloc& must be 25/ or . times thesampling re)uency# !he PCM1725 re)uires the ollo ing inputs* system cloc& at 25/ or

    . times the sampling re)uency, 6e t43ight cloc& that cloc&s in the data or the le t andright channels at one cycle per sample 1425/th or 14 .th the system cloc& re)uency8,

    bit cloc& that cloc&s in the binary data one bit at a time though the datasheet is silent onthe re)uency, it should be /. cycles per sample, or 2 bits per channel per sample8, and

    the binary audio data# 9ach o these e"cept or the binary audio data is provided by the1/ /0-# !he binary in ormation is delivered rom the memory chip directly#

    !he pins o the chips are mapped as ollo s*

    Pic 3C7 : Memory Chip $IPic 3;/ : Memory Chip $C< and PCM1725 ;C

  • 8/13/2019 Interfacing a Texas Instruments PCM1725 Digital to Analog Converter

    2/4

    =ote that I tied the ormat pin to ground in order to use standard data entry ormattinginstead#

    $o here is ho it or&s# !he PIC1/ /0- initiates a read command on the memory chip,hich already has the audio data loaded# or the +!25( -.1+, this is done by cloc&ing

    in the 1 byte 3ead command > > in binary8 ollo ed by the three address bytes, hichare all -'s or my application since I ant to start ith the irst byte# ollo ing the readcommand, the memory chip places the irst bit o in ormation on the $% pin allin ormation is cloc&ed out on the do n cycle o the data cloc&8# !he 3;7 pin on thePIC1/ /0- is pulled high to begin cloc&ing in the le t channel data 63CI= pin on thePCM17258# +ll subse)uent cycles o the 3;/ pin on the 1/ /0- cloc& in data into thePCM1725 on the ups ing and retrieve the ne"t bit rom the memory chip on thedo ns ing# ollo ing 2 cycles o 3;/, 3;7 is pulled do n to cloc& in the le t channel

    byte in ormation that as just entered and start entering the right channel in ormation in

  • 8/13/2019 Interfacing a Texas Instruments PCM1725 Digital to Analog Converter

    3/4

    the same manner# + ter 2 bits have been entered, the 3;7 pin 63CI= on thePCM17258 is pulled high to cloc& in the right channel in ormation and start entering thene"t sample#

    Clic& here or the irm are, ritten in ?i:!ech C or the PIC 1/ /0-

    %ne note on the ormatting o the audio ile on the memory chip# !he data must beentered M$; ist ;ig 9ndian8, hich means that the bytes must be reversed i you areusing a # av ile, since they are entered in 6ittle 9ndian orm# $ee this page or morein ormation on the # av @+A98 ile ormat# +lso, since the PCM1725 is only 1/ bit,you must ma&e sure that the 1/ bits o data are the last 1/ bits cloc&ed in prior tochanging the state o the 63CI= pin i you are using the $tandard data entry ormat# Ithin& you can accomplish this by using the ?%6( eature on the memory chip, but Ihandled it by adding t o -'s to each sample so that the originally 1/:bit data becomes 2

    bit data i#e#, 2 2 17 becomes - - 2 2 178# !his ensures that the 1/ bits o audio data arecloc&ed in during the last 1/ cycles o ;C

  • 8/13/2019 Interfacing a Texas Instruments PCM1725 Digital to Analog Converter

    4/4

    Component 6ist : I you are loo&ing or suppliers or di erent project components, I'vecompiled some good ones here#

    Any questions or comments - contact me at [email protected]

    http://pwc.theclarkwebsite.com/http://pwc.theclarkwebsite.com/