View previous topic :: View next topic |
Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Mon Nov 10, 2014 1:09 pm |
|
|
Interesting.
I just did a compile, and it still stuck at 512.
Did a 'clean', and a recompile, and it merrily accepted 32768.
Had seen this as a problem around this point on the compiler, with this chip. Don't know what triggers it, but starting 'afresh', it merrily accepts the higher value. |
|
|
Diode
Joined: 27 Jul 2012 Posts: 35
|
|
Posted: Mon Nov 10, 2014 1:20 pm |
|
|
Edit: I need to go to bed.....
The .h file I changed was one of my older program I saved the .h file with a new version number but my program still included the old one.
Well, just reinstalled the compiler. Opened it and it automatically showed my program. Also did a Clean and recompiled it.
This is what I programmed:
Code: | #include <18F2523.h>
//#device ICD=TRUE
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT16 //Watch Dog Timer uses 1:128 Postscale
//#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES INTRC //Internal oscillator
#FUSES PROTECT //Code not protected from reading
#FUSES BROWNOUT //No brownout reset //////////
#FUSES BORV45 //Brownout reset at 2.1V////////
#FUSES NOPUT //No Power Up Timer
#FUSES NOCPD //No EE protection
#FUSES STVREN //Stack full/underflow will not cause reset ////////
#FUSES NODEBUG //Debug mode for use with ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOPBADEN //PORTB pins are configured as digital I/O on RESET
//#FUSES BBSIZ4K //4K words Boot Block size
#FUSES NOWRTC //Configuration registers not write protected
#FUSES NOWRTB //Boot block not write protected
#FUSES NOEBTR //Memory not protected from table reads
#FUSES NOEBTRB //Boot block not protected from table reads
#FUSES NOCPB //No Boot Block code protection
#FUSES LPT1OSC //Timer1 configured for low-power operation
#FUSES NOMCLR //Master Clear pin used for I/O
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#use delay(clock=20000000) |
This is what I see in the LST file:
Code: |
Configuration Fuses:
Word 1: 0200 HS NOFCMEN NOIESO
Word 2: 0E07 NOPUT BROWNOUT BORV45 NOWDT WDT128
Word 3: 0500 CCP2C1 NOPBADEN LPT1OSC NOMCLR
Word 4: 0001 STVREN NOLVP NOXINST DEBUG
Word 5: C000 PROTECT NOCPB NOCPD
Word 6: E00F NOWRT NOWRTC NOWRTB NOWRTD
Word 7: 400F NOEBTR NOEBTRB | |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 10, 2014 2:17 pm |
|
|
Are you sure it compiled ? On my PC, it won't even compile. It says:
Quote: | *** Error 99 "PCH_Test.c" Line 35(5,27): Option invalid Internal Osc Freq Wrong
1 Errors, 0 Warnings.
Build Failed. |
That's because 20 MHz is not a valid option for the internal oscillator.
If it doesn't compile, it will leave the .LST file from the last old successful
compilation. That's what you'll be looking at.
Did your MPLAB output window say it compiled ? (Or is it past bed time...)
What MPLAB version are you using ?
Another thing you could do is to backup the source files first, then delete
the whole project directory, and then make a new project in MPLAB and
start completely fresh. |
|
|
Diode
Joined: 27 Jul 2012 Posts: 35
|
|
Posted: Tue Nov 11, 2014 8:05 am |
|
|
I only use CCS C compiler and as far as I know no MPLAB. Programs are loaded via CCSload.
The problem was that I included file x and made the changes to file y....
So the file which is included never changed. You are right about the wrong declaration, that is solved.
Had a good night rest and started freshly today. Changed the WDT to 32768 and in the LST file it shows 32768 too
So that piece of the puzzle is solved.
So now I can focus on the occasional stall of the program again. Will keep you informed. |
|
|
|