Hi
I would like to understand why I read wrong numbers…….
A Phone is connected to the DTMF receiver 8870,
Q1-Q4 is connected to P0-P3 and I read the Numbers. So far it works fine,
and I can se the right numbers on the terminal.
I use:
Numbers var byte
But when I play for a while with the phone-buttons, after a while I read wrong numbers,
like: 240 but should be 2
I connected 4 LED to the Outputs Q1-Q4 to see the binary number,
and the binary numbers are always right.
…only 4 bit…. where the wrong numbers come from…
….. OK I solved it, but don’t understand it……
I changed:
“Numbers var byte” in “ Numbers var nib” and it is O.K
I believe:
the not used 00’s in the memory stay as 000‘s…???
If someone has time, and patience with so, may have a look at my code, I added partly.
I can not find the reason for the wrong Numbers, but would be interested to understand.
Heinz
Code:
StDPin con p11 'on Pin 15 of MT8870 =high if DTMF-Ton presant
x var byte
Number var nib
Zahlen var nib(8)
flagReady var bit
init:
sound BeepPin ,[200\200] 'returns start Beep
serout s_out,i9600,[" Init = ",dec Number,13]
Prufen = 0 : flagInit = 0 : flagReady = 0
clearIt:
for x = 0 to 8
Zahlen(x) = 0
pause 50
next
Number = 0 : i = 0 : x = 0: modyf = 0
start:
gosub collectNumbers
if Number = 11 then init ‘**start with * (Star) All = 0 FlagInit = 1
if Number = 12 then checkPassword 'DTMF 12 = # = OK
goto start
collectNumbers:
LowLoop:
if in11 = 0 then LowLoop ‘in11 = StD-Pin = 1 ==> DTMF ton presand
pause 50 'wait for Mt8870 ready
Number = INL 'INN0 not to use yet
Zahlen(i) = Number 'collect the Number in array Zahlen
i = i + 1
HighLoop:
if in"eleven" = 1 then HighLoop 'loop till DTMF-Ton is finish
sound BeepPin ,[DOk1\FOk1,dbr\0,DOk2\FOk2] 'returns O.K.Beep
return
In my code:
if in"eleven" = 1 then HighLoop 'loop till DTMF-Ton is finish
If i write
eleven as number
11then there is an web page ERROR at basicmicro.net:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator,
webmaster@forums.basicmicro.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.13 Server at forums.basicmicro.net Port 80