View Full Version : F886 & pgm
MOUNTAIN747
- 8th February 2010, 19:21
I am working with the 16F886 for the first time. My compiler is PBP 2.60. After an hour trying to get the blinky light program to work (never had this problem on any other PIC) I looked for Post’s that may give me a hint as to what I may be doing wrong. I came across a Post on the 16F819 (another internal clock) that said it would not work unless PGM was tied low. I’ve never had this problem with an F819 but it solved the problem on my 886. If I remove the PGM low the PIC stops operating. I tried several 16F866 and all were the same results. This means I loose RB3 as an I/O. I haven’t tried using external oscillator on the F886 because I would like to use all I/O’s on this project. I’ve never seen any comments about this 886 charictoristec on any Post. Is there something I can do to eliminate the need for the PGM to ground?
@ DEVICE INTRC_OSC_NOCLKOUT,MCLR_OFF,BOD_OFF,WDT_OFF
comments will be appreciated!
Bruce
- 8th February 2010, 22:08
Add LVP_OFF to your config settings.
MOUNTAIN747
- 8th February 2010, 23:34
Thanks for your reply Bruce.
No dice! I thought that would do it also. Once I pull the ground wire off RB3 the LED continues to blink for about five seconds then stops.
There is also another strange thing going on. PORTA.6&7 when in digital output state drivers only 2.4V unloaded then drops to 1.3 & 1.9 respectfully under LED load. I’ve turned off everything I can think of that deals with OCS1&2.
@ DEVICE INTRC_OSC_NOCLKOUT,MCLR_OFF,BOD_OFF,WDT_OFF,LVP_OF F
OSCCON=$70
ANSEL=$00
ADCON0=$00
mackrackit
- 8th February 2010, 23:44
This is for MPASM..
@ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
Notice the E on MCLR E
Bruce
- 9th February 2010, 01:15
If only RB3 causes your problem, then I suspect you're simply not getting LVP turned off.
It would really help if you posted your code.
Archangel
- 9th February 2010, 02:07
You got analog all to heck on port B, shut off the comparators and don't forget anselh
MOUNTAIN747
- 9th February 2010, 18:56
So here’s the scoop! I’ve tested this on multiple F886 and on multiple programmers with PBP2.60 and PBP2.46.
Bruce your right!
“If only RB3 causes your problem, then I suspect you're simply not getting LVP turned off.”
PBP 2.60/melabs programmer 4.23
@ DEVICE INTRC_OSC_CLKOUT,MCLR_OFF,BOD_OFF,WDT_OFF,LVP_OFF
OSCCON=$70
ANSEL= $00
ADCON0= $00
CM1CON0 =$00
CM2CON0 =$00
Program, Read Code, View – Configuration
Low Voltage Programming --- Enabled
Must tie RB3 to Vss ... Remove Vss on RB3 MCU stops after about 5sec.
Digital output voltage on RA7 low
PBP 2.46/melbas programmer 4.23
Same code
Program, Read Code, View – Configuration
Low Voltage Programming --- Disabled
No Vss needed on RB3 ... Digital output voltage on RA7 correct
Hobbyist was near wits end! Now What?
ScaleRobotics
- 9th February 2010, 19:55
don't forget anselh
I don't see anselh in your settings...
Bruce
- 9th February 2010, 20:17
Hmm. That is an interesting problem.
Try this. Save the file you're compiling in your 2.60 directory with one name, and save
a 2nd copy of the same file in your 2.46 directory with a different name.
Compile the one with 2.60. Open it with your MeLabs programmer software, and click on
the C radio button. You should see a screen with config settings like the one I have
attached.
Now open the file in your 2.46 directory, and repeat. Are config settings the same?
MOUNTAIN747
- 9th February 2010, 20:49
I’ve tried ANSELH=$00 with the same results. In fact BOR was also Enabled along with a few other items. It did set internal osc at 8Mhz with clockout at 2Mhz.
I used the code file on different computers. One with 2.60 and the other with 2.46. And yes I clicked the C radio button to take a look at the Configs.
I think I’ll try reloading 2.60 on the computer to see if there are any changes in results.
Bruce
- 9th February 2010, 21:07
If you're doing this on two different PCs, it may be that you just have different settings for the MeLabs programmer. Make sure you have Options >> Update Configuration From File checked on the 2.60 machine. That sounds like the problem.
You previously programmed it with LVP_ON, and it's not updating config settings.
MOUNTAIN747
- 9th February 2010, 21:21
Bruce,
I've checked both computers. Both computers were set to "Update Configuration from file". 2.46 Config default option was set to LVP_off. 2.60 was set to LVP_on. I changed that setting and recompiled with the same results, LVP is NOT turning off on 2.60.
MOUNTAIN747
- 9th February 2010, 21:30
I got it. I was not saving the new default setting on 2.60. There is still the issue of why the file was not recognized when default setting on the programer was set to "Update Configuration from file". However 2.60 is now turning off LVP as it should, but only because the default LVP was changed.
I learned a lot about PBP defaults and LVP. I also was unaware that I could have a digital out put with an analog input (ANSELH), at least that what I got out of reading the datasheet on ANSELH.
Thank you all for your assistance.
Bruce
- 9th February 2010, 21:42
Here's a really quick/easy way to find out if it's the compiler or a different setting in your
programmer software.
Compile it on your 2.60 machine. Transfer the .HEX file to your 2.46 machine.
Open the .HEX file & program & test the PIC.
MOUNTAIN747
- 9th February 2010, 22:19
Thanks Bruce, I'll give it a try.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.