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 support@ccsinfo.com

PIC18F47K40 EEPROM Problems Compiler 5.070

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



Joined: 21 Jul 2014
Posts: 7

View user's profile Send private message

PIC18F47K40 EEPROM Problems Compiler 5.070
PostPosted: Sat Jul 01, 2017 8:56 am     Reply with quote

Code:
#include   <18F47k40.h>   
#use delay(crystal=20000000)
#FUSES NOPPS1WAY
#FUSES NOWDT                   
#FUSES HS                       
#FUSES PROTECT                 
#FUSES BROWNOUT               
#FUSES BORV28                 
#FUSES PUT                   
#FUSES NOSTVREN                 
#FUSES NOLVP                   
#FUSES NOWRTD                   
#FUSES MCLR                     

void main(void){
    #rom  int8 0xF310000={1} //eeprom(0) = 1
   
    if(read_eeprom(0) == 1)output_high(pin_b3);
    else output_low(pin_b3);
    while(1);
}

Running pin_b3 always low.
eeprom 0 is 0xFF
please help!
thanks in advance
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 01, 2017 9:57 am     Reply with quote

That's not the eeprom address. Let the compiler get the address for you.
Example:
Code:
#rom int8 getenv("EEPROM_ADDRESS") = {1}
adilsongutierres_



Joined: 21 Jul 2014
Posts: 7

View user's profile Send private message

PIC18F47K40 EEPROM Problems Compiler 5.070
PostPosted: Sat Jul 01, 2017 10:08 am     Reply with quote

Thank you very much.
It worked!
problem solved!
rohit



Joined: 15 Oct 2017
Posts: 1

View user's profile Send private message

Could you please post the header file of the 18f47k40
PostPosted: Sun Oct 29, 2017 2:07 am     Reply with quote

I got this microcontroller recently, and I realised that I don't have headerfile for this uc. So it would be great if any one shares this.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Oct 29, 2017 5:37 am     Reply with quote

We cannot share header files, besides you NEED a newer compiler version.
Even if you got the header file it won't work.
Contact CCS and upgrade your compiler.

One alternative is to use an older PIC, one the compiler knows.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Sun Oct 29, 2017 12:08 pm     Reply with quote

Just worth explaining here.
There is nothing in the header file you can't type yourself. However the header file does not add support for a chip. This is in the device database that is part of the compiler.
It is technically possible to add a chip using the device editor, but it means you have to correctly locate every peripheral, and feature using this, setup all the fuses, memory locations etc.. Without this (or much simpler a compiler update), then header file will do nothing.....
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