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.