Hello,
When i use ADC in FC6 or FC5 ,every time i face this error on proteus in simulation log (ADC conversion started before 'wait' time has expired following previous conversion or channel change.)
If clock frequency <= 4MHz then simulation log has did not show this message but when crystal value above 4MHz this message appear ,i have checked it on every conversion speed Fosc/2,4,8,16,32 and on FRC in Flowcode ,
I am not 100% sure but i think there is no such issue in Flowcode V4 .
Simulation log attached below,
Plz describe about this issue,
ADC Conversion Problem
Moderator: Benj
- sysprofessional
- Posts: 54
- Joined: Sat Oct 26, 2013 7:16 pm
- Has thanked: 28 times
- Been thanked: 4 times
- Contact:
- 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: ADC Conversion Problem
Hello,
Thanks for letting us know of the problem. Which chip are you using and I will investigate the associated ADC routine.
Thanks for letting us know of the problem. Which chip are you using and I will investigate the associated ADC routine.
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
- sysprofessional
- Posts: 54
- Joined: Sat Oct 26, 2013 7:16 pm
- Has thanked: 28 times
- Been thanked: 4 times
- Contact:
Re: ADC Conversion Problem
Hello Benj,
I am using PIC16f877A,
But that is not matter which chip i m using , you can select any chip in pic Flowcode 5 or v6 ,i have checked it now on 4 different chips 12f675,16f1939 , 18f45k22 and 18f24k22,and face same issue ,
Plz take a look at this issue,
Thanks in advance
Brgds
Tahir
I am using PIC16f877A,
But that is not matter which chip i m using , you can select any chip in pic Flowcode 5 or v6 ,i have checked it now on 4 different chips 12f675,16f1939 , 18f45k22 and 18f24k22,and face same issue ,
Plz take a look at this issue,
Thanks in advance
Brgds
Tahir
- 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: ADC Conversion Problem
Hello Tahir,
What if you increase the acquisition time in the ADC component properties. This sets how long to wait before triggering the sample to be converted. I believe the default is 40us.
What if you increase the acquisition time in the ADC component properties. This sets how long to wait before triggering the sample to be converted. I believe the default is 40us.
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
- sysprofessional
- Posts: 54
- Joined: Sat Oct 26, 2013 7:16 pm
- Has thanked: 28 times
- Been thanked: 4 times
- Contact:
Re: ADC Conversion Problem
Hello Benj,
You're right,default acquisition time is 40 program cycles in ADC properties ,i have already checked that,Increasing it does not matter.
I have a few more tests for this issue, and want to share with you,
There is no such error,If i read a variable(ADC) as, Int, Float and String (but only @ 4MHz clock or below),If clock speed will be more than 4MHz same error appears.
But if the ADC is being read as byte ,then same error appear @ any clock speed,(i mean lower clock speed did not solve this error),
One thing more,
acquisition time did not affect from Flowcode ,but it work from proteus ,that is default 20u,And works something like this:
I programmed a 16f877A chip like this,
Clock 4MHz, program configration words 0x3F3A , ADC ReadAsInt, (and in ADC prperties , acquisition time 40 , Conversion speed FRC),,,,, after compiling it, test on proteus ,that's work fine no errors
But if i change "Adc Minimum Acquisition Time" from proteus (that is in chip properties and advance properties) that was default 20u,
i set it 1u to 21u, these all values working ok,but as soon as this value increase 21u , same error appear there in simulation log.
I am attaching simulation log result here,
Sorry this point was not well defined by me,But You are very capable engineer, so i hope you understood my point.
Best Regards,
Tahir
You're right,default acquisition time is 40 program cycles in ADC properties ,i have already checked that,Increasing it does not matter.
I have a few more tests for this issue, and want to share with you,
There is no such error,If i read a variable(ADC) as, Int, Float and String (but only @ 4MHz clock or below),If clock speed will be more than 4MHz same error appears.
But if the ADC is being read as byte ,then same error appear @ any clock speed,(i mean lower clock speed did not solve this error),
One thing more,
acquisition time did not affect from Flowcode ,but it work from proteus ,that is default 20u,And works something like this:
I programmed a 16f877A chip like this,
Clock 4MHz, program configration words 0x3F3A , ADC ReadAsInt, (and in ADC prperties , acquisition time 40 , Conversion speed FRC),,,,, after compiling it, test on proteus ,that's work fine no errors
But if i change "Adc Minimum Acquisition Time" from proteus (that is in chip properties and advance properties) that was default 20u,
i set it 1u to 21u, these all values working ok,but as soon as this value increase 21u , same error appear there in simulation log.
I am attaching simulation log result here,
Sorry this point was not well defined by me,But You are very capable engineer, so i hope you understood my point.
Best Regards,
Tahir
- Attachments
-
- Simulation Log.jpg
- (798.66 KiB) Downloaded 2145 times
- sysprofessional
- Posts: 54
- Joined: Sat Oct 26, 2013 7:16 pm
- Has thanked: 28 times
- Been thanked: 4 times
- Contact:
-
- Posts: 110
- Joined: Mon Dec 23, 2013 9:34 pm
- Has thanked: 2 times
- Been thanked: 9 times
- Contact:
Re: ADC Conversion Problem
hi
using a pic series 18, I have the same problem, how did you solve it?
thank you
using a pic series 18, I have the same problem, how did you solve it?
thank you
- sysprofessional
- Posts: 54
- Joined: Sat Oct 26, 2013 7:16 pm
- Has thanked: 28 times
- Been thanked: 4 times
- Contact:
Re: ADC Conversion Problem
HI Maxtisc,maxtisc wrote:hi
using a pic series 18, I have the same problem, how did you solve it?
thank you
Not Yet found proper solution, But keep in mind there is no problem in real hardware ,In my practical on real hardware, there are several such applications
that using ADC working perfectly almost previous 2 years,
Simulation in Proteus for 18 series chips ,changing ADC RC clock period (in Proteus advanced property) can solve your issue .