Nicolaas Gerhardus Scheepers of ElectronCraft Says:
First tip to myself and to you all out there that has problems porting code from the 16F84a to the 16F877 or for that matter to any other MCU.
1. RTFDS - This means "Read The ^#$@%^@#$% Data Sheet"
One big difference between the 16F84 and the 16F877 is the peripherals the 16F877 has extra on board. Some of these peripherals like the A/D needs to have some of the ports setup as analog ports. Microchip in their wisdom decided to make some of the ports analog by default and it took me two weeks to actually find this out.
Use the ADCON1 register to setup the D and E ports as analog or digital. You still have to do all the other setup, do not go and throw your other code out the window.
Let me know how this helped you!!!
P.S. I know we are usually lazy to read the datasheet but I think it is worth your while to take a day or two and thoroughly scan the datasheet before digging in.
|file: /Techref/member/NGS-EC-KA7/TipsAndTricks.htm, 2KB, , updated: 2002/10/23 11:27, local time: 2019/1/18 21:23,
|©2019 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://techref.massmind.org/techref/member/NGS-EC-KA7/TipsAndTricks.htm"> member NGS-EC-KA7 TipsAndTricks</A>
|Did you find what you needed?|