Problem with SHIFTIN / DTMF / SPI bus
Briga
Posts: 2
Hi,
I am trying to interface to a MT3270. The DS is attached, and so is the code.
The problem happens to be the last bit b3 which always read as 0.
So if I press 1 I read 1 and so up to 7.
8 reads as 0
9 as 1, and so on.·
Looking at the time scale on the DS the b3 seems to be smaller edge.... is my code right?
Ant suggestion?
Thanks
Briga
' {$STAMP BS2p}
'Testet DTMF da MT3x70
D_EST ·CON·4·' Al piedino 15 nel SOIC18
D_ACK·CON·5·' Al piedino 13 nel SOIC18
D_SD·CON·6·' Al piedino 11 nel SOIC18
Value·VAR·Byte
digit·VAR·Byte
· INPUT· D_EST
· INPUT· D_SD
· OUTPUT D_ACK
Init:
· DEBUG "Tester DTMF MT3x70 S",CR
· LOW D_ACk··' Deve essere tenuto basso dal uP
Start:
· DEBUG "Waiting..."
WaitForTone:
· IF IN4=0 THEN WaitForTone:
· SHIFTIN D_SD,D_ACK,LSBPOST,[noparse][[/noparse]Value\4]
· LOOKUP Value,[noparse][[/noparse]"D","1","2","3","4","5","6","7","8","9","0","*","#","A","B","C"],digit
WaitForEndTone:
· IF IN4=1 then WaitForEndTone
· GOTO Start
I am trying to interface to a MT3270. The DS is attached, and so is the code.
The problem happens to be the last bit b3 which always read as 0.
So if I press 1 I read 1 and so up to 7.
8 reads as 0
9 as 1, and so on.·
Looking at the time scale on the DS the b3 seems to be smaller edge.... is my code right?
Ant suggestion?
Thanks
Briga
' {$STAMP BS2p}
'Testet DTMF da MT3x70
D_EST ·CON·4·' Al piedino 15 nel SOIC18
D_ACK·CON·5·' Al piedino 13 nel SOIC18
D_SD·CON·6·' Al piedino 11 nel SOIC18
Value·VAR·Byte
digit·VAR·Byte
· INPUT· D_EST
· INPUT· D_SD
· OUTPUT D_ACK
Init:
· DEBUG "Tester DTMF MT3x70 S",CR
· LOW D_ACk··' Deve essere tenuto basso dal uP
Start:
· DEBUG "Waiting..."
WaitForTone:
· IF IN4=0 THEN WaitForTone:
· SHIFTIN D_SD,D_ACK,LSBPOST,[noparse][[/noparse]Value\4]
· LOOKUP Value,[noparse][[/noparse]"D","1","2","3","4","5","6","7","8","9","0","*","#","A","B","C"],digit
WaitForEndTone:
· IF IN4=1 then WaitForEndTone
· GOTO Start
pdf
486K
Comments
Thanks
Paolo
I did a similar thing a few years ago, but used a different decoder chip.The technique was similar to yours.
I'll dig out my old code for you to have a look at.
Also, in the lookup table, are values in quotes ASCII values or the actual value returned by the chip?
If the chip is delivering actual values and the table has ASCII values, the two will perhaps never connect.
Cheers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
LOW D_ACK
FOR digit=0 TO 3 'reuse digit save space
TOGGLE D_ACK
pause 1 'allow for propogation delay
Value.LOWBIT(digit)=D_SD
TOGGLE D_ACK
NEXT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (TechnoRobbo) : 12/28/2006 3:56:18 PM GMT
Have you tried simulating the output of the dtmf chip by using jumpers on the 4 inputs to the shift register? (remove the dtmf data lines" I don't have a stamp book handy, but is there any possibility you have an " off by 1 problem" in your shiftin/lookup code?
Rick