Yes interesting chip, that'll do nicely for the large current version.
Finally success with the 'current' routine.
I've been completely puzzled by the readings and results so I rewrote the code just to get the adc counts.
The adc count for the current input mirrored the current output of the unit. Great, now just alter the code again and run.
Hmm no joy, it was out again by a long way. So I isolated the code to study the routine, no it was correct. Then I wondered why the routine should be so far out from the count. Logic said it wasn't the count but something else. So I checked the defines. Argh, the ADC osc had been commented out and I had another oscon0 that set it at 8Mhz.
Changed the adc back to internal rc osc and the routine now worked.




Bookmarks