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

16F18324 EEPROM verification error with programming
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mvanvliet



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

16F18324 EEPROM verification error with programming
PostPosted: Thu Jan 26, 2017 4:28 am     Reply with quote

CCS version: 5.062

I'm getting an verification error on the first 7 addresses with programming the following program:

Code:

#include <16F18324.h>

#FUSES RSTOSC_HFINTRC_PLL,NOWDT
#FUSES NOPUT,NOMCLR,NOPROTECT,NOCPD,BROWNOUT,BORV24                             
#FUSES NOCLKOUT,PUT
#FUSES NOFCMEN
#FUSES NOSTVREN,NODEBUG,NOLVP

/*
#rom 0xF000  = { 52}   
#rom 0xF001  = { 14}   
#rom 0xF002  = {212}
#rom 0xF003  = {102}
#rom 0xF004  = {0x01}
#rom 0xF005  = {0x10}
#rom 0xF006  = {0x11}
*/

#ROM int8 getenv("EEPROM_ADDRESS") = {52,14,212,102,0x01,0x10,0x11}

main()
{
}



Code:

Verification results:

Datastorage:
Adress   Actual   Expected
0000      00        34
0001      00        0E
0002      00        D4
0003      00        66
0004      00        01
0005      00        10
0006      00        11

Configuration Fuse:
      Actual     Expected
1    2977       0907
2    3AEF       2AE0
3    2003       0003
4    0003       0003

Actual         Expected
NOLPBOR    NOLPBOR



If I remove the #rom line the verification error is gone. Does anyone know why do I get this verification error?
Ttelmah



Joined: 11 Mar 2010
Posts: 19494

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 5:30 am     Reply with quote

What programmer?.

The verification error is going to be from your programmer.

Could be something silly, like the write protect fuse is set on the EEPROM, and the programmer is not setup to write the config, so can't turn it off.
Or you could just have a chip with a faulty eeprom.

What happens if you tell the programmer to erase the chip fully, then go into it and manually enter some data into the eeprom, and write this?.
mvanvliet



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 5:45 am     Reply with quote

Programmer is ICD-U64 from CCS.

I've also tried a new processor, but didn't make sense.

If I look in the FUSES in CCSload I have

Program memory NOT write protected = ON
Code protected from read = OFF
Data EEPROM Code protected = OFF

So it seems that the fuses are transformed right from .hex to CCSload.
Ttelmah



Joined: 11 Mar 2010
Posts: 19494

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 6:20 am     Reply with quote

Fractionally missing the point on the fuses.

Your code has these off, but if the chip has the EEPROM protection 'set', and the programmer is not set to turn them off, then you won't be able to write the EEPROM. If you are using CCSload, in the top right corner of the first screen, there is an 'options' box. There needs to be a tick box in the 'config bits' box, and the Data EE box. Without the 'config' one, if the chip was protected, the config won't be written to turn this off.
mvanvliet



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 6:51 am     Reply with quote

In the options box both "Data EE" and "Config bits" are ticked.
Ttelmah



Joined: 11 Mar 2010
Posts: 19494

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 7:16 am     Reply with quote

OK. It certainly ought to write. What software version in CCSLoad?.
I've had a lot of issues with newer chips sometimes needing the software updated, or having to talk to CCS to get the programming right.

If you look at the lst file, the data is being put into the right addresses in the file, so should work.
mvanvliet



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 7:32 am     Reply with quote

CCSload version is 5.032

I see there is version 5.037 available, so I tried this version after updating, but still get verification error.
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 8:46 am     Reply with quote

My experience has been that if your programmer is "old", then using the latest CCS FW for it can cause issues like what you're seeing. Try rolling back the programmer's FW to an earlier version and see if the problem goes away.

I've found that new FW revs aren't necessarily 100% backward compatible with early hardware revs.
samjith



Joined: 24 Aug 2016
Posts: 6

View user's profile Send private message

