Posted by Andrew September 24, 2010
Hi,

I have held fire for a couple of days to be absolutely sure, but I seem to have resolved the problem. It was something to do with an inductor I had fitted to the psu.

One again I would like to thank you all for your time and suggestions.

Andrew

--- In p..., "Andrew" wrote:
>
> Hi Virgil,
>
> Thanks for you reply.
>
> R6 is the pull up for MCLR, and I have confirmed that MCLR is being pulled up.
>
> Thanks
>
> Andrew
>
> --- In p..., "Virgil Stamps" wrote:
> >
> > You don't have a pull up on MCLR-
> >
> > Virgil Stamps
> >
> >
> >
> >
> >
> > From: p... [mailto:p...] On Behalf Of
> > Andrew
> > Sent: Monday, September 20, 2010 6:00 AM
> > To: p...
> > Subject: [piclist] Re: Code not running on PIC16F88 when pic kit 3 is
> > disconnected
> >
> >
> >
> >
> >
> > Hi Jon,
> >
> > Thanks for your suggestions.
> >
> > I have posted my schematic at:
> >
> > http://f1.grp.yahoofs.com/v1/oDCXTLojxFogamOWv3Agx20diqAYijFXSEWH1tpwAli0Pw-
> > 0upxs7F_ZilMzWuTnLYEYc_loJ8XSmnNhwHL7P7izdh5ssA/Schematic.bmp
> >
> > for examination.
> >
> > I have measured the voltage to the processor and it is correct. I have
> > fitted a 0.1uF cap as close as possible to the processor, and I have
> > appropriate capacitors fitted each side of the voltage regulator.
> >
> > Does anyone have any further ideas please?
> >
> > Thanks
> >
> > Andrew
> >
> > --- In p... , "Jon"
> > wrote:
> > >
> > > Looking back through your posts and replies, I didn't see any mention of
> > bypass caps on the chip's power pins.
> > >
> > > Do you have a 0.1 uf cap across the chip's power pins near the pins? This
> > is an often overlooked requirement.
> > >
> > > Also, have you verified that the power supply is ok? With the PICkit
> > connected, is it powering the circuit? And again, does the voltage regulator
> > have input and output caps as shown in the data sheet?
> > >
> > >
> > > Some common problems for PIC circuits are identified here:
> > >
> > >
> > http://digital-diy.com/component/content/article/178-commandments-for-using-
> > pics.html
> > >
> > >
> > >
> > > Jon
> > >
>

Posted by Andrew September 21, 2010
Hi Jon,

Thanks for your suggestions.

I have posted my schematic at:

http://f1.grp.yahoofs.com/v1/oDCXTLojxFogamOWv3Agx20diqAYijFXSEWH1tpwAli0Pw-0upxs7F_ZilMzWuTnLYEYc_loJ8XSmnNhwHL7P7izdh5ssA/Schematic.bmp

for examination.

I have measured the voltage to the processor and it is correct. I have fitted a 0.1uF cap as close as possible to the processor, and I have appropriate capacitors fitted each side of the voltage regulator.

Does anyone have any further ideas please?

Thanks

Andrew

--- In p..., "Jon" wrote:
>
> Looking back through your posts and replies, I didn't see any mention of bypass caps on the chip's power pins.
>
> Do you have a 0.1 uf cap across the chip's power pins near the pins? This is an often overlooked requirement.
>
> Also, have you verified that the power supply is ok? With the PICkit connected, is it powering the circuit? And again, does the voltage regulator have input and output caps as shown in the data sheet?
> Some common problems for PIC circuits are identified here:
>
> http://digital-diy.com/component/content/article/178-commandments-for-using-pics.html
>
> Jon
>

Posted by Andrew September 20, 2010
Hi Virgil,

Thanks for you reply.

R6 is the pull up for MCLR, and I have confirmed that MCLR is being pulled up.

Thanks

Andrew

