--- "Alan B. Pearce" wrote: > >> // Give the output bits some nice names (which I > >> noticed you did, and then > >> commented out) > >> > >> #define CS RA0 // Chip Select output > >> #define SCLK RA1 // Serial Clock > >> output > >> #define SDI RA2 // Serial Data In output > >> > >> // Make CS high: > >> CS = 1; > >> > >> // Make SCLK low > >> SCLK = 0; > > > >Hehe, weird. I had exactly that code, totally > >identical, it first, but I seemed too simple :). > >Now, I found this in some code of Mike Pearce: > > perhaps I missed something in the early posts, but > there is something > strange about all this. Strange in what way? It is likely that I'm doing some pretty dumb things, since I know nearly nothing about all this :). > > You are bit-banging an SPI interface, why not use > the SPI hardware interface > that is in the chip? That would force me to use certain pins. I like to have things set up as flexible as possible. If I can't get it to work with software, I'll consider using the SPI hardware interface. > The other thing I wonder is how the chip is > connected. Are you connecting > the serial data out line from the PIC to the SDI > line of the other chip, and > the SDI line of the PIC to the SDO line of the other > chip? Yes, it's like that. The SDI in my code is the signal that's going into the SDI on the chip. This is then routed trough to the next chip. To set the volume, you just send the MSB first, then the LSB and you do that once for every chip. If I understand correctly you need to start sending the data for the "last" chip, so the chip that hasn't got it's SDO signal connected to anything. Regards, Anthony PS: I'm not working on this all the time. I first want to finish an amplifier I'm working on. I started making it about 3-4 months ago and it should be working this weekend, then I'll start making a case for it. Once that's done, I can completely concentrate myself on the digital preamp. Ok, time to get working on that amplifier. Hopefully I don't zap myself, I almost did that yesterday... ===== Website: http://members.lycos.nl/anthonyvh __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body