I decided that the phone should have a display, this is a 16x2 line LCD, powered from the RPi. All of the dialling logic is handled by the RPi + Python, the phone is simply receiving an ATD modem command with the dialled number.
Likewise for an incoming call the ringing is detected by listening for the incoming call command then answered when the BT phone is picked up. I should have mentioned at this point that the two actions that are read from the phone are the rotary dial and the on/off hook switch. Much of the logic is exactly the same as the PIC version,which goes something like this:
makeCall(number):
write("ATD"+number+";\r\n)
endCall():
closeSerial()
answerCall():
while(1):
openComms()
write("ATA\r\n")
inCall():
while(1):
if(OnHook):
endCall()
waitingForCall():
while(1)
val=readSerial()
if (val == "R"):
return 1
getNumberGPIO():
while(1):
if(pulseDetected):
# throw away first pulse as this is the anti-clockwise dial
num=num+1
if(pause > 0.5):
numStr=NumStr+str(num)
num=0
while(1):
if (offHook):
num=getNumber()
makeCall(num)
inCall()
if (onHook)
answer=waitForCall()
if(answer == 1)
inc=answerCall()
if(inc == 1)
inCall()I have discovered a new toy....a crimper for making connectors, the kind you fit to jumpers. Anyway this makes prototyping a lot quicker, once you've made the wires, and my production hardware also uses these jumpers.
The downside to the jumpers is that they use a bit more space, the obvious alternative is to just solder directly to the veroboard.
On to the phone, I have, unfortunately, had to remove the ringer solenoids and the bells because I broke my ringer circuit AND there isn't room in the phone for the PRi and the Nokia and the ringer circuit. One of the biggest space consumers is the USB cables. I am awaiting for some 90deg ones to arrive from China.
The RPi circuit design
As you can probably see this is as expected. Only joking, I will post the circuit diagrams when I have drawn them up, basically it's a couple of pull-down resistors, one for the pulse detection of the rotary dial, and one for the on/off hook.I have put the two circuits - each consisting of 2 resistors, on a small piece of veroboard, along with the 10K pot for the LCD display.
Fitting the LCD display, tastefully, to the BT phone casing.
I used a pair of dividers, like a pair of compasses for drawing a circle but with 2 spikes, to measure the overlap of the underside of the LCD display. Once marked with the dividers, I then drilled through with a 0.5mm drill bit then used a Stanley Knife to cut the rectangle out.
No comments:
Post a Comment