Problems with ADC read out PIC16F18313
Moderator: Benj
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Problems with ADC read out PIC16F18313
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.
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?
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.
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?
- Attachments
-
- adc_test.fcfx
- (9.75 KiB) Downloaded 203 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problems with ADC read out PIC16F18313
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problems with ADC read out PIC16F18313
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).
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).
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problems with ADC read out PIC16F18313
Ok thanks. I'll take a look at the ADC code for the device and make sure this is correct.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problems with ADC read out PIC16F18313
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problems with ADC read out PIC16F18313
Thanks a lot, but i dont works.
Maybe the problem is that you have change the files for 16F15313 and I use the 16F18313 ?
Maybe the problem is that you have change the files for 16F15313 and I use the 16F18313 ?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problems with ADC read out PIC16F18313
Aha, yes indeed that would explain it well spotted.
Attachment removed!
Attachment removed!
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problems with ADC read out PIC16F18313
This fix is now all available via the v8 update system.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problems with ADC read out PIC16F18313
Is there a way to perform a manual update? Unfortunately, I currently find no updates, I think it's up to our firewall
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problems with ADC read out PIC16F18313
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problems with ADC read out PIC16F18313
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 ?
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 ?
- Attachments
-
- adc_test.fcfx
- (10.87 KiB) Downloaded 183 times