Hello,
There are some additional aspects that you may wish to consider. Firstly, the HCS08 range of MCU broadly falls into two different supply voltage ranges, 1.8-3.6 volts, and 2.7-5.5 volts. If you were considering battery operation directly from a single lithium cell, or a pair of alkaline cells, a device having the lower operating range would be the appropriate one.
A further consideration is whether you need to enhance the piezo volume level by driving each side of the piezo tranducer with anti-phase signals, particularly if battery operation down to 1.8 volts is needed. If this is required, select a MCU device that has a minimum of two TPM modules, with at least two channels per TPM. Each transducer will need a separate TPM module, assuming PWM mode is used (the simplest method).
To provide wakeup from stop mode, a further timer, such as MTIM or RTC module would be required.
I would expect that a device having a 16-pin package option would be utilized.
A MC9S08QE8 device would seem to meet these criteria, if they are required. Otherwise, the choice is more open.
Regards,
Mac
Thanks for your considerations.
I would love to use batteries for my project, but I don't think this is possible because of the resulting "short" operation time. It would be acceptable if it could be powered over a couple of month.
So if using the higher voltage the volume of the piezos shouldn't be a problem.
Any small RS08 or HCS08 should do the trick. Basically you only need a PWM and an AD-converter. To get "AWU" I believe you must pick a chip with an on-chip analog comparator. S08QA or S08QB families seem ideal. The former comes in SOIC8 and the latter in TSSOP16. (Im guessting you'd rather avoid high pin count QFN/QFP)
Hi Lundin,
yes you are right i'd like avoiding a high pin count, but why is only one PWM enought? If i want to generate two output different frequencies at the same time don't i need two of these?
Hello,
To further elaborate, if you use PWM mode to generate the piezo signals, you will need a separate TPM module for each piezo. This is because the TPMMOD setting needs to be adjusted to provide the required output frequency. The advantage of this method is that, once the PWM output is set up, no further intervention in firmware is required until you need to stop the tone.
An alternative method, that would require only a single TPM module for the two piezos, is to use output compare mode for each of the two channel outputs. However, this method would require interrupt processing at each half-cycle of each output. For example, if the maximum piezo frequency were say 4kHz, this would result in an interrupt every 125 us. With two piezos to contend with, the execution time for each ISR must therefore never exceed 60 us.
Regards,
Mac
Ok thanks bigmac. I will try to find an acceptable MCU or maybe i stick to my HC08.
Regards
F.Wolf