View previous topic :: View next topic |
Author |
Message |
Aycan
Joined: 02 Apr 2004 Posts: 13 Location: TURKEY
|
oscillator doesn't start |
Posted: Sat Nov 23, 2013 7:57 am |
|
|
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
|
|
Posted: Sun Nov 24, 2013 12:59 pm |
|
|
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
|
|
Posted: Mon Nov 25, 2013 1:15 pm |
|
|
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: 19506
|
|
Posted: Mon Nov 25, 2013 2:43 pm |
|
|
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: 9225 Location: Greensville,Ontario
|
|
Posted: Mon Nov 25, 2013 2:57 pm |
|
|
also...
if using MPLAB be sure 'build configuration' is set to 'release' NOT debug !
cheers
jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Tue Nov 26, 2013 1:44 am |
|
|
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
|
|
Posted: Tue Nov 26, 2013 5:51 am |
|
|
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: 9225 Location: Greensville,Ontario
|
|
Posted: Tue Nov 26, 2013 8:24 am |
|
|
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
|
|
|
|