View previous topic :: View next topic |
Author |
Message |
Georg Prinz
Joined: 07 Jan 2004 Posts: 22 Location: Frankfurt, Germany
|
Migrating 16F876 to 18F2620 |
Posted: Thu Jan 20, 2005 2:28 am |
|
|
Hy Folks,
after successfully working with 16F876 I came to the memory ceiling and have to go for a 18F2620, because it seemed to be more or less pin compatible. Now the probleems started. Perhaps any can help me to overcome it:
I am using PCWH 3.212 and ICD U-40.
The program was working fine on 16F876.
Main program starts:
#pragma list
#device ICD = TRUE
#include "18F2620m.h" (slieghtly modified original header file)
......
Headerfile starts:
#device PIC18F2620
#device *=16
.....
During compilation I get the message. "unknown device type"
After deleting the #device command in the main program and changing the headerfile to:
#device PIC18F2620m.h
#device ICD = TRUE
#device *=16
...
I get the message "cannot change device type this far into code"
Without the debugging #device ICD=TRUE the compilation is finished and during program loading the message comes "your code does not have ICD mode enable; recompile with this mode" .
Confirming this message the compilation is done again and during loading the verification windows pops up showing that the expected code is different from the actual
Any idea?? _________________ dl 2 kp |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Thu Jan 20, 2005 11:02 am |
|
|
I'm not 100% sure on this, but with the 18 series processors, isn't the #device *=16 line not needed?
Maybe try commenting it out and see what happens. |
|
|
Ttelmah Guest
|
|
Posted: Thu Jan 20, 2005 11:26 am |
|
|
As another poster has said, the *=16 declaration is unnecessary. However the problem is that you are confusing #include, and #device. #device specifies a device number, not a file to include. The normal syntax is to _include_ the file for the processor, which has #device as the first statement. You are trying to use a modified header file, as a device type...
Best Wishes |
|
|
Georg Prinz
Joined: 07 Jan 2004 Posts: 22 Location: Frankfurt, Germany
|
#device option |
Posted: Sat Jan 22, 2005 9:57 am |
|
|
Hi,
thanks for replying. Now I found the first bug. The #device ICD = TRUE
was the problem. The preprocessor does not accept blanks between the parameters!!! After correcting to #device ICD=TRUE the program was compiled correctly.
Now the more severe propblem stays still waiting. The compiled program cannot be loaded correctly as the verifying table is showing.
I checked the MCLR voltage during programming, 13V seems to be ok.;
Then I removed the capacitor at MCLR pin - no effect.
Gues??? _________________ dl 2 kp |
|
|
Georg Prinz
Joined: 07 Jan 2004 Posts: 22 Location: Frankfurt, Germany
|
|
Posted: Wed Jan 26, 2005 4:08 am |
|
|
Hi folks,
now the second problem shall be solved. CCS send me an upgrade software V1.35 for the U-40 ICD. This software can be downloaded from the CCS web-page too. (Thanks to CCS for prompt service!).
Furthermore, Microchip is offering an an so called PUM "PIC-Upgrade-Kit" for the PICSTART programmer to program the new PICs like 18F2620. The 18PIC252 can be programmed still by the old version.
Saludos
George _________________ dl 2 kp |
|
|
|