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.

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

Status
Not open for further replies.

ghead

Member level 2
Joined
Nov 19, 2010
Messages
43
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
2,384
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: 73
Last edited by a moderator:

  • Like
Reactions: ghead

    ghead

    Points: 2
    Helpful Answer Positive Rating
Attached is the fixed project.
 

Attachments

  • PIC16F886 ADC.rar
    48.6 KB · Views: 68
  • Like
Reactions: ghead

    ghead

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top