Search found 6 matches

by loop60
Fri Sep 22, 2017 5:36 am
Forum: 8-Bit PIC
Topic: PIC16F1786 - No Suppport for 12 bit ADC
Replies: 11
Views: 8903

Re: PIC16F1786 - No Suppport for 12 bit ADC

Hi Martin!

Ok. i was living in my one little world of PIC 16F1786

thx
by loop60
Wed Sep 20, 2017 9:42 pm
Forum: 8-Bit PIC
Topic: PIC16F1786 - No Suppport for 12 bit ADC
Replies: 11
Views: 8903

Re: PIC16F1786 - No Suppport for 12 bit ADC

Hi Martin,

i studied the PIC_CAL_ADC myself again and i think the problem is the initialization of the adcon2 register.

After inserting the below line into the FC_CAL_ADC_Enable() procedure, the adc works :D :D - yeah

Code: Select all

ADCON2 = 0xF;	
Thank you for the great support!
by loop60
Mon Sep 18, 2017 8:58 pm
Forum: 8-Bit PIC
Topic: PIC16F1786 - No Suppport for 12 bit ADC
Replies: 11
Views: 8903

Re: PIC16F1786 - No Suppport for 12 bit ADC

Hi Martin,

i've imported the new file but my result looks different to yours.
The maximum integer value i get is still 2066 (instead of 2065)

Im using the standard xc8 compiler in free mode - could it now be a problem with an implicit type cast?

thank you for further research,
Christian
by loop60
Sun Sep 17, 2017 9:29 pm
Forum: 8-Bit PIC
Topic: PIC16F1786 - No Suppport for 12 bit ADC
Replies: 11
Views: 8903

Re: PIC16F1786 - No Suppport for 12 bit ADC

Hi Martin,

thx for your investigations. Now the behavior has slightly changed, but i think it is still not correct.
The maximum integer value i get is 2065. Could this be a kind of overflow while doing the logical shift left?

btw: I've studied your changes in the PIC_CAL_ADC. Is it properly that ...
by loop60
Fri Sep 15, 2017 8:21 am
Forum: 8-Bit PIC
Topic: PIC16F1786 - No Suppport for 12 bit ADC
Replies: 11
Views: 8903

Re: PIC16F1786 - No Suppport for 12 bit ADC

Hi!

Thank you for your reply. After the update of the definition files, the simulation works,.. great :D

But the same code still does not work on the pic16f1786. (i have tried three different chips)
Could this be a problem with the adc result format settings? Which value generates flowcode into ...
by loop60
Tue Sep 05, 2017 3:04 pm
Forum: 8-Bit PIC
Topic: PIC16F1786 - No Suppport for 12 bit ADC
Replies: 11
Views: 8903

PIC16F1786 - No Suppport for 12 bit ADC

Hi!

I'm want to use the 12 bit ADC on the PIC16F1786, but the ADC-Templates in Flowcode 7 only support 10 bit!?

I tried to bypass the Flowcharts and ... suprise :-) it works

ADCON1 = 0b10010000;
// Alle 8 A Ports auf Input stellen
TRISA = 0b11111111;
// A1 für analogen Input aktivieren ...