Hi,
Thanks Alain for the info. I am looking forward to an all digital way. Cypress PSOCs app-note uses a bandpass filter (integrated into the chip itself) In this thread things are being overlooked. So let me clear things up. I think only Ingvar replied with something direct reply related to my thread topic.
1. I am not asking how to generate a sinewave ?
2. Not battling on issues whether to use a Hardware PWM, R-2R or external DAC ?
3. Not trying to use a dedicated DDS chip ?
In a typical DDS system if I am having large phase accumulator registers then by offsetting and incrementing them at different update rate a sinewave with amplitude modulation can be produced. (attached DDS-01.gif)
To do it real fast you possibilly need an ASIC. So lets now talk about the PIC way. To be specific PIC-PBP-ASM way.
A function generator has controls for frequency, amplitude and also modulation. This is where (modulation) things get complicated.
1. How to modulate (AM) the sinewave digitally ?
I planned using the compare-match module for generating upto 16bits of usable PWM (soft ) resolution with minimal software overhead. Now I need to achieve the usable output sinewave to cover upto 20KHz. To keep the quantatization noise low I planned for a 64 point ( for each quadrant /attached 1Q-Sine.gif) lookup table. Now I have always found it impractical to generate a sinewave greater than 1/4 of the sample frequency. For fixed amplitude the lookup table could be computed and stored in an array. But for modulating it with another sine table (or arbitary) from a eeprom or an external AD input I found that I need to calculate the PWM values (sine through an obtained modulation index) on the fly. My weak maths revealed that I cannot (or the 16F PIC @20MHz) handle it cause I do not have enough instruction cycles. I was very hopeful that the Gurus out there would shed some light but this thread did not bring up much. One contributor (no offense) mentioned in a PM that he could do it better than me but remained silent there after. So now you do the MATHS and give me a Yes or No if it can be done on a 16F (no support for hardware multiply). That was the original topic.I hope I type the word digitally correctly so I am not thrown back with answers like using a different PIC to generate the modulating waveform and using traditional analogue modulation techniques. Remember low cost = less BOM = no PGA = !!??!!
I am sorry if I am being rude. (May be my client is also following this thread!!!!!) If cost was not the factor then I would have gone any other way. Anyway I am still looking forward to suggestions from the Pros out there.
Bookmarks