Page 1 of 1

Analog resolution?

Posted: Mon Jun 21, 2021 3:35 pm
by alanwms
File converted from an earlier Flowcode is running on V9 with the help from @medelec35 (thank you) The converted file is working for me - A few hickupps, mainly for the analog inputs. I used to have a number in the program looking for <1500. Now that code only works with <500.

I think I have concluded that the FC9 thinks that the pic18f2553 is an 8 bit analog - It's actually 12 bits (4096)

I'm trapping the DC voltage and running an eeprom save routine below a certain value - My sample voltage is developed from the 17VDC power using a potential divider, bringing me to around 4V. When the DC analog is around 2.5V I presume the power is going away, and I run the eeprom save routing which saves all my values for next power up - Works great.

I checked the voltage on the AN input and the routine runs at 2.5V which should equate to around 2000 counts. It thinks that 500 counts is around 2.5V.

I have attached the converted file (FC5 to FC9) - The macro in question is called "AC_Monitor" which saves eeprom values if the analog value is below critical number.

Did you want to take a quick look at that?

Re: Analog resolution?

Posted: Mon Jun 21, 2021 4:59 pm
by BenR
Hello,

Looking at the code it looks like we may have been defaulting to 10-bit ADC mode on that device.

I've pushed an update which hopefully should solve the problem for you.

Re: Analog resolution?

Posted: Tue Jun 22, 2021 12:08 am
by alanwms
Yes - That's it. Works fine now. Thanks Ben.