16F877 ADC reading annomaly

I've actually just found (removed paper label instead of relying on documentation) that its an 18F458, which returns 10 bit values (unless I set it to 8 earlier in the code?). I've managed to hook up the hardware now, all I need to do is back up the existing code and write the new code in the morning.

Ta so far!

Reply to
Coyoteboy
Loading thread data ...

"Coyoteboy" wrote in news: snipped-for-privacy@bt.com:

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

--
Scott
Reverse name to reply
Reply to
Scott Seidman

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?

Reply to
Coyoteboy

"Coyoteboy" wrote in news:cp6dnVNWX snipped-for-privacy@bt.com:

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

--
Scott
Reverse name to reply
Reply to
Scott Seidman

Scott Seidman wrote in news:Xns9A1A6AE231D8Escottseidmanmindspri@130.133.1.4:

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

--
Scott
Reverse name to reply
Reply to
Scott Seidman

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.

Reply to
Coyoteboy

"Coyoteboy" wrote in news: snipped-for-privacy@bt.com:

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

--
Scott
Reverse name to reply
Reply to
Scott Seidman

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!

Reply to
Coyoteboy

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.

Reply to
Coyoteboy

"Coyoteboy" wrote in news:c--dnZRFPOJkOB snipped-for-privacy@bt.com:

Good Job!

--
Scott
Reverse name to reply
Reply to
Scott Seidman

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

Way to go...

Reply to
Dave

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

Reply to
Coyoteboy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.