--- In p..., "Virgil Stamps" wrote:
>
> You don't have a pull up on MCLR-
>
> Virgil Stamps
>
>
>
>
>
> From: p... [mailto:p...] On Behalf Of
> Andrew
> Sent: Monday, September 20, 2010 6:00 AM
> To: p...
> Subject: [piclist] Re: Code not running on PIC16F88 when pic kit 3 is
> disconnected
>
>
>
>
>
> Hi Jon,
>
> Thanks for your suggestions.
>
> I have posted my schematic at:
>
> http://f1.grp.yahoofs.com/v1/oDCXTLojxFogamOWv3Agx20diqAYijFXSEWH1tpwAli0Pw-
> 0upxs7F_ZilMzWuTnLYEYc_loJ8XSmnNhwHL7P7izdh5ssA/Schematic.bmp
>
> for examination.
>
> I have measured the voltage to the processor and it is correct. I have
> fitted a 0.1uF cap as close as possible to the processor, and I have
> appropriate capacitors fitted each side of the voltage regulator.
>
> Does anyone have any further ideas please?
>
> Thanks
>
> Andrew
>
> --- In p... , "Jon"
> wrote:
> >
> > Looking back through your posts and replies, I didn't see any mention of
> bypass caps on the chip's power pins.
> >
> > Do you have a 0.1 uf cap across the chip's power pins near the pins? This
> is an often overlooked requirement.
> >
> > Also, have you verified that the power supply is ok? With the PICkit
> connected, is it powering the circuit? And again, does the voltage regulator
> have input and output caps as shown in the data sheet?
> >
> >
> > Some common problems for PIC circuits are identified here:
> >
> >
> http://digital-diy.com/component/content/article/178-commandments-for-using-
> pics.html
> >
> >
> >
> > Jon
>

Posted by Virgil Stamps September 20, 2010
You don't have a pull up on MCLR-

Virgil Stamps

From: p... [mailto:p...] On Behalf Of
Andrew
Sent: Monday, September 20, 2010 6:00 AM
To: p...
Subject: [piclist] Re: Code not running on PIC16F88 when pic kit 3 is
disconnected

Hi Jon,

Thanks for your suggestions.

I have posted my schematic at:

http://f1.grp.yahoofs.com/v1/oDCXTLojxFogamOWv3Agx20diqAYijFXSEWH1tpwAli0Pw-
0upxs7F_ZilMzWuTnLYEYc_loJ8XSmnNhwHL7P7izdh5ssA/Schematic.bmp

for examination.

I have measured the voltage to the processor and it is correct. I have
fitted a 0.1uF cap as close as possible to the processor, and I have
appropriate capacitors fitted each side of the voltage regulator.

Does anyone have any further ideas please?

Thanks

Andrew

--- In p... , "Jon"
wrote:
>
> Looking back through your posts and replies, I didn't see any mention of
bypass caps on the chip's power pins.
>
> Do you have a 0.1 uf cap across the chip's power pins near the pins? This
is an often overlooked requirement.
>
> Also, have you verified that the power supply is ok? With the PICkit
connected, is it powering the circuit? And again, does the voltage regulator
have input and output caps as shown in the data sheet?
> Some common problems for PIC circuits are identified here:
http://digital-diy.com/component/content/article/178-commandments-for-using-
pics.html
>
> Jon
>
Posted by Jon September 19, 2010
Looking back through your posts and replies, I didn't see any mention of bypass caps on the chip's power pins.

Do you have a 0.1 uf cap across the chip's power pins near the pins? This is an often overlooked requirement.

Also, have you verified that the power supply is ok? With the PICkit connected, is it powering the circuit? And again, does the voltage regulator have input and output caps as shown in the data sheet?
Some common problems for PIC circuits are identified here:

http://digital-diy.com/component/content/article/178-commandments-for-using-pics.html

Jon

Posted by Andrew September 18, 2010
Hi,

Thanks for your replies.

It seems my problem has come back.

It looks like I failed to mention that I'm using the CCS C compiler.

I am confident the Watchdog timer is disabled because I have set the NOWDT fuse. I don't seem to be able to change between Debug and Release build. The drop down menu on the toolbar is greyed out and the menu item "Project->Build configurations" says that there are no build configurations.

Does anyone have any further suggestions for things I could try please.

Thanks

Andrew

