> Does anybody know where/how to find a sony (IR/elec.) protocol for > controlling CD-players/Mini-discs. There are lots of resources. Try: http://pasture.ecn.purdue.edu/~laird/Electronics/Sony/Protocols/sircs.txt http://www.brouhaha.com/~eric/pic/controls.html http://falcon.arts.cornell.edu/~dnegro/IR/ There you should have the basic information needed for Sony CD IR control. > I have to design a pic-system which can control 2xCDs and 2xMini-discs > to make a random play from the four devices. The project should be > installed on a radio-station to do random playing at night without > personal control. Sound like an ambitious project. > Furthermore the system should have 4 optical/digital inputs, and a > switching/fading function should be implemented. I would suggest standard unbalanced AES instead of optical, since optical is more prone to problems in my experience (problems with the connectors loosening and the cables I've used were fragile) and requires more hardware. But, most of the low end Sony stuff has only optical, so I guess you have no choice ? Optical cabling may have improved the past years for all I know, but when I used it, it was crap. The more I think about this... are you really sure you want to mix/fade these signals digitally ? I mean: this is radio and there is high quality analogue hardware with digital controls available and it would make your project a whole lot simpler. You could of course use the analogue outputs from the CDs, mix and do volume control and then resample it to offer a digial output. But, given that you want to do fading/mixing real time using a PIC, you will need to handle 352K bytes input with 176K bytes output with scaling and addition, provided mixing is only done between two inputs at a time. If no mixing is required during fading, there would be less work. This is not impossible, but you will have to use parallel input/outputs in order to keep up with the data flow. The programming should be trivial. I also assume that filtering from the 0-22050 CD bandwidth down to the FM stereo bandwidth will be done after your gadget, perhaps at the transmitter stage somewhere. PICs are not well suited for FIR filter implementations (at least in my view), so you would have to use dedicated digital filters if not.. Detecting end of song is difficult. I would suggest the following: - Detect the end of song using 1-2 sec. silence detection. With digital inputs false silence detections will be very improbable, since some noise are always present in silent parts of songs. - In order to detect silence after a song that has no silence before the next, do not play the song the normal way using the IR control. Instead, for each song, make a program containing only the song you want to play and start program playback. The CD player will stop after that song and your program will detect silence. Remember to erase the program before entering a new one. One of the remaining issues would be to know the number of songs on each CD/MD. Regards, Bob (tm)