Log in

View Full Version : DT_Analog Module Works Great,But Why?



arniepj
- 1st October 2012, 03:10
I suppose this is a question for Darrel.The DT_Analog module is working great converting the 10 bit analog input on chan 0 of a 18F2550 to 16 bit.To get it to work I had to replace the ADvalue with the hardware register bytes adresh and adresl.Changing ADbits or the defines has no effect,the conversion js always 16 bit.Commenting out either has no effect,it keeps working.If I comment out the gosub GetADC,it stops.If I switch back to using the typical way of reading an analog input,its back to 10 bit.I am using PBP3 and Microcode Studio Plus 5.0.
http://www.darreltaylor.com/DT_Analog/

Darrel Taylor
- 1st October 2012, 20:32
It sounds like you may not have the ADFM bit set for Right Justification.
You do not need to use the ADRESH:L registers.

But I'm just guessing, because what you say you had to do, is not something you need to do.

Post your code and I'll take a closer look.