Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 4th June 2007, 10:04 AM   (permalink)
Default Portb

Hello everyone. I am going nuts! I have a simple program to run but for some reason, all my PICs (16F877A) are not outputting ANYTHING on RB6 or RB7. Those pins seem to be floating all the time although they are configured as outputs just like the rest of PORTB. It can't be that all my PICs have malfunctioning RB6 and RB7 pins, can it?! Thanks a lot.
__________________
World.......behold........YAN is coming
YAN-1 is offline   Reply With Quote
Old 4th June 2007, 10:34 AM   (permalink)
Default

Try posting your code here! - make sure you use the code tags to maintain it's formatting.

BTW - those pins are used for programming and de-bugging, do you have de-bugging turned ON?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk

Last edited by Nigel Goodwin; 4th June 2007 at 10:39 AM.
Nigel Goodwin is online now   Reply With Quote
Old 4th June 2007, 12:09 PM   (permalink)
Default

Looking at the datasheet, I suspect that you have it set to in-circuit debug mode which grabs RB6 & 7 and stops them being used as normal ports.

Check the configuration word - bit 11 must be set to 1 to disable debug mode.
picasm is offline   Reply With Quote
Old 5th June 2007, 06:40 AM   (permalink)
Default

Hello. Sorry for the late reply.

Well it's a really simple code. I've reduced it now to just blinking PORTB but those 2 bits just refuse to go high. I've never turned the debugging on. I use PIC StartPlus to program and so i manually set the configuration bits from the configuration menu in MPLAB, and it has always worked. What could be the problem now? Thanks a lot.
__________________
World.......behold........YAN is coming
YAN-1 is offline   Reply With Quote
Old 5th June 2007, 07:21 AM   (permalink)
Default

Check bit 11 of the configuration word, as suggested. It must be set.
To disable the debugger you can add the _DEBUG_OFF label to the __CONFIG directive.
eng1 is offline   Reply With Quote
Old 5th June 2007, 08:07 AM   (permalink)
Default

Yes, don't rely on setting the fuses in the programmer, you should ALWAYS set them in the source code!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 5th June 2007, 10:04 AM   (permalink)
Default

Thanks guys. It worked. Turns out that bit 11 of the configuration word is not covered by the configuration menu in MPLAB. So I set the configuration word in the code and it worked. Solved some other problems as well! The weird thing is that I have ALWAYS used the configuration menu of MPLAB when programming and it never gave me any problems until yesterday. Ah well! Thanks again.
__________________
World.......behold........YAN is coming
YAN-1 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Problem with LCD code? spondootre Micro Controllers 15 29th April 2008 09:15 AM
DS1302 with PIC16f877 program RasCreationKing Micro Controllers 28 3rd May 2007 12:03 PM
Validating Code Without PIC burg Micro Controllers 4 22nd April 2007 04:14 PM
Problem with 16f876 and external eeprom (i2c) dibe84 Micro Controllers 3 10th June 2006 08:50 PM
This really shouldn't be this hard :) KMD Micro Controllers 8 23rd May 2005 06:00 PM



All times are GMT. The time now is 11:23 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.