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

My Port B does not want to work

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



Joined: 05 Feb 2005
Posts: 14

View user's profile Send private message

My Port B does not want to work
PostPosted: Mon Feb 14, 2005 7:40 pm     Reply with quote

For some reason on the PIC18F458, when I set PORT B to output and output 0xFF onto LEDs they all light up except B5,B6,and B7. However all of the pins on PORT B work fine as input.

I think I just thought of something, maybe PORT B5,6,7 need a zero in order to light the LEDs, I will try it out. I have tried writing

pullups_b(true)

however, that only keeps PORTB high, which does me no good. But I have two pics and both of them do the same thing, so I know for sure I am doing something incorrect.

So if anyone could explain the problem that would great. It may also be the reason why I cant my program to interrupt when there is a change on PORT B.

Anyways easy programming...
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Feb 14, 2005 9:24 pm     Reply with quote

Post a small test program. They only need a zero if you are sinking the current. PortB Pullups are for inputs, not outputs.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Feb 15, 2005 2:11 am     Reply with quote

The functionality for many pins of the PIC processors can be configured from a choice of possible functions. Very likely the pins RB5, RB6 and RB7 in your setup are not configured for digital I/O but for another purpose.

RB5:
Is default configured for Low Voltage In-Circuit-Serial-Programming (ICSP). Add NOLVP to your #fuses statement if you want to use this pin for I/O. (and make sure to have removed any LVP option from this same line....)

RB6/RB7:
May be used for an In-Circuit Debugger.
Add NODEBUG to your #fuses statement (and remove any DEBUG option from this same line....)
Also check this option is not activated by a '#device ICD=true' statement in your code.
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