View previous topic :: View next topic |
Author |
Message |
schmobolo Guest
|
read_program_eeprom() no longer recognized by CCS 3.190 |
Posted: Mon Apr 19, 2004 3:02 am |
|
|
I tried CCS version 3.190 and when trying to compile an operational software I get the following error with the read_program_eeprom() built-in function:
Undefined Identifier (error 12). Weird isn't it ?
Has anybody experienced the same or has an explanation? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 19, 2004 12:12 pm |
|
|
Quote: | I get the following error with the read_program_eeprom() built-in
function: Undefined Identifier (error 12). |
The following test program compiles OK with PCM vs. 3.190.
What compiler are you using (PCM, PCH, etc.) and what PIC are
you using ?
#include <16F877.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
//===========================================
main()
{
int16 value;
value = read_program_eeprom(0x1234);
} |
|
![](templates/subSilver/images/spacer.gif) |
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
![](templates/subSilver/images/spacer.gif) |
schmobolo Guest
|
Read_program_eeprom() trouble with CCS 3.190 |
Posted: Tue Apr 20, 2004 6:39 am |
|
|
Hi,
I have tried a bunch of things based on what's posted on http://www.ccsinfo.com/forum/viewtopic.php?t=18783&highlight= but nothing works and it'sn't aproblem with the reg files.
For your information the target is a 18F6621 and the compiler error occures while compiling the following function:
#separate
void page_icon_write(int32 adresse, int x, int y, int1 inversion, int1 efface)
{
int i,j, line_offset, stop_line, start_line, hauteur, largeur, valeur_temporaire_ram;
int valeur_temporaire_icon, masque1, masque2;
largeur= read_program_eeprom(adresse);
hauteur= read_program_eeprom(adresse+1);
start_line= (y-1)/8;
stop_line=(y+hauteur-2)/8;
line_offset= (y-1)%8;
for (j=start_line; j<=stop_line; j++)
{
for (i=(x-1); ((i<(x+largeur-1))&&(i<122)) ;i++)
{
if (line_offset!=0)
{
if (j<stop_line)
{
valeur_temporaire_ram=page_ram[j][i];
valeur_temporaire_icon=read_program_eeprom(adresse+(i-x+3)+((j-start_line)*largeur));
valeur_temporaire_icon<<=line_offset;
masque1=(0xff<<line_offset);
masque2=(0xff>>(8-line_offset));
page_ram[j][i]&=masque2; //reste inchangé
if (inversion) page_ram[j][i] += (valeur_temporaire_icon ^ valeur_temporaire_ram)&masque1;
else page_ram[j][i] += valeur_temporaire_icon&masque1;
if (efface) page_ram[j][i]=0;
valeur_temporaire_ram=page_ram[j+1][i];
valeur_temporaire_icon=read_program_eeprom(adresse+(i-x+3)+((j-start_line)*largeur));
valeur_temporaire_icon>>=(8-line_offset);
masque1=(0xff>>(8-line_offset));
masque2=(0xff<<line_offset);
page_ram[j+1][i]&=masque2;
if (inversion) page_ram[j+1][i] += (valeur_temporaire_icon ^ valeur_temporaire_ram)&masque1;
else page_ram[j+1][i] += valeur_temporaire_icon&masque1;
if (efface) page_ram[j+1][i] =0;
}
}
else
{
valeur_temporaire_ram=page_ram[j][i];
if (inversion) page_ram[j][i] = read_program_eeprom(adresse+(i-x+3)+((j-start_line)*largeur)) ^ valeur_temporaire_ram;
else page_ram[j][i] = read_program_eeprom(adresse+(i-x+3)+((j-start_line)*largeur));
if (efface) page_ram[j][i] =0;
}
}
}
} |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
18F6621 code |
Posted: Tue Apr 20, 2004 4:42 pm |
|
|
I compiled your progam under 3.189 and it compiled fine.
Under 3.190 I experienced the same problem you did.
I gives me 6 Error 12s and one error 51 for the exact same code that compiled with no errors 5 minutes earlier with 3.189.
It looks like we have a bug here!!!
Has it been reported to CCS? |
|
![](templates/subSilver/images/spacer.gif) |
Schmobol
Joined: 01 Mar 2004 Posts: 22 Location: Nice, France
|
Read_program_eeprom() trouble with CCS 3.190 |
Posted: Wed Apr 21, 2004 12:46 am |
|
|
Thank you for your help. Yes this problem has been reported yesterday. Too bad for a baseline release! |
|
![](templates/subSilver/images/spacer.gif) |
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Wed Apr 21, 2004 1:03 am |
|
|
I've already found two other bugs in the baseline release and reported them... |
|
![](templates/subSilver/images/spacer.gif) |
kypec
Joined: 20 Sep 2003 Posts: 54
|
One more bug |
Posted: Wed Apr 21, 2004 5:15 am |
|
|
I only put this here in case somebody else has experienced similar problems I had when switched from PCH 3.180 to PCH 3.190:
Basically it is a copy of my bug report to CCS tech.support.
Code: | #include <18F452.h>
#device *=16 //use 16 bit pointers
int8 a,b,c; //global variables
#rom int8 0x00F00000={0xAA,0xBB,0xCC} //place some test values in EEPROM
void load_rom_to_ram(int16 ram_address,int8 rom_address) {
int8 value;
value=read_eeprom(rom_address); //get value from EEPROM
*ram_address=value; //store value in RAM
}
void main(void) {
load_rom_to_ram(&a,0x00); //a=0xAA which is correct
load_rom_to_ram(&c,0x02); //c=0xCC which is correct
load_rom_to_ram(&b,0x01); //b=0xBB which is correct but c=0x00 which is wrong!!!
while (TRUE);
}
|
The problem is described in the very last call of load_rom_to_ram from main function.
When "int8 value" is to be assigned to an indirectly addressed variable
"*ram_address" there were 2 instructions added (compared to PCH 3.180 which is working fine here)
which cause a malfunction: global variable "c" is cleared when it shouldn't be.
Disassembly listing with my questions:
11: *ram_address=value; //store value in RAM
000020 5008 MOVF 0x8, W, ACCESS
000022 6EE9 MOVWF 0xfe9, ACCESS
000024 C009 MOVFF 0x9, 0xfea
000028 6AEC CLRF 0xfec, ACCESS !!! WHY IS HERE NECESSARY TO CLEAR DESTINATION VIA PREINC0 ???
00002A 52ED MOVF 0xfed, F, ACCESS !!! LOAD PROPER VALUE BACK IN FSR0 (HARMLESS TO OTHER REGS, AT LEAST)
00002C C00B MOVFF 0xb, 0xfef
12: }
As I said already, this issue wasn't there in PCH version 3.180
I have noticed it also in 3.188 |
|
![](templates/subSilver/images/spacer.gif) |
prwatCCS
Joined: 10 Dec 2003 Posts: 67 Location: West Sussex, UK
|
|
Posted: Wed May 05, 2004 12:13 pm |
|
|
I also had a problem with use of read_program_eeprom() when compiling for PIC18F6621.
The solution was a new devices.dat file emailed from CCS tech support.
Sadly the new file did not allow use of read_program_memory() - but this can be fixed by editing the device file and selecting ROM_Access using
Tools/Device Editor for the relevant processor.
regards _________________ Peter Willis
Development Director
Howard Eaton Lighting Ltd UK |
|
![](templates/subSilver/images/spacer.gif) |
|