Page 1 of 1

Problems with ADC read out PIC16F18313

Posted: Thu Oct 11, 2018 12:15 pm
by CSM2711
Hello,

i got some strange Problems by using the ADC wit the PIC16F18313.
I write these very simple Program and connect the ADC Chanel3 to vdd.
adc.JPG
adc.JPG (27.55 KiB) Viewed 5540 times
I think the value of ADC_WERT should be 255 and the Port A5 should toggle every 100ms.
But the Por will not toggle and when I Debug the Program using MPLABX an PICKIT3 the value of ADC_WERT is 128.

Has anyone an idea?

Re: Problems with ADC read out PIC16F18313

Posted: Thu Oct 11, 2018 12:20 pm
by Benj
Hello,

It might be worth playing with the slider_plastic1 component properties, specifically the conversion speed setting. You are running at 32MHz with a conversion speed of /2 so this is likely far to fast. Maybe try /16 or /32 instead.

As an unrelated side note your delays will be a bit off because you have entered 30MHz as your Project Options -> Clock speed instead of 32000000.

Re: Problems with ADC read out PIC16F18313

Posted: Thu Oct 11, 2018 12:29 pm
by CSM2711
First Thanks for the very very fast replay.
I Try also measure withe FOSC/64 or FOSC/32 but in this case the value ia alway 0
Whe I use FOSC/2 the value is always 128 wit and without vdd on pin3 (AN3).

Re: Problems with ADC read out PIC16F18313

Posted: Thu Oct 11, 2018 12:42 pm
by Benj
Ok thanks. I'll take a look at the ADC code for the device and make sure this is correct.

Re: Problems with ADC read out PIC16F18313

Posted: Thu Oct 11, 2018 1:04 pm
by Benj
Hello,

I think I've found the problem for you. I've modified the CAL code but can't push it to the update system at the moment as I'm away from my desk.

So for now you can do a manual update if you like or you can wait for the update push, probably tomorrow morning.

Attachments removed!

Reload your Flowcode project and change ADC channel from 3 to 4. Fingers crossed everything should now work as expected.

Re: Problems with ADC read out PIC16F18313

Posted: Thu Oct 11, 2018 1:31 pm
by CSM2711
Thanks a lot, but i dont works.
Maybe the problem is that you have change the files for 16F15313 and I use the 16F18313 ?

Re: Problems with ADC read out PIC16F18313

Posted: Thu Oct 11, 2018 1:49 pm
by Benj
Aha, yes indeed that would explain it well spotted.

Attachment removed!

Re: Problems with ADC read out PIC16F18313

Posted: Fri Oct 12, 2018 11:49 am
by Benj
This fix is now all available via the v8 update system.

Re: Problems with ADC read out PIC16F18313

Posted: Mon Oct 15, 2018 8:59 am
by CSM2711
Is there a way to perform a manual update? Unfortunately, I currently find no updates, I think it's up to our firewall

Re: Problems with ADC read out PIC16F18313

Posted: Mon Oct 15, 2018 11:04 am
by Benj
Hello,

If you look here and follow the instructions for the full update then hopefully you will get something.
https://www.matrixtsl.com/wiki/index.ph ... _all_files

Otherwise Flowcode only shows you updated relevant to your project, i.e. definitions and components currently in use in your project.

Re: Problems with ADC read out PIC16F18313

Posted: Thu Dec 06, 2018 11:11 am
by CSM2711
Hello,

actually i have again Problems with the ADC , specialy input A4.
I change the Test prgram by adding a Uart for debug.
The Programm will work fine in simulation, but when I make a Hardware setup the ADC value will always be 255.
Has anyone an Idea ?