Shop OBEX P1 Docs P2 Docs Learn Events
Problem with SHIFTIN / DTMF / SPI bus — Parallax Forums

Problem with SHIFTIN / DTMF / SPI bus

BrigaBriga Posts: 2
edited 2006-12-28 15:44 in BASIC Stamp
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

Comments

  • BrigaBriga Posts: 2
    edited 2006-12-28 13:56
    Anyone can at least tell if it is possible or is it a physical limitation?

    Thanks
    Paolo
  • stamptrolstamptrol Posts: 1,731
    edited 2006-12-28 14:54
    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
    ·
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2006-12-28 15:39
    try replacing shiftin with this see if it works:


    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
  • RickBRickB Posts: 395
    edited 2006-12-28 15:44
    Paolo

    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
Sign In or Register to comment.