Page 1 of 1
ADC Conversion Problem
Posted: Tue Jun 09, 2015 6:24 pm
by sysprofessional
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,
Re: ADC Conversion Problem
Posted: Wed Jun 10, 2015 9:52 am
by Benj
Hello,
Thanks for letting us know of the problem. Which chip are you using and I will investigate the associated ADC routine.
Re: ADC Conversion Problem
Posted: Wed Jun 10, 2015 5:39 pm
by sysprofessional
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
Re: ADC Conversion Problem
Posted: Thu Jun 11, 2015 2:19 pm
by Benj
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.
Re: ADC Conversion Problem
Posted: Thu Jun 11, 2015 11:08 pm
by sysprofessional
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
Re: ADC Conversion Problem
Posted: Sun Jun 21, 2015 8:39 pm
by sysprofessional
Hello Benj,
If you check the ADC routine, Please tell us
I am waiting ,,
Re: ADC Conversion Problem
Posted: Sun Aug 09, 2015 8:49 pm
by maxtisc
hi
using a pic series 18, I have the same problem, how did you solve it?
thank you
Re: ADC Conversion Problem
Posted: Mon Aug 10, 2015 10:41 pm
by sysprofessional
maxtisc wrote:hi
using a pic series 18, I have the same problem, how did you solve it?
thank you
HI Maxtisc,
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 .
Re: ADC Conversion Problem
Posted: Tue Aug 11, 2015 8:18 pm
by maxtisc
tanks sysprofessional