[SOLVED] What is the function of ADCON1?(PIC-16f873)

Status
Not open for further replies.

dashkil

Member level 2
Joined
Mar 3, 2012
Messages
45
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,620
i am interfacing lcd with pic-16f873 using mikroc. (8-bit interfacing).

i am very new to pic.

I have read the datasheet of pic-16f873, i am not understanding ADCON1 function mentioned in PORTA section!!!

1)why it should be used? As i am not using A/D in this interfacing.
2)what will be the value of ADCON1 for outputting the control signal RS,RW and EN through RA0, RA1,RA2 pin of PORTA? Also in case of PORTB using as Data line (8-bit) for lcd?
 

ADCON1 is the register that defines which PORTA pins are used for digital input/output and which are used by the A/D module.
As you are only using the port in digital IO mode, set ADCON1 to a value of either 0x06 or 0x07 which makes all the pins digital. The LSB is ignored when 0x06 or 0x07 are used so both values do exactly the same thing.

Brian.
 

As betwixt said, since you'll not use the ADC, set ADCON1 = 7 or ADCON1 = 6 to turn ADCON1 off.

For explanation of ADCON1 for use with ADC, check out:
https://www.edaboard.com/blog/1572/

Hope this helps.
Tahmid.
 
This is a pitfall of using the PIC. I/o functions hidden in unexpected registers.
Spent many a happy hour reading through specs to find hidden functions.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…