You need to get into the data sheet for your PIC18F2520. and read how to set the registers. They control whether the ports are analog or digital.
You have ADCON0, ADCON1,ADCON2, ADRESH, ADRESL, CCP REGISTER . . .
THIS IS FROM THE DATA SHEET . . .
Code:
Note: On a Power-on Reset, RB4:RB0 are
configured as analog inputs by default and
read as ‘0’; RB7:RB5 are configured as
digital inputs.
By programming the configuration bit,
PBADEN, RB4:RB0 will alternatively be
configured as digital inputs on POR.
I "THINK" this means PBADEN should be on.
hth
JS
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks