Hi,SOUGATA
AN 2086 ...
Hi,SOUGATA
AN 2086 ...
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
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.
Last edited by sougata; - 6th January 2007 at 15:57.
Regards
Sougata
Hi, Sougata ...
You were looking for the cheap way ... a powerful Cy8C29466 ( 32K ) costs here 7 Euros ( 9 US$ ) !!! and the IDE is free ... and no expensive peripheral needed.
That's the reason of my answer.
Q1. How to modulate (AM) the sinewave digitally ?
maybe generating your Analogic output across a full port ( an R-2R ladder ... as simple as this ! ) could solve the problem for a honest 256 steps amplitude resolution ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi Alain,
Using R-2R ladder does reduces software overhead. Fixed amplitude routine takes about the same code for both the PWM and the R-2R in. (8 bits) If a hardware PWM is used then the code overheads are almost the same. Write to PORT or CCPR (Ignoring LSBs). But I wanted to read an ADC or another lookup table within the PWM/R-2R update routine to create AM. I lost on the available cycles there. Then the sampling Freq is just not achievable. Now the most sad part.
In my country (India) 1 USD = 50 INR (Indian Rupees). A PIC16 comes for about 1 USD but a PSOC lands for about $15. My client has a traditional Func-Gen (below average) which costs him less than $18, that too in annual quantities less than 1K. He wanted to give it a digital face lift so that he could better sale his product. He is ready to pay me for the development provided I fit the BOM within $20. I manage to earn my living by PICing and almost always face this constraint.
I could have modified the analogue thing to display the freq./amplitude on a LCD but that was not my intention. (Actually this was the clients basic requirement). I am a 100% self taught and as Steve says there is no problem only learning opportunities.
Regards
Sougata
Hi, Sougata
Did you spent some time here ???
http://www.picbasic.org/forum//showthread.php?t=1601
some ideas to pick up.
Bingo here : http://www.romanblack.com/picsound.htm
Alain
Last edited by Acetronics2; - 7th January 2007 at 10:40.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi,
I have tried using magic sinewaves from don and also tried the 1 bit audio playback from the PIC. They just don't suit my current requirement. I did a speaking greeting card using a PIC, EEPROM and 1 bit audio!!
Regards
Sougata
Hi, Sougata
another idea ...
http://www.compile-it.com/Proton/PIC_WAV_PLAYER.zip
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks