View previous topic :: View next topic |
Author |
Message |
Bill Havins
Joined: 20 Nov 2006 Posts: 14 Location: Texas
|
Problem with Pin B5 on 18F4620 |
Posted: Fri Oct 19, 2012 9:13 am |
|
|
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! |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9172 Location: Greensville,Ontario
|
|
Posted: Fri Oct 19, 2012 10:02 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Bill Havins
Joined: 20 Nov 2006 Posts: 14 Location: Texas
|
|
Posted: Fri Oct 19, 2012 12:13 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|