Keelan Lightfoot wrote: > Just pondering the 150 pair cable connecting the console on my 1970's > era PBX to the main cabinet, and after a look through the schematics, > I think it would be possible to reduce this whole deal to a piece of > category 5, using a PIC. This problem approximates the church (pipe) organ control situation. The unit our church is using apparently uses shift registers to multiplex the data continuously into a datastream of about 8 kbaud with some form of synchronisation. It certainly doesn't use PICs! While shift registers are obvious choices for input and output (TPIC6595 or similar for output), you are dealing with "sparse" data and I would see no need to continuously update the data (and I doubt you need checksumming but...). 180 bits is 23 bytes or so and a PIC with at least this amount of RAM should do nicely. Each 8 bits shifted in from a register is compared to the "previous" data recorded for that group and if different, a message packet prepared and sent (containing the message type, group number and byte data). Then on to the next group (the shift registers can wait in the meantime!) and so on. A "background" scan could slowly step through all the stored data and send it progressively just in case of glitches. Data rate could be minimal and crosstalk minimised (though I fear you will get some anyway). > What would be the best way to get all this data onto 1 twisted pair > that could be around 1000 feet long (What serial protocol? RS-422?), You obviously want RS-485 running in alternating (co-operative) half- duplex to use the same line in both directions. IOW, each end sends a block of data and then invites a reply. > with a reasonable refresh rate that would not miss any button presses? The problem is actually the reverse - keeping response slow enough to provide de-bouncing. Mind you, the system must already provide that anyway. > What would be the best way to control 180 outputs with a PIC, and > drive 180 'common anode' 12v lamps? TPIC6595 (T-I) > Which PIC would be the best for this application? Offhand, a 16F84 might suffice! But a chip with a hardware UART (maybe an AVR) would be easier. > Also, what would be the best way to convert a 12v signal to a 5v > signal suitable for use as a TTL input, with the least amount of > parts? TTL? What's that? I'd have to think on that one a bit. It's going to involve resistors. Sounds quite a pleasant challenge to me! -- Cheers, Paul B.