Hi Raphael, Since no one else has answered your query I thought I'd have a go. Now I'm no expert in using these things, but I did get a CS4331 to work in my MP3 player but this was driven directly by a STA013 MP3 decoder chip. I'm afraid that I don't think you will be able to get much of a sample rate out of this DAC with a PIC.. Basically the signals are: MClock Master clock generally 256, 384 or 512 times your sample rate It depends on what you DAC needs. This is FAST. If your sample rate is (for audio say) 44.1KHz, the Master clock rate with 256 oversample is 11.2896MHz! LRClock This is used to indicate which channel the data being clocked in is currently for. If we want to have 44,100 samples per second, this is the frequency of this clock. So when the clock is HIGH we need to clock in the data for one channel, when it is LOW, we need to clock in the data for the other channel. Serial Clock (Data Clock) This is used to clock in the serial data for each sample. Again this depends on the format your DAC needs, but if you have a 24bit DAC you will have at least 24 bits of data being clocked in for each channel for each sample at the sample rate. Therefore the serial clock is run at the sample rate * number bits per sample * 2. IE: 44.1KHz * 2 channels * 24 bits = 2.1168MHz. Data This is the serial data.. it is clocked in by the serial clock. As far as I know these clocks need to be there always. This is because the DAC locks onto them and generates some internal timing from them. Now you could probably run them lots slower, but basically they are fast and the poor old PIC is going to be gasping for breath.. If you really need to use this sort of DAC, perhaps you need to add some Logic to manage the sending of data to the DAC in a PLD or something. The idea would be for the PIC to input data in parallel when requested by the PLD and it would stream it out serially based on a system clock that it divides down. You would probably want it to buffer a small number of samples so that PIC processing delays don't screw up the data stream. Also I had lots of fun trying to get the format of the serial data correct as there are many different timings, alignments and formats for the data samples. Perhaps if you give us a little more information about your application the list members may be able to suggest a better approach. Hope this helps a little. Cheers, Ash. --- Ashley Roll Digital Nemesis Pty Ltd www.digitalnemesis.com Mobile: +61 (0)417 705 718 > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of raphael abrams > Sent: Wednesday, 22 May 2002 7:43 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [EE] cirrus cs4390 help! > > > I am in need of some experienced advice on using the cs4390 dac with a > pic16f877. > > The questions are: what is the relationship between the data > and data-clock > signals with the LRclock and Mclock signals? Does the data have to be > aligned in some way with the mclock? Does the dataClock have > to be running > all the time? > > does anyone have any code, preferably in c or assembler, that they are > willing to share? > > any help would be greatly appreciated! > thanks, > raphael abrams -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads