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 support@ccsinfo.com

PIN C5 on the PIC18F2550- question?

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



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PIN C5 on the PIC18F2550- question?
PostPosted: Mon Oct 29, 2007 7:38 am     Reply with quote

Hi

I have an LED attached to PIN_C5 on the PIC18F2550. When this LED is attached to PIN_C0 it flashes and works well. I now attach the LED to PIN_C5 and I get no signal out of C5 with the same code running (Except the code has been changed from PIN_C0 to PIN_C5).

Can someone please tell me what I am doing wrong?

Thank you
a.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Mon Oct 29, 2007 8:19 am     Reply with quote

Page 119 of the spec. sheet states:

Quote:
RC5 and RC4 are only available as port pins when the USB module is disabled (UCON<3> = 0).


This should get the port working.

Ronald
Ttelmah
Guest







PostPosted: Mon Oct 29, 2007 8:21 am     Reply with quote

A classic 'read the data sheet' question....
Look at paragraph 10.3.
Read what it says half way down about RC4, and RC5 (normally used for the USB interface), and what they can do, when not used for this...

Best Wishes
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PostPosted: Mon Oct 29, 2007 9:12 am     Reply with quote

Hi

Thank you. I feel a bit embarased for not reading the data sheet. Embarassed

Can you please tell me how to set the 3rd bit of UCON to 0? (UCON<3>=0) and the UCFG<3>=1?
i.e. how do I access the UCON and UCFG variables?

I appreciate all your help.
a.
Ttelmah
Guest







PostPosted: Mon Oct 29, 2007 9:26 am     Reply with quote

You need to look further.
Even when the USB is disabled, these two pins are _input only_.
The chip wakes up with USB disabled.
Te reason you are not getting output, is that the pins don't support it...
You can access any bit using the #bit directive.

Best Wishes
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PostPosted: Mon Oct 29, 2007 9:33 am     Reply with quote

Hi Ttelmah

Thank you for your explanation. Back to the drawing board for me.

All the best
a.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Mon Oct 29, 2007 11:53 am     Reply with quote

I just remembered that I ran into this exact same problem with this same part. I couldn't figure out why C5 would not output a signal until I dug into the spec. sheet and found it was only available as an input. It's buried in there good.

I used an 18F2525 in it's place. See if that one might be a good replacement for your application. It's a close pin-to-pin replacement.

Ronald
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PostPosted: Tue Oct 30, 2007 1:43 am     Reply with quote

Thank you all for your help!

Best Regards
a.
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