Page 1 of 1

PIC16F1779 – Help with ADC (CAL) Macro Configuration

Posted: Sun Oct 05, 2025 11:05 pm
by Sasi
Hello,

I'm working on an active project using the PIC16F1779 MCU, and I have a question regarding the ADC peripheral.
I need to monitor the voltage levels on multiple analog inputs sequentially. From what I’ve seen, this task could be handled quite easily using the ADC (CAL) Macro.

However, I’m a bit confused about how to properly configure it. Specifically:
  • In the ENABLE command, what value should I assign to the Conv_Speed parameter if I want the conversion clock to be, for example, Fosc/32?
  • The value of the "T_Charge" parameter must be given in microseconds, while in the Component Properties window this parameter is indicated as "Acq Time" and it seems to share the same list of selectable values as Conv_Speed. What value should I enter here?
I’ve spent an entire afternoon trying to get this component working, but so far without success.

Would anyone be able to share a simple example program or point me in the right direction?

Thanks in advance for your help!
Regards,
Sasi
ADC (CAL) Enable.jpg
ADC (CAL) Enable.jpg (37.55 KiB) Viewed 263 times
ADC (CAL) Properties.jpg
ADC (CAL) Properties.jpg (31.49 KiB) Viewed 263 times

Re: PIC16F1779 – Help with ADC (CAL) Macro Configuration

Posted: Mon Oct 06, 2025 9:46 pm
by BenR
Hello,

If you double click the Acq time and Conv speed properties you can see the value associated for each of the items in the list.

The Vref parameter should be the Vref option and not the Vref+ 102 value you have there.

Re: PIC16F1779 – Help with ADC (CAL) Macro Configuration

Posted: Tue Oct 07, 2025 8:48 am
by Sasi
Hello Ben,
I got the ADC set up :D — thanks a lot for the instructions, really helpful!

If it's okay, I’d like to share a couple of thoughts that came up while working on it:
  • I found the ADC (CAL) component’s WIKI page a bit on the minimal side.
  • In the Properties window, the Acq Time dropdown shows the same values as the Conv Speed, which was a bit confusing.
    In some other ADC components (like the one used for the potentiometer), the acquisition time is set in microseconds instead.
  • Also, the same parameter seems to go by different names — in the Enable command it's T_Charge, in the Properties it's Acq Time, and in the potentiometer macro it’s called Acquisition Cycle.
    If all of these refer to the same thing, maybe it’d make sense to unify the naming a bit to avoid confusion.
Regards,
Sasi

Re: PIC16F1779 – Help with ADC (CAL) Macro Configuration

Posted: Tue Oct 07, 2025 10:40 am
by Sasi
I have one more question. I want to use the Temperature Indicator integrated in the MCU.
I enabled the sensor in the FVR register and set the Channel parameter of the "Enable" command to 61 (this value in the "CHS" field of ADCON0 switches the ADC input to the Temperature Indicator.)
Is this how it should work?
Or is the Channel value limited to the range AN0-AN27?