Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

On board EEPROM program

:: EPE Chat Zone ­:: ­Radio Bygones Message Board :: » EPE Forum Archives 2010 - » Archive through 22 March, 2011 » On board EEPROM program « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

bob9999
Frequent Contributor
Username: bob9999

Post Number: 116
Registered: 08-2007

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 07 March, 2011 - 07:39 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Is it possable to write a block of, (say),12 numbers to the on board EEPROM?
I'm using Mplabs and the 16f886. I can write to one byte of memory at a time only.
I have included my program, claiming nothing for originality. (I've commented out the loop for testing).
While on the subject. Is everything transferred in HEX? I want to log data for further analysis with Excel
and therefore need raw data, eg: time as two bytes: 16 46 representing 0446 PM etc.
My idea would be packed BIN2BCD Is that correct?
This is my first foray into EEPROMs as you will no doubt gather!
Thanks for taking time to look, I hope you can shed some light.

Kind Regards,

RGR

application/octet-streamEEPROM Prog
RX-TX ONBOARD EEPROM-2.ASM (9.9 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

mikehibbett
Frequent Contributor
Username: mikehibbett

Post Number: 1192
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 07 March, 2011 - 11:23 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi Bob,

I'm a little unclear about your questions, but here we go for starters:

1) Is it possable to write a block of, (say),12 numbers to the on board EEPROM?

Yes, one at a time, in a loop.

2) Is everything transferred in HEX

Data in eeprom is stored in bytes, each one of which can hold a value of between 0 and 255. How you use these individual bytes in completely up to you. So if you have a big number that you want to store, say one that can take a value between 0 and 1000, then you have to store it in at least two bytes. You can store it in any format you wish - packed BCD, binary, even text! It depends on how you are generating that data in the first place. My 'Car Computer' from years ago stored everything in BCD simply because I was storing big numbers but did not need the speed or storage efficiency of binary.

At the end of the day, you are deciding how the data is stored in the eeprom, and you are also in control of how it is transferred to the PC. You would simply tie 'both ends' up, and then format it for excel on the PC.

That probably doesn;t help a lot, so feel free to ask more!

Cheers,

Mike
Top of pagePrevious messageNext messageBottom of page Link to this message

atferrari
Frequent Contributor
Username: atferrari

Post Number: 1042
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 07 March, 2011 - 11:43 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

If what you want to do is writing to the EEPROM at running time, you could reread the specific section of the manual. It is all there.

Believe me, it is simple once you grasp the idea.

A word of caution, good practice requires that you check what your wrote to see if it was properly recorded in the EEPROM.
Agustín Tomás - Buenos Aires - Argentina
Top of pagePrevious messageNext messageBottom of page Link to this message

bob9999
Frequent Contributor
Username: bob9999

Post Number: 117
Registered: 08-2007

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 08 March, 2011 - 09:46 am:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Atferrari,
Believe me, I have read most everything there is to know about on board EEPROM. Nowhere does it show a method of writing a BLOCK of data. I've used a loop in my program, it doesn't work.
I do observe "Good practice" I wouldn't otherwise know if the d..n thing was working of not would I!

Mike,
Nice to hear from you again. Too, I have read most of your articles with deep interest. Your style is very "explanative".
You say it is possable to write a block. The fault must be in my loop then. I'll re-check. Perhaps I need a delat somewhere?
Thanks for the explanation of the HEX query. I now understand that large numbers can take 2 bytes. If storing text, is that derived from an Ascii conversion? I have tried doing that but all I get is a higher HEX number. Do I have to read from, (say): m2 dt "Text String ", 0 and read using FSR, (indirect addressing)?
It's all a mystery to me. I'll look-up your Car Computer and see what you did.
In the days of Basic programing I remember using Binary files. Were these a series of 1's and 0's? It must have been very wasteful of space!
I know Excel can manipulate number bases. I was hoping to present a raw comma-delimited file though.
My method is to program the EEPROM, squirt that through the PicKit2 UART Tool into a file on the PC. I can't find a method of producing a comma though.
I know this is all basic stuff to you Mike but I would appreciate your thoughts on this subject. I love coding in assembler and have become quite good,(or so I thought until this stumbling block).
Trawling the internet Tutorials, and indeed the EPE Teach-in series, doesn't produce a solution either.
Maybe you could produce an article on the above questions. I'm sure it would be of help to many programers.

I had an email from 'mee' on this subject. Who are you and why didn't your message appear above?

Kind regards

RGR
Top of pagePrevious messageNext messageBottom of page Link to this message

bob9999
Frequent Contributor
Username: bob9999

Post Number: 118
Registered: 08-2007

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 08 March, 2011 - 06:21 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Update,
I've found the fault in my program. In the WRITE_EPM routine, I used PIR1 which should be PIR2 for the 16f886!
The original program would stop at the BTFSS PIR1,EEIF loop, having writen once. Daft mistake.

RGR
Top of pagePrevious messageNext messageBottom of page Link to this message

mikehibbett
Frequent Contributor
Username: mikehibbett

Post Number: 1193
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 08 March, 2011 - 06:33 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Glad you got it sorted.

I'm always interested to hear ideas for articles - I might post a thread on just that to gather ideas!

Cheers,

Mike

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page