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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/15/03 21:30
Read: times


 
#60677 - RE: 2 timers
Responding to: ???'s previous message
There is no difference if you use C language or assembly language, you have to use the timers on the chip which need same initialization and interrupts with either language.
I designed 4 tone ambulance siren recently and used 2 timers, one timer interrupt generates the tone, the other timer interrupt changes the reload value of the first timer according to a sine lookup table generated by excell and pasted into the compiler, to modulate the frequency of the tone.
Wail : 600 - 1600 Hz 12 cycles per minute
Yelp : 600 - 1600 Hz 180 cycles per minute
Piercer 600 - 1600Hz 800 cycles per minute
Horn : 1600Hz fixed .
I made four functions Wail, Yelp, Piercer and horn, when you call one function it initializes the timer 1 interrupt according to the frequencies shown above.
It was fun, especially for I used my evaluation board for the first time. No hardware to build and worry about, just start experimenting with the software.
The only problem i had is I hurted my ears experimenting with audio amplifiers and horn speakers.
Mahmood


List of 50 messages in thread
TopicAuthorDate
Use an 8051 to generate a tune            01/01/70 00:00      
   RE: Use an 8051 to generate a tune            01/01/70 00:00      
   Homework?            01/01/70 00:00      
      RE: Homework:NO            01/01/70 00:00      
         RE: Homework:NO            01/01/70 00:00      
         RE: 2 timers            01/01/70 00:00      
         RE: Homework:NO            01/01/70 00:00      
            RE: Homework:NO            01/01/70 00:00      
               RE: K&R            01/01/70 00:00      
         ANSI and Embedded            01/01/70 00:00      
            RE: Project:Yes            01/01/70 00:00      
               RE: Project:Yes            01/01/70 00:00      
               Christmas            01/01/70 00:00      
                  RE: Christmas            01/01/70 00:00      
                     RE: Christmas            01/01/70 00:00      
                     RE: Christmas            01/01/70 00:00      
                        RE: Christmas            01/01/70 00:00      
                           RE: Christmas            01/01/70 00:00      
                              RE: Christmas            01/01/70 00:00      
                                 RE: Christmas            01/01/70 00:00      
                                    Thanks Pat Goat            01/01/70 00:00      
                                       RE: Thanks Pat Goat            01/01/70 00:00      
                                          RE: Thanks Pat Goat            01/01/70 00:00      
                                             RE: Thanks Pat Goat            01/01/70 00:00      
                                       You're welcome            01/01/70 00:00      
                                 RE: Christmas            01/01/70 00:00      
                                    RE: Christmas Presents from Keil            01/01/70 00:00      
                                       RE: Christmas Presents from Keil            01/01/70 00:00      
                                          RE: Christmas Present from Philips            01/01/70 00:00      
                                             RE: Christmas Present from Cygnal            01/01/70 00:00      
                                                RE: Christmas Present from Dallas            01/01/70 00:00      
                                                   RE: Christmas Present from Bencina            01/01/70 00:00      
                                                      RE: Christmas Present from Microchip            01/01/70 00:00      
                                                         RE: Christmas Present from Scenix            01/01/70 00:00      
                                                            RE: Christmas Present from Atmel            01/01/70 00:00      
   Michael            01/01/70 00:00      
      RE: Erik            01/01/70 00:00      
         RE: Erik            01/01/70 00:00      
            RE: Erik            01/01/70 00:00      
               RE: MLP-28            01/01/70 00:00      
               RE: Erik            01/01/70 00:00      
                  RE: Erik            01/01/70 00:00      
                     RE: Rob            01/01/70 00:00      
                     RE: Rob            01/01/70 00:00      
            RE: Erik            01/01/70 00:00      
               RE: Erik            01/01/70 00:00      
                  RE: Erik            01/01/70 00:00      
                     Thanks Michael            01/01/70 00:00      
                        RE: Thanks Michael            01/01/70 00:00      
                           Marry Xmas            01/01/70 00:00      

Back to Subject List