--- In p..., Isaac Marino Bavaresco wrote:
>
> Em 9/9/2010 08:02, Andrew escreveu:
> >
> >
> > Hi,
> >
> > I have a project where I have a PI16F88 to communicate with a PC via
> > RS232, and control a relay, and read an ADC. When I have the PIC kit 3
> > interface connected to my board and MPLAB is communicating with the
> > PIC my code works fine. As soon as I disconnect the PIC kit 3 from my
> > board, and reset the power the code stops running.
> >
> > I have a 1k resistor pulling MCLR to 5V, and a 0.1uF capacitor from
> > MCLR to Ground.
> >
> > I'm using the internal oscillator at 8MHz. My fuse settings are:
> >
> > #fuses INTRC,NOWDT,PUT,NOPROTECT,NOBROWNOUT,NOLVP,NOCPD,NOWRT,MCLR
> > #device ADC
> > #use delay(clock00000)
> > #use
> > rs232(baud$00,bits=8,parity=N,xmit=PIN_B5,rcv=PIN_B2,stream=PC,UART1)
> >
> > Can someone shed some light on my problem for me please?
> > _________________
> > Kind regards
> >
> > Andrew Ellis
> >
> Did you change in MPLAB the "Build Configuration" to "Release" before
> rebuilding the project? Did you rebuild the project before programming?
> Did you change the PIC KIT 3 from "Debugger" to "Programmer" mode?
> Best regards,
>
> Isaac
>

Posted by Isaac Marino Bavaresco September 10, 2010
Em 9/9/2010 08:02, Andrew escreveu:
>
>
> Hi,
>
> I have a project where I have a PI16F88 to communicate with a PC via
> RS232, and control a relay, and read an ADC. When I have the PIC kit 3
> interface connected to my board and MPLAB is communicating with the
> PIC my code works fine. As soon as I disconnect the PIC kit 3 from my
> board, and reset the power the code stops running.
>
> I have a 1k resistor pulling MCLR to 5V, and a 0.1uF capacitor from
> MCLR to Ground.
>
> I'm using the internal oscillator at 8MHz. My fuse settings are:
>
> #fuses INTRC,NOWDT,PUT,NOPROTECT,NOBROWNOUT,NOLVP,NOCPD,NOWRT,MCLR
> #device ADC
> #use delay(clock00000)
> #use
> rs232(baud$00,bits=8,parity=N,xmit=PIN_B5,rcv=PIN_B2,stream=PC,UART1)
>
> Can someone shed some light on my problem for me please?
> _________________
> Kind regards
>
> Andrew Ellis
>
Did you change in MPLAB the "Build Configuration" to "Release" before
rebuilding the project? Did you rebuild the project before programming?
Did you change the PIC KIT 3 from "Debugger" to "Programmer" mode?
Best regards,

Isaac
Posted by Philippe Habib September 10, 2010
Could it be a watchdog timer that is turned off while connected to the
debugger and then kicking off when you run untethered?
On Sep 9, 2010, at 4:27 AM, Andrew wrote:

> Thanks for you prompt reply Leon.
>
> I have gone to the menu item:
>
> Programmer->Select Programmer->4 PIC kit 3
>
> I then go to:
>
> Programmer-> Erase flash device
>
> Then:
>
> Programmer->Program.
>
> So I'm confident that the code is being loaded into the device.
>
> Is there something else that I'm missing?
>
> Kind regards
>
> Andrew
>
> --- In p..., Leon Heller wrote:
>>
>> On 09/09/2010 12:02, Andrew wrote:
>>> Hi,
>>>
>>> I have a project where I have a PI16F88 to communicate with a PC
>>> via RS232, and control a relay, and read an ADC. When I have the
>>> PIC kit 3 interface connected to my board and MPLAB is
>>> communicating with the PIC my code works fine. As soon as I
>>> disconnect the PIC kit 3 from my board, and reset the power the
>>> code stops running.
>>>
>>> I have a 1k resistor pulling MCLR to 5V, and a 0.1uF capacitor
>>> from MCLR to Ground.
>>>
>>> I'm using the internal oscillator at 8MHz. My fuse settings are:
>>>
>>>
>>> #fuses INTRC,NOWDT,PUT,NOPROTECT,NOBROWNOUT,NOLVP,NOCPD,NOWRT,MCLR
>>> #device ADC
>>> #use delay(clock00000)
>>> #use
>>> rs232
>>> (baud$00,bits=8,parity=N,xmit=PIN_B5,rcv=PIN_B2,stream=PC,UART1)
>>>
>>>
>>> Can someone shed some light on my problem for me please?
>> Are you actually programming the chip, rather than using the
>> debugger?
>>
>> Leon
>> --
>> Leon Heller
>> G1HSM
>>
>
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
Posted by "Jeffrey L. Cooper" September 10, 2010
Andrew:

