View previous topic :: View next topic |
Author |
Message |
adilsongutierres_
Joined: 21 Jul 2014 Posts: 7
|
PIC18F47K40 EEPROM Problems Compiler 5.070 |
Posted: Sat Jul 01, 2017 8:56 am |
|
|
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
|
|
Posted: Sat Jul 01, 2017 9:57 am |
|
|
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
|
PIC18F47K40 EEPROM Problems Compiler 5.070 |
Posted: Sat Jul 01, 2017 10:08 am |
|
|
Thank you very much.
It worked!
problem solved! |
|
|
rohit
Joined: 15 Oct 2017 Posts: 1
|
Could you please post the header file of the 18f47k40 |
Posted: Sun Oct 29, 2017 2:07 am |
|
|
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: 9243 Location: Greensville,Ontario
|
|
Posted: Sun Oct 29, 2017 5:37 am |
|
|
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: 19539
|
|
Posted: Sun Oct 29, 2017 12:08 pm |
|
|
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..... |
|
|
|