Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Port H as input in PIC18f87j11

Status
Not open for further replies.

DatsAbk

Member level 3
Joined
Jun 22, 2012
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,704
Hello,
I've been trying to use PORTH as input in PIC18f87j11 but unable to use it.
I successfully used PH0-PH3 pins of port as input but unable to use the entire port. Need an urgent help on it. M ready to pay for it even if the task is done . An immediate money transfer on receiving a solution for it.

Here's my code:
Code:
void main()
{
    TRISH=0XFF;
    TRISD=0X00;
    PORTD=0X00;
    ANCON1=0XFF;
    PMCONH=0;
    ADCON0=0;
    
    CCP1CON=0;
    CCP2CON=0;
    CCP3CON=0;
            
    while(1)
    {
        PORTD=PORTH;
    }
}
 

I haven't used that device but have a read of page 151 of the manual. There is also some code on that page for initialising portH. It seems that the ANCON1 register needs some care when changing it - see note 2 under table 10-19. So, your write to ANCON1 might be ineffective. You need to set WDTCON<4> first.

Keith.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top