ADC Conversion Problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

ADC Conversion Problem

Post 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,
Attachments
Log.jpg
Log.jpg (243.7 KiB) Viewed 8485 times

User avatar
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

Post by Benj »

Hello,

Thanks for letting us know of the problem. Which chip are you using and I will investigate the associated ADC routine.

User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

Re: ADC Conversion Problem

Post 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

User avatar
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

Post 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.

User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

Re: ADC Conversion Problem

Post 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
Attachments
Simulation Log.jpg
(798.66 KiB) Downloaded 2145 times

User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

Re: ADC Conversion Problem

Post by sysprofessional »

Hello Benj,

If you check the ADC routine, Please tell us
I am waiting ,,

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: ADC Conversion Problem

Post by maxtisc »

hi
using a pic series 18, I have the same problem, how did you solve it?
thank you

User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

Re: ADC Conversion Problem

Post 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 .

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: ADC Conversion Problem

Post by maxtisc »

tanks sysprofessional

Post Reply