View previous topic :: View next topic |
Author |
Message |
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
Odd behavior with 18F25K50.... |
Posted: Tue Feb 03, 2015 1:33 pm |
|
|
Hi All,
I'm attempting to use an 18F25K50 device for the first time, and I'm encountering some odd behavior. I'm starting with a simple test program
to flash an LED, but rather than flash a few times and stop, it flashes indefinitely. Also, if I specify a delay greater than 255 uS, the code just
hangs, and doesn't run at all..... I am using a 20MHz crystal. Compiler is v5.039.
Code: |
#include <18F25K50.h>
#fuses HSM,NOWDT,NOPROTECT,NOLVP,NODEBUG,NOFCMEN,NOPLLEN
#use delay(crystal=20000000)
//-----< General Program Defines >-----
#define Pwr_LED Pin_A4 // Power LED on Temp Module Brd.
//======================================
void main(void)
{
int8 iIndex;
output_low(Pwr_LED);
// Here we blip the Power LED at power-up to show that the interface is working
for ( iIndex = 0 ; iIndex < 4 ; iIndex++ )
{
output_high(PWR_LED);
delay_ms(250);
output_low(PWR_LED);
delay_ms(250);
}
while(1){}
}
|
Thanks,
Jack |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 03, 2015 1:39 pm |
|
|
Quote: | Compiler is v5.039 |
According to their version list, they skipped that version:
http://www.ccsinfo.com/devices.php?page=versioninfo
I suggest you upgrade to vs. 5.040. If your maintenance ran out,
ask CCS Support to upgrade you to a working version. |
|
|
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
|
Posted: Tue Feb 03, 2015 1:57 pm |
|
|
Hi,
Thanks for the suggestion, v5.040 fixed the problem!
I bought a new version of the PCH compiler about a week ago, and v5.039 was what I got. I guess it was a really short-lived version
Jack |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 03, 2015 2:02 pm |
|
|
Keep the downloaded .exe file for PCH vs. 5.040 in a safe place. That
way if you ever need to revert to it, you will have it. For example,
suppose you install vs. 5.041 when it comes out, and it's bad. You can
revert to 5.040 and stay functional. |
|
|
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
|
Posted: Tue Feb 03, 2015 3:11 pm |
|
|
Hi PCM,
That's a good idea, however, there is something about this that I'm clearly missing. I have both the PCM & PCH compilers, yet I only see one 'Ccsc.exe' file in my compiler directory, 'C:\Program Files\PICC'. Is that the 'compiler', or is it some sort of a 'wrapper' program that invokes the correct compiler (PCM or PCH) at compile time? What are the file names of the actual compiler executables, and where are they generally stored? I'm running Windows 7.
Thanks,
Jack |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 03, 2015 3:28 pm |
|
|
Look in the DLL directory within the CCS (PICC) directory. |
|
|
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
|
Posted: Tue Feb 03, 2015 4:18 pm |
|
|
Hi PCM,
Great, got it, thanks!
Jack |
|
|
|