Wave
Hello,
I need to produce:
1.) a 40khz sine wave that I can send to an inverter (AC) and then to a coil (Inductor).
I think I can use a transformer to invert to ac, but what command can I use to produce the sine wave with the SXB compiler for my sx28.? Tech support stated that the freqout command could be used. The documentation says it will slow down the sx28. 5 volts output to transformer is ok.
I tried using a 555 timer to produce a wave, but it was erratic on my scope.
Thanks,
Curtis
I need to produce:
1.) a 40khz sine wave that I can send to an inverter (AC) and then to a coil (Inductor).
I think I can use a transformer to invert to ac, but what command can I use to produce the sine wave with the SXB compiler for my sx28.? Tech support stated that the freqout command could be used. The documentation says it will slow down the sx28. 5 volts output to transformer is ok.
I tried using a 555 timer to produce a wave, but it was erratic on my scope.
Thanks,
Curtis
Comments
No micro-controller will output a sine wave from a digital I/O without extra programming and some signal conditioning. I'm sure SX/B would have no problem putting out a 40 kHz square wave, since micro's only output square waves (see previous caveat).
In order to get a sine wave, you'll need to create a lookup table with a sine wave in it, and then output either digital values to a DAC or output PWM which you then filter to convert into a voltage approximating a sine wave. Assuming an 8 bit lookup table, you'll need to run the timer at 10.24 MHz. I would suggest a lower rez lookup table since you won't have any clock cycles left if you try and run the interrupts at 10.24 MHz.
Thanks,
PeterM
I did some looking at Don's magic sinewaves several of years back, and as I recall, the precisions of the edge timings for this to work were rather excruciating. It could be handled by an SX with a fairly stable oscillator running at a good clip, but would not do well with SX/B. Absolute determinism is essential to get the residual distortion to the ideal low limits.
Now I suppose for a power inverter more distortion might be tolerable, but I believe this approach to be not for the faint of heart, and I suspect that judging by Curtis' post that his experience is not in line with the requirement of Don's approach. I think in this case a sine/table lookup method is much more appropriate.
Cheers,
Peter (pjv)