Em 30/08/2015 00:29, Josh Koffman escreveu: > On Fri, Aug 28, 2015 at 11:01 AM, Isaac Marino Bavaresco > wrote: >> I just found that my BAM() routine took more cycles than the time of the >> LSB, so it messed things up. >> >> I was using 'memcpy', that took alone 390 tcy and a loop that took 182 >> cycles. >> After some code changes, the routine works OK. >> >> There was another mistake that made the delay of the previous bit being >> used, instead of the current bit. >> >> Expecting a PIC16F work OK for this application may be wishing too much. > Hi Isaac, > > Thanks for sharing your code! I will need a bit more time to study it, > I think we code rather differently. That said, what do you consider > "A_DECENT_COMPILER"? > > Thanks! > > Josh Hi Josh, A decent compiler is a compiler that produces code that is hard for me to improve it much in assembly. Years ago, I used to program in assembly, like many do still today. As the compilers got better, I felt less need to program in asembly, to the point that to improve the code just a little took too long time. That is not the case of this XC8 crap. It is a longtime since I last designed something with an 8-bit PIC and got a surprise when I saw the results of this "experiment". I hope that for a PIC18 or an enhanced PIC16F the compiler can generate code that is close to the optimum. Cheers, Isaac --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .