PIC16F1779 – Help with ADC (CAL) Macro Configuration

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Sasi
Posts: 134
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 43 times
Been thanked: 15 times

Flowcode v10 PIC16F1779 – Help with ADC (CAL) Macro Configuration

Post 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 256 times
ADC (CAL) Properties.jpg
ADC (CAL) Properties.jpg (31.49 KiB) Viewed 256 times

BenR
Matrix Staff
Posts: 1978
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 519 times
Been thanked: 707 times

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

Post 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.

Sasi
Posts: 134
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 43 times
Been thanked: 15 times

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

Post 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
Last edited by Sasi on Thu Oct 09, 2025 10:12 am, edited 1 time in total.

Sasi
Posts: 134
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 43 times
Been thanked: 15 times

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

Post 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?

Post Reply