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 CCS Technical Support

oscillator doesn't start

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



Joined: 02 Apr 2004
Posts: 13
Location: TURKEY

View user's profile Send private message Send e-mail

oscillator doesn't start
PostPosted: Sat Nov 23, 2013 7:57 am     Reply with quote

Hi everyone. I couldn't start osc of pic16f1826. Maybe there is something i have missed. I will be expecting for your kindly replies.
Thanks in advance.

compiler ver. 5.015
Code:
 
#include <16F1826.H>
#use delay ( internal = 16Mhz)
#fuses INTRC_IO,NOWDT,NOPUT,NOBROWNOUT,PROTECT, NOMCLR

void main(){

   SETUP_ADC(ADC_OFF);
 
    while (1){
      output_B(0x0);
      delay_ms(500);
      output_B(0xff);
      delay_ms(500);
     }
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 24, 2013 12:59 pm     Reply with quote

I don't see anything in your program that would cause it to fail. Normally
we like to put the #use delay() line after the #fuses line, but I checked
the .LST file and it doesn't make any difference.

The compiler configures PortB for digital i/o by default, so that's not a
problem.

You didn't tell us how you know the PIC is not running. Do you have an
LED on an i/o pin ? What pin ? Describe the LED circuit.

Or is this a Proteus project ? In that case it could be a Proteus problem
and there is nothing we can do to fix it. We advise not to use Proteus.
Aycan



Joined: 02 Apr 2004
Posts: 13
Location: TURKEY

View user's profile Send private message Send e-mail

PostPosted: Mon Nov 25, 2013 1:15 pm     Reply with quote

Dear PCM programmer thanks for your reply. Actually i'm trying to do light control with mtouch. So i chose pic16f1826 for this. I use mplab ide v8.92 with pickit2. However mplab doesn't support pic16f1826 for neither program nor debug. But pickit standalone program does. In this case i write hex file to pic16f1826 with no error by pickit2 that compiled in mplab ide. Maybe the problem point is this. But i do not have any evidence. Afterall i ordered pickit3 new one. I hope this will solve the problem. I still work on for this. My best regards.
Ttelmah



Joined: 11 Mar 2010
Posts: 19551

View user's profile Send private message

PostPosted: Mon Nov 25, 2013 2:43 pm     Reply with quote

Try two simple experiments:
1) Try compiling direct, just using CCS.
2) Make sure your programmer is set to program the configuration as well as the code.

I'd suspect either the code is not being correctly compiled, or the fuses are not being programmed.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Nov 25, 2013 2:57 pm     Reply with quote

also...
if using MPLAB be sure 'build configuration' is set to 'release' NOT debug !

cheers
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19551

View user's profile Send private message

PostPosted: Tue Nov 26, 2013 1:44 am     Reply with quote

Yes.
I must admit I thought "shouldn't stop the oscillator", but then realised if ICDCLK/ICDDAT pins are not pulled to the disabled state, the chip won't start at all....

Best Wishes
Aycan



Joined: 02 Apr 2004
Posts: 13
Location: TURKEY

View user's profile Send private message Send e-mail

PostPosted: Tue Nov 26, 2013 5:51 am     Reply with quote

Dear Ttelmah and temtronic you are right about ICD pins. I select release option in mplab and wrote program by pickit2. It works fine now. So thanks to everyone who spent time for me. Have a nice days to all of you.
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Nov 26, 2013 8:24 am     Reply with quote

comment:

With recent versions of MPLAB ( >8v62) you should be able to set 'release' as the default build configuration.
If you have an older version, there is a 'patch' you can do.Microchip sent it to me and it works.

This way you won't have 'problems' in the future.

cheers
jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 26, 2013 11:25 am     Reply with quote

Link to the patch:
http://www.ccsinfo.com/forum/viewtopic.php?t=46818&start=21
This is for MPLAB, not MPLAB-X.
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