Nice going on finding the answer. It reminds me that when going from "Debug" to "Release" there are several things one ought to check (and this is likely to be incomplete):
- Device configuration bits/settings.
- Is your reset circuitry correct?
- What states are your I/O pins in as you power up?
- Oscillator setup (as you mentioned).
- MPLAB Main Menu Bar -> Project -> Biuld Configuration -> Debug/Release.

When your project is configured for "Debug", your PICkit or ICD will set some things for you and you can get something up and running quickly. However, when you're ready to put your chip into a project board you obviously have to cross all of your t's and dot all of your i's.

Doublecheck anything I've said!

Best wishes,
Coop, AA1WW

PS: I have to remind myself of a similar set of things when I "clone" a project by creating a new project/workspace and copy code files, etc. into the new project. Device configuration bits, debugger options, etc. need to be checked.

To: p...
From: a...@yahoo.co.uk
Date: Fri, 10 Sep 2010 08:58:22 +0000
Subject: [piclist] Re: Code not running on PIC16F88 when pic kit 3 is disconnected

Hi Leon, and Jeffery,

I found the solution to my problem. I needed to add the following line to my main() function:

setup_oscillator(OSC_8MHZ);

I stumbled across that whilst trying to work out how to disable the analogue functions on some of the pins.

Jeffery I couldn't find the option in the MPLAB to change between debug and release. Does it exist in MPLAB. I have certainly come across that feature in other IDEs for other micro's.

Thanks very much for you time and help.

Andrew

--- In p..., "Jeffrey L. Cooper" wrote:
> Is it possible that you haven't changed to project from "Debug" to "Release". I can't remember if chosing your programmer type implies that you've already changed this setting. I have forgotten this before.
>
> Best Wishes, and keep us posted,
> Coop, AA1WW
> To: p...
> From: leon355@...
> Date: Thu, 9 Sep 2010 12:56:44 +0100
> Subject: Re: [piclist] Re: Code not running on PIC16F88 when pic kit 3 is disconnected
> On 09/09/2010 12:27, Andrew wrote:
> > Thanks for you prompt reply Leon.
> >
> > I have gone to the menu item:
> >
> > Programmer->Select Programmer->4 PIC kit 3
> >
> > I then go to:
> >
> > Programmer-> Erase flash device
> >
> > Then:
> >
> > Programmer->Program.
> >
> > So I'm confident that the code is being loaded into the device.
> >
> > Is there something else that I'm missing?
>
> Have you disabled the analogue functions (if any) on the I/O pins? It's
> done automatically by the debugger, but you need to do it yourself for a
> stand-alone application. People often miss it.
>
> Leon
> --
> Leon Heller
> G1HSM
>
Posted by Andrew September 10, 2010
Hi Leon, and Jeffery,

I found the solution to my problem. I needed to add the following line to my main() function:

setup_oscillator(OSC_8MHZ);

I stumbled across that whilst trying to work out how to disable the analogue functions on some of the pins.

Jeffery I couldn't find the option in the MPLAB to change between debug and release. Does it exist in MPLAB. I have certainly come across that feature in other IDEs for other micro's.

Thanks very much for you time and help.

Andrew

--- In p..., "Jeffrey L. Cooper" wrote:
> Is it possible that you haven't changed to project from "Debug" to "Release". I can't remember if chosing your programmer type implies that you've already changed this setting. I have forgotten this before.
>
> Best Wishes, and keep us posted,
> Coop, AA1WW
>
>
> To: p...
> From: leon355@...
> Date: Thu, 9 Sep 2010 12:56:44 +0100
> Subject: Re: [piclist] Re: Code not running on PIC16F88 when pic kit 3 is disconnected
>
>
> On 09/09/2010 12:27, Andrew wrote:
> > Thanks for you prompt reply Leon.
> >
> > I have gone to the menu item:
> >
> > Programmer->Select Programmer->4 PIC kit 3
> >
> > I then go to:
> >
> > Programmer-> Erase flash device
> >
> > Then:
> >
> > Programmer->Program.
> >
> > So I'm confident that the code is being loaded into the device.
> >
> > Is there something else that I'm missing?
>
> Have you disabled the analogue functions (if any) on the I/O pins? It's
> done automatically by the debugger, but you need to do it yourself for a
> stand-alone application. People often miss it.
>
> Leon
> --
> Leon Heller
> G1HSM
>