Page 1 of 1
16F18877(AD) chip is faulty!
Posted: Fri Feb 10, 2023 1:16 pm
by niedian
16F18877(AD) in practice, or in proteus,They don't work properly.itdoes not work properly after compilation in V8,V9,V10 Version .
Re: 16F18877(AD) chip is faulty!
Posted: Fri Feb 10, 2023 1:43 pm
by p.erasmus
Hi,
Try to use the help file(wiki) when using components for the AD component you need to enable the ADC on the chip before using it see screen print below

- P2.JPG (49.79 KiB) Viewed 4751 times

- P1.JPG (73.12 KiB) Viewed 4751 times
Try it and let us know how you get along
Re: 16F18877(AD) chip is faulty!
Posted: Sat Feb 11, 2023 1:25 am
by niedian
solved!
Re: 16F18877(AD) chip is faulty!
Posted: Mon Feb 13, 2023 11:11 am
by BenR
Hello,
you need to enable the ADC on the chip before using it
This shouldn't be the case. The Raw enable should already be being called as part of the GetByte routine.
This the code for the GetByte function.

- GetByte.jpg (10.55 KiB) Viewed 4694 times
And the RawEnable for comparison.

- RawEnable.jpg (6.08 KiB) Viewed 4694 times
Niedian, you say solved can you say what did you do to solve the issue? Was it as Peter described?
Re: 16F18877(AD) chip is faulty!
Posted: Mon Feb 13, 2023 11:14 am
by p.erasmus
Hi Ben,
I had now two simple projects that the ADC did not work without calling the RAW enable Macro might be good Idea to check this
Re: 16F18877(AD) chip is faulty!
Posted: Mon Feb 13, 2023 11:17 am
by BenR
Thanks Peter,
Can you check your C code matches the code shown above.
Re: 16F18877(AD) chip is faulty!
Posted: Mon Feb 13, 2023 11:24 am
by p.erasmus
Hi Ben
OK I will check when I am back at the lab
Re: 16F18877(AD) chip is faulty!
Posted: Mon Feb 13, 2023 11:50 am
by p.erasmus
Hi Ben,
Ok I see with the getbyte the ADC gets enabled however in my code I use RawSampleInt and AverageSamples and in the C code functions the ADC is not enabled and I asumed it was the case for getByte as well Sorry I mislead the person with my comments however I was sure I had to use RawEnable
my appoligise
would be interesting if he tell us how hesolved the issue.

- P1.JPG (29.55 KiB) Viewed 4684 times

- P2.JPG (114.96 KiB) Viewed 4684 times
Re: 16F18877(AD) chip is faulty!
Posted: Mon Feb 13, 2023 12:17 pm
by BenR
Hello Peter,
Aha yes for the RawSample you need to enable first

ok that explains things and glad to know it's not a problem.
Interested as to how Niedian solved their issue.
Re: 16F18877(AD) chip is faulty!
Posted: Fri Feb 17, 2023 12:35 pm
by niedian
The same old problem. unsolved