At 18.12 2012.02.08, you wrote: >Thank you both, Mario and Alan. > >I checked errata for 30f4011 and discovered it has "lots" of "bugs", my >next micro will be a 33F or 33EP (I love 33EP256MU806 specs for a 64 pin >micro). > >It is not possible to do AD conversions at 1 Msps due to bugs, max is 750 >ksps. > >After inspection of assembly output from my C compiler, I discovered it wa= s >setting SAMC and ADCS in ADCON3 register at its maximum values (SAMC=3D111= 11 >"31 Tad" and ADCS=3D111111 "32 Tcy"). That was the reason of its slow spee= d. >Now, lowering this values I speeded it up a lot. I have to check for >integrity of data at that speed, but looks promissing and more acceptable. > >I still have a lot of doubts, but the increase of speed makes me happy and >do not need to dig more into the question by the moment. > >Thanks again. You're welcome. I just stumbled upon another problem, but on a PIC32MX1XX: when I enabled compiler optimizations, the ADC results looked buggy. In the end, as I am using autosampling, I had to put at least a NOP or a DONE=3D0 between the l= ine with SAMP=3D1 and the loop where I check if DONE became 1. I found the "bug= " as I had suspected in the past that this would be necessary, however the documentation didn't specify it was, so I omitted the extra code. Now I know it was due.. it happens very rarely that the loop get skipped as it finds DONE at 1 because of the previous conversion and SAMP=3D1 didn't clea= r it in time (however I am now going to disassemble it do see if it's the compiler that maybe reordered the instructions!), but as it was for a buck SMPS converter loop, it caused some visible (smoky) problems. :D Cheers, Mario --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .