Hi all,
I got a problem with the analog pins of dsPIC30F6014A controller. I think it reads the voltage at the ADC pins wrong. I am using Flowcode 9.3 and reading the ADC pins with component macro's GetVoltage.
I checked the voltage directly at the ADC pin of controller with a multimeter and its correct. I used a decision block that lights up a LED if the read voltage is not in the wanted interval, but it lights up the LED even read voltage is in the interval. I do not know if there is an offset on the controller's ADC pins.
It happened with different PCBs with same design and circuits with different designs using same controller. It happened with all cases.
Also there is an interesting situation here, when I used Flowcode 7, it reads the ADC pin closer to the real value.
Thanks.
dsPIC30F6014A - ADC reading problem
-
- Posts: 10
- http://meble-kuchenne.info.pl
- Joined: Thu Sep 01, 2022 7:39 am
- Has thanked: 3 times
- Been thanked: 2 times
-
- Matrix Staff
- Posts: 1780
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 454 times
- Been thanked: 616 times
Re: dsPIC30F6014A - ADC reading problem
Hello,
Please can you attach your project file so we can have a look for you.
Please can you attach your project file so we can have a look for you.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 10
- Joined: Thu Sep 01, 2022 7:39 am
- Has thanked: 3 times
- Been thanked: 2 times
Re: dsPIC30F6014A - ADC reading problem
Sorry for the late reply and thanks for helping,
I attached the mentioned code file.
In attached file;
If I compile the code through the Flowcode 9.3, it turns on the error LEDs (LED situations is in the LEDS macro.) even if there are no problems with voltage on designed PCB.
If I compile the code through the Flowcode 7, it does not turn on the error LED as I expected.
Everything is same with both situations, did not change a single thing in code.
Thanks.
I attached the mentioned code file.
In attached file;
If I compile the code through the Flowcode 9.3, it turns on the error LEDs (LED situations is in the LEDS macro.) even if there are no problems with voltage on designed PCB.
If I compile the code through the Flowcode 7, it does not turn on the error LED as I expected.
Everything is same with both situations, did not change a single thing in code.
Thanks.
- Attachments
-
- flowcode.fcfx
- (74.17 KiB) Downloaded 44 times
-
- Matrix Staff
- Posts: 1780
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 454 times
- Been thanked: 616 times
Re: dsPIC30F6014A - ADC reading problem
Hello,
Many thanks for letting us know. I've put together what I hope will be a fix based on the differences between the v9 and v7 code and hopefully this should help the situation.
I've pushed the changes to the Help -> Library Update system so you should be able to get the latest from there.
Please let us know how you get on.
Many thanks for letting us know. I've put together what I hope will be a fix based on the differences between the v9 and v7 code and hopefully this should help the situation.
I've pushed the changes to the Help -> Library Update system so you should be able to get the latest from there.
Please let us know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 10
- Joined: Thu Sep 01, 2022 7:39 am
- Has thanked: 3 times
- Been thanked: 2 times
Re: dsPIC30F6014A - ADC reading problem
Hello,
Thanks for fast reply.
My computer that I am using for Flowcode does not have access to the internet. Can you attach the updated library file so I can implement it?
Thanks again.
Thanks for fast reply.
My computer that I am using for Flowcode does not have access to the internet. Can you attach the updated library file so I can implement it?
Thanks again.
-
- Matrix Staff
- Posts: 1780
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 454 times
- Been thanked: 616 times
Re: dsPIC30F6014A - ADC reading problem
Hello,
The file is available here and needs to be placed into this directory. Please note it is hidden by default so copy and paste the path into your file explorer address bar.
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\PIC16BIT
The file is available here and needs to be placed into this directory. Please note it is hidden by default so copy and paste the path into your file explorer address bar.
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\PIC16BIT
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 10
- Joined: Thu Sep 01, 2022 7:39 am
- Has thanked: 3 times
- Been thanked: 2 times
Re: dsPIC30F6014A - ADC reading problem
Hello,
I updated the file and tried again. This time it worked smoothly.
But there is another problem here. Code runs slower when the hex file is compiled through Flowcode 9.
I noticed it because of the LEDS macro that runs 4 LEDs by binary counting.
Thanks.
I updated the file and tried again. This time it worked smoothly.
But there is another problem here. Code runs slower when the hex file is compiled through Flowcode 9.
I noticed it because of the LEDS macro that runs 4 LEDs by binary counting.
Thanks.