Similar issue with PIC18F4620
PostPosted: Thu Jan 26, 2017 9:23 am     Reply with quote

Using an example program from CCS (EX_INTEE). The program uses #ROM directive to use the internal EEPROM.

Using CCS LOAD v5.036 and compiler version PCH v5.061

I am getting verification errors for selecting to write Data EE and Config bits.

Address Actual Expected
0000 FF 01
0001 FF 02
0002 FF 03
0003 FF 04

Program:

Code:
#elif defined(__PCH__)
#define EEPROM_START getenv("EEPROM_ADDRESS")
#ROM int EEPROM_START = {1} 
#ROM int EEPROM_START+1 = {2} 
#ROM int EEPROM_START+2 = {3} 
#ROM int EEPROM_START+3 = {4} 

void main() {

   unsigned int8 i, j, address;
     

   do {
      printf("\r\n\nEEPROM:\r\n");              // Display contents of the first 64
      for(i=0; i<=3; ++i) {                     // bytes of the data EEPROM in hex
         for(j=0; j<=15; ++j) {           
            printf( "%2x ", read_eeprom( i*16+j ) );
         }
         printf("\n\r");
      }
      printf("\r\nLocation to change: ");
      address = gethex();
      printf("\r\nNew value: ");
      value = gethex();

      write_eeprom( address, value );

   } while (TRUE);
}

The same program with same versions of compiler, debugger, and CCS LOAD works fine on PIC18F6720.

Also ending up with same problems with PIC18F67K90.
Although there are no verification errors if you try to write the Data EE along with Program memory.
jeremiah



Joined: 20 Jul 2010
Posts: 1344

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 9:54 am     Reply with quote

What are the hardware and firmware revs of your programmer (should be in the Diagnostics tab of CCSLoad)?
mvanvliet



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Jan 26, 2017 10:02 am     Reply with quote

Software: 5.037
Firmware: 3.18
Hardware: Rev3

Tommorrow I will try a different ICD-U64.
samjith



Joined: 24 Aug 2016
Posts: 6

View user's profile Send private message

HW/FW Revisions on ICD
PostPosted: Thu Jan 26, 2017 10:03 am     Reply with quote

Currently I am testing this issue using 2 ICD's: ICD-U64 and the recent one ICD-U80

ICD-U64: FW 2.93 HW Rev1 SW 5.036 - with this version the following things works fine:

1. If you select Data EE and Config bits alone it works fine on PIC18F6720 but fails on PIC18F4620 and PIC18F67K90. Although selecting to write ALL (Program Memory, Data EE, and Config Bits) works fine on all three chips

ICD-U80: (using from different computer): FW 3.19 HW Rev1 SW 5.035 - with this version any code that has #ROM defined fails with verification errors on all three different chips (even after selecting to write Program Memory, Data EE, and Config Bits)..
samjith



Joined: 24 Aug 2016
Posts: 6

View user's profile Send private message

HW/FW Revisions on ICD-U80
PostPosted: Thu Jan 26, 2017 10:53 am     Reply with quote

quick update after updating the versions to most recent.

Using ICD-U80 FW 3.20 HW Rev1 SW 5.037

Now after updating to this version. Data EE verification passes after checking Program Memory in ccsload. But still fails verification when only Data EE and config bits are checked.

Tried by erasing the entire chip and selecting just Data EE and config bits ..still did not work on PIC18F4620 and PIC18F67K90 but works fine on PIC18F6720.
mvanvliet



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Jan 27, 2017 9:56 am     Reply with quote

After trying to program with a different ICD-U64 it was successful (rev3, firmware 3.14). So I tried a new controller and tried to program with my own programmer with hardware rev.3 and firmware 3.18 and it was successful. So very strange.

Need to do some extra testing...
mvanvliet



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Feb 06, 2017 1:55 am     Reply with quote

It is still not working, the previous succes was without the EEPROM so not a solution.

I've emailed CCS support, maybe they know a solution.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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