Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

External EEPROM with pic48f4520

Status
Not open for further replies.

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
354
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
4,306
Hello friends,

In home automation project i'm using PIC18F4520 chip.In that for backup,i'm using external EEPROM 24LC512 to store the datas.
It working fine.I wrote 189 in 1st EEPROM's address and 240 in 2nd EEPROM's address.

When I read the data from both address means I can get 189,but I can't get 240 from storage.
My doubts are:
1.Is this possible to write three digit number in EEPROM's address
2.Writing three digit number at an address is same as writing single digit..?
3.Is this affect the total write/read cycle.
4.why I can't get 240 from the EEPROM.
 

Each location in eeprom is 1 byte wide. It can store max value 255. Your 189 and 250 is within the 255 limit range and hence they can be easily stored in the byte space of eeprom. If your value is above 255 then you have to split it into 2 (unsigned int), 3, or 4 (unsigned long) bytes and store it.

What Compiler are you using ?
 

Hi,

but I can't get 240 from storage
What does this mean? Your microcontroller hangs? You don't get a value at all? You get the wrong value?
***

What data format is "189"and "240"?

If you want to store them as binary data, then everything is OK.
The valid range is 0..255 for unsigned values and -128 ...0...+127 for signed values.

But you speak of digits.
* are thes three independent ASCII bytes? Like "1", "9", "8"
* or is it a string? Like three bytes (plus delimiter)?
* maybe they are coded as three BCD values (4 bits each)?

--> Please give detailed information about your data format: at least data format and range.

This surely is a software problem.
--> post your code

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top