CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

read_program_eeprom() no longer recognized by CCS 3.190

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
schmobolo
Guest







read_program_eeprom() no longer recognized by CCS 3.190
PostPosted: Mon Apr 19, 2004 3:02 am     Reply with quote

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?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 19, 2004 12:12 pm     Reply with quote

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);
}
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Mon Apr 19, 2004 6:05 pm     Reply with quote

Your problem may be similar to this:
http://www.ccsinfo.com/forum/viewtopic.php?t=18783&highlight=

The last 3 posts on that page might be of some help.
schmobolo
Guest







Read_program_eeprom() trouble with CCS 3.190
PostPosted: Tue Apr 20, 2004 6:39 am     Reply with quote

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;
}
}
}
}
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

18F6621 code
PostPosted: Tue Apr 20, 2004 4:42 pm     Reply with quote

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?
Schmobol



Joined: 01 Mar 2004
Posts: 22
Location: Nice, France

View user's profile Send private message

Read_program_eeprom() trouble with CCS 3.190
PostPosted: Wed Apr 21, 2004 12:46 am     Reply with quote

Thank you for your help. Yes this problem has been reported yesterday. Too bad for a baseline release!
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Wed Apr 21, 2004 1:03 am     Reply with quote

I've already found two other bugs in the baseline release and reported them...
kypec



Joined: 20 Sep 2003
Posts: 54

View user's profile Send private message

One more bug
PostPosted: Wed Apr 21, 2004 5:15 am     Reply with quote

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
prwatCCS



Joined: 10 Dec 2003
Posts: 70
Location: West Sussex, UK

View user's profile Send private message

PostPosted: Wed May 05, 2004 12:13 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group