# [PIC]PROTB Pullup issues after changing code from PIC16F876a to PIC16F886

Status
Not open for further replies.

##### Member level 2
Hi, Im currently having a problem of PORTB not seeming to enable internal pull-ups. I have changed the code from PIC16F876a to PIC16F886 and have maybe missed something as I am new to c proramming.
Here is how the pull-ups are set in code (afaik)
Code:
//-- PORTS
output_A(0x00);
output_B(0x00);
output_C(0x00);
set_tris_A(0b11011111);
port_B_pullups(true);
set_tris_B(0b11111111);
set_tris_C(0b00000000);

Also when compiling after changing PIC I get an error with this line setup_adc_ports(RA0_RA1_RA3_ANALOG);
Which I blanked out on a test it everything seemed to work fine with adc so not sure if this line is even necessary??

Ive attached full code but these seem to be the relevant lines above, Also been through datasheets to check port functions arn't conflicting and everything seems fine to me...

Any help much appreciated.

#### Attachments

• PSU.txt
10.3 KB · Views: 3
Last edited by a moderator:

Points: 2

#### milan.rajik

##### Banned
Attached is the fixed project.

#### Attachments

48.6 KB · Views: 5