10 Output Shift Registers

By this stage I'm nearing the point where pretty much everything needed to connect a call over two phones is in place; on the source phone I can detect OH (and potentially send a dial tone) as well as detect a dial pulse train. On the destination phone I can send it ringing current to operate the bells and detect OH if the call is answered. What I'm going to need next are some outputs to activate the relays to bridge and route calls, send ringing current and operate the dialing tones.


So it pretty obvious I'm going to need many more outputs than the ones available on the Arduino. To get round this I'm going to use a couple of daisy chained SN74HC595's shift registers to give me 16 outputs for the price of three on the Arduino, as shown below.


I end up with an output map something like this...

#define C595SourceRly1 1  // 1 to 8 will operate the relay matrix
#define C595SourceRly2 2
#define C595SourceRly3 4
#define C595SourceRly4 8

#define C595DestRly1 16
#define C595DestRly2 32
#define C595DestRly3 64
#define C595DestRly4 128

#define TonesRelayPin 256
#define CallSenseRelayPin 512
#define LinkSourceAndDestPhonesRelayPin 1024 
#define RingRelayPin 2048

The last two pins are spare. As I am in a soldering mood I also complete the work to get the shift in register on to the same Veroboard (top right) as the tone generator and create a resistor array to terminate each relay (bottom right). It might have been better to terminate each relay on the main board to reduce the number of Dupont connections but there isn't the space.


To the left of the input shift register I have also added the tones relay that will be used to generate the tones cadence. It's a dual relay IC but one of the relays wasn't working but that's ok as I only the one. 

Probably you might have noticed by now I haven't really said anything about the OS behind the exchange. The OS code is written in C (I've never felt the need to learn C++) and really does not a lot more than manage the inputs and outputs to and from the optocouplers and relays in order to sequence a call. Saying that it still ended up being relatively complex code using up around 80% of the Arduino's RAM. I'm not going go into any detail about it as there are plenty of coding sites about if it's something you are interested to learn more about.

Comments

Popular posts from this blog

12 Boxing it up

8 Tone generation

9 Ringing and Answering Phones