Confusion with assembler code for DTMF-encoder

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear community

I recreated a DTMF dialer based on a schematic from this site:http://avtanski.net/projects/phone_dialer/#DATA . In terms of hardware everything works so far. Only: Of course, the tones don't match the numbers of the keypad because I have a different keyboard than the one used in the diagram.

I've tried changing the code several times in order to match the buttons to the tones (code attached). I always changed the hex addresses in "KBD_SCAN_SPEED" at the beginning of the code. Then at the end in "LookupDTMFPins" the order of the binary addresses were changed according to my hex changes.
But I just can't get it done. I'm actually pretty lost. Also because I have no experience with assembler language. I checked whether the input and the output tone match with a app-based DTMF decoder)

Inputs for the correct outputs are very welcome. Thank you!

Attachment(s): 

This topic has a solution.
Last Edited: Sat. Feb 13, 2021 - 04:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We need to see your schematic showing which keys are connected to which pins.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course. I'll adjust the original schematic now and post it in a few minutes

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You know that is PIC code, not AVR code?  Of course, nowadays, they are friendly cousins.  Maybe this project was discussed in some of the many PIC forums as well.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I'm aware of that. I actually only do projects with AVRs. This is an exception. I searched for assembler programming forums, but there wasn't that much. That's why I tried here, since it's a forum not only for AVR.

 

Anyways, I have attached the new schematic which corresponds with my circuit. Thanks for your help in advance guys!

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why didn't change the chip also when you changed the schematic? Just in case you have missed something that needs to be connected with the AVR.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You may also want to have a look at AVR314, it's for an older AVR but it would be a lot easier, or maybe just a simple reassemble of the code, than messing around with Pic code.

 

The AT90S4414 was replaced by the Mega8515 but the code should run pretty much on any AVR.

 

Attachment(s): 

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi John

 

I chose to use this circuit because I had an NTE1690 (DTMF encoder) lying around. I totally agree with you regarding debuging etc. I wish I never stepped into the assembler-world, but I don't wanna change the entire hardware now. The circuit is accurate. I double checked all the wiring and all the tone keys are generating tones. Just not the right ones..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is what I can up with:

K_1		equ	0x00
K_2		equ	0x01
K_3		equ	0x02
K_ENT		equ	0x03
K_4		equ	0x04
K_5		equ	0x05
K_6		equ	0x06
K_DEL		equ	0x07
K_7		equ	0x08
K_8		equ	0x09
K_9		equ	0x0A
K_TKO		equ	0x0B
K_SEQ		equ	0x0C
K_0		equ	0x0D
K_RST		equ	0x0E
K_ABT		equ	0x0F


retlw	b'11101110'		; 1
retlw	b'11101101'		; 2
retlw	b'11101011'		; 3
retlw	b'11111111'		; E
retlw	b'11011110'		; 4
retlw	b'11011101'		; 5
retlw	b'11011011'		; 6
retlw	b'11111111'		; D
retlw	b'10111110'		; 7
retlw	b'10111101'		; 8
retlw	b'10111011'		; 9
retlw	b'11111111'		; T
retlw	b'01111110'		; *
retlw	b'01111101'		; 0
retlw	b'01111011'		; #
retlw	b'11111111'		; A

I think that will work without changing the original routines. Simpler code is possible since your keyboard rows & cols map directly to the row & column signals on the DTMF chip.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much balisong42! I'll give it a try when I wake up. It's 1:00 AM here in Switzerland ;)

 

Greetings to Seattle!

Laurin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It works! Thank you all for your help. Therefore the problem is solved and topic closed.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

laurin123 wrote:
Therefore the problem is solved and topic closed

You do that by marking the solution - see Tip #5 in my signature, below:

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...