??? 08/17/10 04:42 Read: times |
#178051 - Use a look up table. Responding to: ???'s previous message |
Harshada:
Use a look up table. First off experiment and find the 5 or 6 steps of PWM value that produce the volume steps that you like. Say that in this experiment you find that these PWM values are 0%, 6%, 14%, 18%, 23% and 31%. Next find out the programmable settings for your hardware that produce each of these PWM duty cycles. This may be the reload value of a timer as say a 16-bit value. Next organize these values into a table of 16-bit entries. Think of this table as an array. You will use your desired sound step level (i.e. 0 --> 5) as the index to this array. When setting the sound level pull the value at the indexed position in the table out and move it into the hardware registers that produce the PWM values. Michael Karas |
Topic | Author | Date |
volume control of a buzzer | 01/01/70 00:00 | |
Use a look up table. | 01/01/70 00:00 | |
logarithmic volume perception -> exponential steps? | 01/01/70 00:00 | |
Piezo? | 01/01/70 00:00 | |
Some Good Info | 01/01/70 00:00 | |
More Info | 01/01/70 00:00 | |
thankyou all![]() | 01/01/70 00:00 |