Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/23/01 18:38
Read: times


 
#8539 - RE: 8051 help(akaj)
Mark,

A few (long) comments:

Caveat - I'm not an analog engineer so that is my weak area.

The sound generating systems I've used in the past utilized an analog speaker amplifier output instead of a pulsed buzzer system. When I use buzzers, I buy automatic tone generating ones that merely neeed to be turned on or off.

My impression and not my expert opinion is that the buzzer won't have as good a range of sound as a speaker with amplifier system. You may find examples of these types of circuits scanning the internet as Cory suggested. Most buzzers, at least as I term them, have a narrow frequency range with respect to differences that ears can detect.

The pulse interface to the buzzer might also not produce good results as you try to combine two frequencies.

I'll talk about the method we used at Tandy and let you decide if its of value to your project. I may have written in the past about the DTMF circuit: try the 8052.com search for DTMF to find other such discussions.

As mentioned, our objective was to produce DTMF tones for dialing through the phone system. Due to high product volume for Tandy's RADIO SHACK line, it was very profitable to reduce every penny from a design. Every 10 pennies we pulled out of a design equated to an additional $50,000 in company profits. That meant that we wouldn't spend money of a convenient chip like a DTMF tone generator. Instead we used 4 pins of our microprocessor connected to a resistive ladder (a cheap digital to analog or DAC converter) to create an analog voltage level that my associate, the analog engineer would pickup in his schematic responsibilities and amplyfy and multiply to whereever we directed it.

So, my digital design was trivial for this circuit. The firmware was a little more work. I have written on 8052 about the modem engineer that had tried this previously in our design group and spent months chasing a problem he should have realized. But Motorola had provided him with a BASIC program to generate some tables for generating tones. Today we'd use a spreadsheet instead.

The way the system worked was that the micro code had tables for sine waves of the 8 tones required for DTMF. DTMF works of a column and row selection of two tones that are relatively prime to each other. When you press a key, two tones are generated and produce a sound or signal easily unique to that key matrix combination.

Since I had generated tables for each tone (a more complex topic than naturally assumed) my code would simply do the following.

When a tone was active, a single timer would be set to determine ONLY how often I updated the four pins of my microcontrollers cheap DAC resistive ladder. In RAM I would maintain two pointers, one pointing to the current position in each of the two tones' table. When the timer said to update the output, I'd increment each pointer, adjust if the pointer needed to be reset to the start of its table, grab a value from the table, and sum it to the value likewise extracted from the other table. Note each table had unique table lengths for a very strategic reason that promotes purer tone generation.

The output values to the cheap 4 bit DAC could only be values 0000b through 1111b or sixteen combinations. The timer triggering updates was faster enough that the output wasn't too low frequency or too rough, yet it wasn't too fast that I had to have larger tables and had to load down my microcontrollers runtime. It was the balancing act in deciding the table entries and of course the art of my analog engineer associate's filtering circuit.

I'll have to think of look around as to whether my code encoded the tables of each tone as 3 bit (0-7) values or as 4 bit (0-15) values. While adding two 3 bit values would have generated the 4 bit value required for the output, I think I used two 4 bit values for greater sine wave approximation and then scaled the result back to the 4 bit output by dividing by two (shift right).

I'll write more about the table selection later. It may be that someone else can offer more advice about how to do the pulse - buzzer method, making this only a semi-interesting bit of trivia. :)

I may just post this topic on my 8052 homepage if I get weathered-indoors again this weekend. hehehe

aka j

PS: I hope that was at least interesting for you if not directly useful to your project. :)

List of 4 messages in thread
TopicAuthorDate
8051 help(akaj)            01/01/70 00:00      
RE: 8051 help(akaj)            01/01/70 00:00      
RE: 8051 help(akaj)            01/01/70 00:00      
RE: 8051 help(akaj)            01/01/70 00:00      

Back to Subject List