CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC16F628 Portb Pullups Enable

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
2-Chri



Joined: 23 Mar 2012
Posts: 8

View user's profile Send private message

PIC16F628 Portb Pullups Enable
PostPosted: Sat Apr 28, 2012 4:02 pm     Reply with quote

Hello,
I want to enable the internal pullups resistor but I couldn't enable the resistors. My code is below:
Code:

#include <16F628A.h>
#include <Lcd_16x2_4bit_Operation_2.c>
#fuses HS,MCLR,PUT,NOLVP,NOWDT,NOBROWNOUT,PROTECT,CPD
#use delay(clock=20000000)

#byte PORTA = 0x05
#byte PORTB = 0x06

void main(void)
{
port_b_pullups(TRUE);

delay_ms(100);
set_tris_a(0x2F);
set_tris_b(0xC0);

while (TRUE)
 {
  if(input(PIN_B7) == 1)
    {
     output_high(OUT);
    }
  else
    {
     output_low(OUT);
    }
 }

}
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sun Apr 29, 2012 12:58 pm     Reply with quote

How do you KNOW that pullup is not working?

The code in your post does not compile. ( I get error "Undefined identifier OUT". )

Mike
2-Chri



Joined: 23 Mar 2012
Posts: 8

View user's profile Send private message

PostPosted: Sun Apr 29, 2012 2:41 pm     Reply with quote

FInally works. I disconect the pins PGC and PGC from ICD3 to PIC and works OK! Thanks!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group