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

why do I need a resistor on B6

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



Joined: 07 May 2004
Posts: 263

View user's profile Send private message

why do I need a resistor on B6
PostPosted: Sun Apr 20, 2008 9:41 pm     Reply with quote

I'm using an 18f2455 but I have seen this on an 18f452 and a 16F877a.
If I don't have a pull resistor (up or Down) on pin B6 then the pic starts and stops erratically. Pulling it one way or the other fixes it. I have port B pullups turned on, but that does not help. I have tried setting it high, low and as an input in the code but it does not help. I'm using 4.07 now but have seen it in the past on 3.x (3.249 maybe).

I now put the resistor there by habit, but I just made a board with the 2455 and left it off and it acts weird, starting and stopping randomly. Adding a resistor fixes it. I just want to know why I need it, and if there is a fuse or something to fix it.
Thanks
Ringo
_________________
Ringo Davis
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Mon Apr 21, 2008 12:45 am     Reply with quote

You've probably got low voltage programming enabled. Did you mean B5 instead of B6? Some (many?) versions of the CCS compiler default to it being on, while hardly anybody uses it and it just causes problems like you've described.

Look for "#fuses lvp" and change it to "#fuses nolvp" and see what happens.
_________________
Andrew
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 5:08 am     Reply with quote

If ICD is enabled at programming time, (#define ICD=TRUE) Pin_B6 lose all other functions and
becomes an input.
It would be good to know a better description of your application, the seen error and the codes
involved regarding the setup of such pin.


Humberto
Ringo42



Joined: 07 May 2004
Posts: 263

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 5:34 am     Reply with quote

It is definitely B6, not B5. I am not using LVP or ICD. Here are my Fuses.
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGE

This is a simple little USb board, I plug it in and it blinks an led on B7 at a rate of about 2.5hz and prints out some stuff. It is basically the code from the USb mouse example that comes with the USB kit. With the resistor on B6 the leds blinks at a steady rate and the printing is nice and smooth. without the resistor the blinking is erratic and the printing stops and starts.

Ringo
_________________
Ringo Davis
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 21, 2008 12:16 pm     Reply with quote

1. Describe the external circuits that connected to pin B6 (other than
the pull-up resistor).

2. Are you using a bootloader ? If so, post the manufacturer, name,
and version of the bootloader. If possible, post a link to the website.

3. Are you doing anything unusual with regard to your development
environment ? In other words, the two most common environments
are the CCS IDE + ICD-U40, or MPLAB + ICD2. Are you doing anything
different ?

4. Are you running this PIC with a debugger ?
Or are you running it as a stand-alone board, with no debugger or
bootloader cable attached to the board ?

5. Post a very short program that shows the problem. Just something
that blinks an LED in a loop. Post the #include, #fuses, and #use delay
statements. It should be compilable. Test it, and verify that it shows
the "pin B6" problem.
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