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.

[PIC] Store continuous string of data in EEPROM of pic16f887

Status
Not open for further replies.

arpitthumar

Junior Member level 1
Joined
Apr 5, 2017
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
113
I am new in this field.
I want to store continuous integer data which is send from pc by rs232 to EEPROM of pic16f887 and then after storing enough data which EEPROM can store i want to read it again.I don't have any code and circuit. I just want to do this. Plz help me if you have a code.
 

Hi,

You need to divide the task in smaller tasks. Like:
* hardware
* UART protocol
* UART communication code
* EEPROM access code
* others.....

Then divide each of these tasks in smaller tasks and try to solvd them.

Klaus
 
I did some part but i am not getting how can i store and read continuous string of integer in the EEPROM of 16f887? and can i store more than 256bytes of data in this?
 

don't forget also that an eeprom can store data for a limited write time, around 100000 writes generally.
if what you plan to write on it is more than that, your device will not work soon.
 
Can i write integer value by making them in to string like ex."12345" and the store and read this data?
If i can then plz help me in making code.I have already check all examples which can store and read data from microe examples even from other site also.
 

Hi,

and can i store more than 256bytes of data in this
I don't know how many bytes of EEPROM is available in PIC16F887, but usually this is given on the first page of the datasheet.

Klaus
 

This is what pic16f887 is all about. It has only 256bytes of memory that's why i am asking that can i strore data other memory like flash memory and then read it when i want to.Plz gimme answer and help me in code.
 

Attachments

  • PIC16F887.png
    PIC16F887.png
    208.5 KB · Views: 127

Hi,

If datasheet says there are only 256 bytes of EEPROM, then obviously you can´t store more than those 256 bytes in EEPROM.

Klaus
 
Ok then i am going to interface external EEPROM(24c08) for store more data.Now theproblem is how can i store string of integer data which start from ;1,1234,5698,... like this 15 frequency.At the time of retrieve it will be @1,1234,5698 like this i am going to read.How can i store and read this from internal and then external EEPROM.
 

Hi,

what is 1,1234,5698?
Is this one item = 11 bytes of ASCII codes
Or are these 3 items? 3 items you want to read combined, or do you want to read each item individually?

I recommend to read about string storing. There are several standards.
If your string is of fixed length, then you may read only n bytes.
If your string is of individual/unknown length then I recommand to use a delimiter.

If you want to store numbers only, then I recommend to use integer or float data format instead of string.

24C08 has 1024 bytes. We don´t know if this is enough.

Klaus
 

;1,1234,5698,... in this ;1 it means start and store the number in EEPROM then 1234,5689 like these 15 nubers will come that you have to write in EEPROM. Means all these 15 number you have to store in to EEPROM. Then @1,1234,5698,... means at the time of @1 come it means it's read sign you have to read it from the EEPROM one by one comma is going to separate all these 15 serial number i am going to read.How can i store and read these from internal and external EEPROM. Is it ok now?
 

Hi,

I still don´t understand. But more important is that you understand.
I recommend to use a sheet of checkered paper, use 16 bytes in a row, use as many rows as you need. Then write your example strings on the paper. Each character in one box.
Then find out if it is enough space. Test by hand if you find an algorithm to write and read the correct information.

btw. if this is one item (11bytes) and you want to store 15 items, then it´s just 165 bytes. So 256 bytes are well sufficient.

Klaus
 

That i already know. I just want hint about code that how can i store 15 integer string of data contiguous and then read it same.
 

If I understand: ';1' is a command that notifies that 15 digits are to follow.

What we don't know is the format of those 15 digits, are they ASCII so each digit needs one byte to store it (15 bytes per transmission) or are they binary in which the biggest number possible, 999999999999999 can be represented in 9 bytes. They may even be in hexadecimal, we need to know to give good advice.

You main problem will be the read/write time though, unless your data is arriving slowly, there won't be enough time to complete a write cycle before the next digit arrives. Is there a reason why you have to use EEPROM, if you are just using it to store the digits until all 15 have arrived, it makes far more sense to use normal RAM which removes the speed restriction.

Brian.
 
Yes you are right ;1 is one type of command that says that now 15 data will come in a string like ex.12345 this is 1st data then 23568 this is 2nd data like this 15 data will come to gather in string in this (,) comma will separate each other by sensing comma EEPROM has to separate each and store in to contiguous address.

After that @1 is other command that denote that controller has to read stored data which we have stored before.

Like this i have to store 15 string each contain 15 data.
 

Yes you are right ;1 is one type of command that says that now 15 data will come in a string like ex.12345

It is allways a bad practice to define the command with the same characters used on data field.
I would recommend to use some alphabetical characters or symbols for this purpose.
This way you can check at receiver side the integrity of data/command.
 

Ok
Then if you have example for this. Plz send me.
 

Hi,

post#15 more describes the protocol with UART instead the data in the EEPROM.

-->please follow my recommendation of post#2. Avoid mixing several tasks in the discussion, else nobody can follow your ideas.
Start with the first task, then finish it, then start with the next task.


protocol:
"1" as a command is somehow not a very good idea, because it is very likely that in the folowing data contain a "1", too.
Expect that the datastream may start anywhere and break anywhere. Your protocol should be prepared for this.
What happens if there are just 10 items instead of 15?


Klaus
 

It's fix that it has 15 data per string.As per you said i am giving some other command like some alphabet then can you help me in this. Now we will consider only UART to pic16f887 EEPROM.

- - - Updated - - -

Plz help me in this. Actually i am not getting any idea.Help me with code availability.
 

Hi,

My last attempt:

You try to start with code. This is wrong. First you need to decide your specifications.
Follow our recommendations. Answer our questions. Give precise and detailed informations.

Ask dedicated questions. Not global questions like: "Help me with code".

Show what you have done so far.

Don´t be afraid if nobody wants to write code for you. This is not how a forum works.

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top