| ??? 02/05/03 05:58 Read: times |
#38295 - RE: About speaker Responding to: ???'s previous message |
You can arrange to have a TIMER2 output pin generate the square wave signal. You would program the timer 2 in the auto reload squarewave output mode. The reload values would control the frequency of the tone to be generated. Then in addition to that program a Timer 0 interrupt to run some slow timer duration counters. These counters could be used to time how long the timer 2 output is kept active. Thus for example a 1/4 second tone burst at 3KHz would be done by starting timer 2 up to output 3KHz square wave. Then timer 0 would be setup to count down a counter to zero that represents a 1/4 second duration of the tone. If timer 0 was running at 1 KHz for example this counter for the 1/4 second burst would have to count from 250 down to zero. At the time the timer 0 value reaches zero the interrupt would then disable the timer 2 output mode thus ending the tone output.
Michael Karas |
| Topic | Author | Date |
| About speaker | 01/01/70 00:00 | |
| RE: About speaker | 01/01/70 00:00 | |
| RE: About speaker | 01/01/70 00:00 | |
| RE: About speaker | 01/01/70 00:00 | |
| RE: About speaker | 01/01/70 00:00 | |
| RE: About speaker | 01/01/70 00:00 | |
RE: About speaker | 01/01/70 00:00 | |
| RE: About speaker | 01/01/70 00:00 | |
| RE: About speaker | 01/01/70 00:00 | |
| RE: ASM sound generation routines | 01/01/70 00:00 | |
| RE: ASM sound generation routines | 01/01/70 00:00 | |
| RE: how not to comment code | 01/01/70 00:00 |



