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

Problem with Pin B5 on 18F4620

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



Joined: 20 Nov 2006
Posts: 14
Location: Texas

View user's profile Send private message

Problem with Pin B5 on 18F4620
PostPosted: Fri Oct 19, 2012 9:13 am     Reply with quote

I appear to be having problems using Pin B5 as an input on an 18F4620. I am using PCWH 4.071 and am periodically polling three Port B pins, RB4, RB5, and RB6 as well as one Port A pin (RA0). The polling routines, using input(PIN_B#) or input(PIN_A0), work fine for pins RB4,RB6, and RA0. Polling pin RB5 does not net a change (from low to high) even when a change in voltage (from 0 volts to 3.5) is confirmed on my oscilloscope.

I did set the NOLVP fuse. I also set the NOPBADEN fuse. Although I am allowing the compiler to set TRIS (using "general" I/O) I have tried manually setting TRIS_B several lines before the polling routines but saw no change in performance.

I am using Brownout Reset but have not found that TRIS_B is reset in a problematic way after a reset (setting TRIS_B manually should have resolved this if such was the problem).

Any thoughts about further reading and/or testing I need to do to educate myself about using this particular pin as an input? I have read every section of the Data Sheet several times trying to ensure I did not overlook something.

Is there a method of testing the pin itself to see if I have damaged it (polling it gets me nowhere, as above)?

Appreciate any thoughts!
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Oct 19, 2012 10:02 am     Reply with quote

Most PICs have several functions on the same pin...

That pin is also used for 2 other functions...KBI1 and PGM so you'll have to ensure that those functions are disabled.
Typically it's a 'fuse' setting so check in the pic18f4620.h file ( the 'header') to see what options you have.

hth
jay
Bill Havins



Joined: 20 Nov 2006
Posts: 14
Location: Texas

View user's profile Send private message

PostPosted: Fri Oct 19, 2012 12:13 pm     Reply with quote

Thanks, Jay. I believe we've covered it all. I'm pretty convinced that either the NOLVP fuse is coded incorrectly (and the pin is not freed to serve as an I/O) or I've blown the pin. Heavy sigh.

I'm going to move the input to a free pin and move on with testing this prototype. I'll come back to the RB5 issue later (or not).

Thanks again! - Bill
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