16F877 ADC reading annomaly - Page 2

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

I use CCS, and I believe the default is 8-bits, unless you set it to 10.


--
Scott
Reverse name to reply

Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

I've struck a snag, I've hooked up the PIC and read the code off it to back
it up (using winpic and a basic ICSP programmer) but when I verify it, it
fails. Every time I read the code and try to dump to hex file it appears
different :-( I dont want to attempt to change the code until I know it will
be re-programmable with the original code. Any ideas?



Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

None.  I've never tried reading code of of a microcontroller.

--
Scott
Reverse name to reply

Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

Can you just swap out the chip and leave the original alone??  Is it in a
carrier?

--
Scott
Reverse name to reply

Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

I can, when I can find one, and I think that will be the next step. Things
always work out more complex than you expect dont they.



Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

Complex enough that one should take a step back and ask if its worth
starting from scratch.



--
Scott
Reverse name to reply

Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

Unfortunately I dont have that option, I was seriously tempted to do so at
first but it /looked/ like a simple code change and a quick ICSP download to
get it working. I'm working on a budget for a project that was already in
the mud, im now being driven nuts by it!



Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

Just asa follow-up:

I've rebuilt the code from an old (out of date) copy of the code and fixed
the bugs to make it replicate the code on the chip. I've then programmed it
to a new IC, including a 50us delay after each channel shift - they're
reading perfectly now! I also borrowed an ICD2 programmer which gave me the
same read problems as before with my el-cheapo programmer, turns out the
original author had indeed write-protected his code.

Cheers for everyones help, particularly Scott and starfire.



Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it


Good Job!




--
Scott
Reverse name to reply

Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

That's the way to dog it!  Perseverance pays off!

Way to go...




Re: 16F877 ADC reading annomaly




Quoted text here. Click to load it

Cheers :) Couldn't have done it without you lot! I quite enjoyed it
actually!



Re: 16F877 ADC reading annomaly



Quoted text here. Click to load it

Also keep in mind there are two delays when taking PIC ADC measurement.
An acquisition time and a sample time. Read the spec to make sure you
account for both.



Site Timeline