Searching \ for '[PIC] EEPROM Read Problems' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/memory.htm?key=eeprom
Search entire site for: 'EEPROM Read Problems'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] EEPROM Read Problems'
2008\07\10@232211 by threewheeler7

picon face

High everyone, i have worked with PICs quite a bit, but i have never used the
internal EEPROM. i have read the pic16f648's datasheet and looked through
quite a few web sites on the subject only, i am having a hard time finding
what i am looking for. for now i am trying to read 16 bytes of data from
EEPROM, and sending them to a LCD. all i get is 16 forward slashes on my
LCD. I have included the vital piece of code, i know it cannot be too big of
a deal but i would appreciate your help, as i have been scratching my head
over this.
thankyou.



Code:

EEPROM
       movlw        d'16'
       movwf        count
       clrf        temp                ;address 0x00
E1        
       movlw temp                  ;load address into w
       bsf STATUS, RP0        ;Bank 1
       movwf EEADR              ;move address to EEPROM
       bsf EECON1, RD                 ;EE Read
       movf EEDATA, W                ;W = EEDATA
       bcf STATUS, RP0        ;Bank 0
       call        LCD_CharD
       incf        temp,f
       decfsz        count,f
       goto        E1
--
View this message in context: www.nabble.com/EEPROM-Read-Problems-tp18395862p18395862.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2008\07\10@234749 by Jinx

face picon face
> movlw temp           ;load address into w

I think you want to be using movf temp,w. That's why display data
doesn't change as you go through the loop

2008\07\11@001631 by Spehro Pefhany

picon face

>
>Code:
>
>EEPROM
>         movlw   d'16'
>         movwf   count
>         clrf    temp                ;address 0x00
>E1
>         movlw temp                ;load address into w     <-- here
> you're loading the LS 8 bits of the *address* of temp, not the
> value *in* temp, into W

   you probably want to use movf temp,w

Odd that you'd be getting '/' though, I think I would have expected a
block or 'y' with umlaut(sp?) if the unused
portion of the EEPROM was 0xFF.




{Quote hidden}

>

2008\07\11@003237 by Jinx

face picon face
> Odd that you'd be getting '/' though, I think I would have expected
> a block or 'y' with umlaut(sp?) if the unused portion of the EEPROM
> was 0xFF

EE has most likely been successfully written with data somewhere else

threewheeler7, you could INCF EEADR instead of running an external
counter. And BANKSEL would be an improvement over using RP0

2008\07\11@004335 by Christopher Head

picon face
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

threewheeler7 wrote:
[snip]
| Code:
|
| EEPROM
|        movlw        d'16'
|        movwf        count
|        clrf        temp                ;address 0x00
| E1        
|        movlw temp                  ;load address into w

You want MOVF temp, W here.

|        bsf STATUS, RP0        ;Bank 1
|        movwf EEADR              ;move address to EEPROM
|        bsf EECON1, RD                 ;EE Read
|        movf EEDATA, W                ;W = EEDATA
|        bcf STATUS, RP0        ;Bank 0
|        call        LCD_CharD
|        incf        temp,f
|        decfsz        count,f
|        goto        E1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkh25PEACgkQiD2svb/jCb5FNgCgjiXACt8eNviZv9FV3VEM9Gb6
QyMAn3zyTGRGreRLTn4JErSg1Eo3wTfO
=FUSE
-----END PGP SIGNATURE-----

2008\07\11@085030 by olin piclist

face picon face
threewheeler7 wrote:
> EEPROM
> movlw d'16'
> movwf count
> clrf temp                ;address 0x00
> E1
> movlw temp           ;load address into w
> bsf STATUS, RP0 ;Bank 1
> movwf EEADR              ;move address to EEPROM
> bsf EECON1, RD ;EE Read
> movf EEDATA, W ;W = EEDATA
> bcf STATUS, RP0 ;Bank 0
> call LCD_CharD
> incf temp,f
> decfsz count,f
> goto E1

For one thing, labels start in column 1 and everything else in column 2 or
later.  Didn't this mess produce massive warnings?


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2008\07\11@092614 by Tamas Rudnai

face picon face
> For one thing, labels start in column 1 and everything else in column 2 or
> later.  Didn't this mess produce massive warnings?

I think he actually did it right, so maybe the mail client or MTA stripped
off the leading spaces on your side, Olin. Here is what I got from the first
post:

{Quote hidden}

On Fri, Jul 11, 2008 at 1:52 PM, Olin Lathrop <spam_OUTolin_piclistTakeThisOuTspamembedinc.com>
wrote:

{Quote hidden}

> -

2008\07\11@095240 by olin piclist

face picon face
Tamas Rudnai wrote:
> I think he actually did it right, so maybe the mail client or MTA
> stripped off the leading spaces on your side, Olin.

No, my mail software does not strip off leading spaces.  Perhaps he used tab
characters, which of course are interpreted differently on different
systems.  I saw others also quoted his message with leading spaces missing.

Once again we wouldn't be having this discussion if mail was sent in plain
ASCII with no control characters.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2008\07\11@102829 by Shawn Tan

flavicon
face
On Friday 11 July 2008 14:54:48 Olin Lathrop wrote:
> Once again we wouldn't be having this discussion if mail was sent in plain
> ASCII with no control characters.

Hear! Hear!

--
with metta,
Shawn Tan

Aeste Works (M) Sdn Bhd - Engineering Elegance
http://www.aeste.net

2008\07\11@113017 by Mark Rages

face picon face
On Fri, Jul 11, 2008 at 8:54 AM, Olin Lathrop <.....olin_piclistKILLspamspam@spam@embedinc.com> wrote:
> Tamas Rudnai wrote:
>> I think he actually did it right, so maybe the mail client or MTA
>> stripped off the leading spaces on your side, Olin.
>
> No, my mail software does not strip off leading spaces.  Perhaps he used tab
> characters, which of course are interpreted differently on different
> systems.  I saw others also quoted his message with leading spaces missing.
>
> Once again we wouldn't be having this discussion if mail was sent in plain
> ASCII with no control characters.
>

The horizontal tab character has been in ASCII for 40 years.  Perhaps
it is time to upgrade your mail software.

Regards,
Mark
markrages@gmail
--
Mark Rages, Engineer
Midwest Telecine LLC
markragesspamKILLspammidwesttelecine.com

2008\07\11@121637 by olin piclist

face picon face
Mark Rages wrote:
> The horizontal tab character has been in ASCII for 40 years.  Perhaps
> it is time to upgrade your mail software.

The character is well defined but its action is not.  There are no standard
tab stops.

By now people really should know not to put tab characters in files you
expect others to look at, especially when they are asking them to do so as a
favor.  There is no way to know what tab stops are set on someone else's
system.  Since just about any editor can translate tabs to spaces according
to the tab settings at the time, there is really no excuse for this.

If you insist on using some brain dead editor that can't convert tabs to
spaces, then you can always do it by post processing.  My freely available
ASPIC_FIX program does that, in addition to a few other things to make PIC
assembler source as readable as possible.  My COPYA program has command line
options for converting tabs to spaces with arbitrary tab stops of your
choosing.  There are many other programs out there too.

Personally I think any MPASM code posted here should be run thru ASPIC_FIX
first, although I may be a tad partial.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2008\07\11@180036 by Tamas Rudnai

face picon face
> By now people really should know not to put tab characters in files you
> expect others to look at, especially when they are asking them to do so as
a
> favor.

I agree with you about TAB-is-a-no-no, however, MPLAB's default is to use
TAB. So it is for vim - the first thing usually when I install these to
change this to spaces, but I doubt if too many people would care of this.

> Personally I think any MPASM code posted here should be run thru ASPIC_FIX
> first, although I may be a tad partial.

Also if people would use vim with softtabstop set a pressing two chars
('=G') while the cursor is in the beginning of the file would do the trick.
Ok, to go to the beginning of the file is also two pressings ('1G') so i
guess altogether with 4 pressing is just too much <grin>

Tamas


On Fri, Jul 11, 2008 at 5:18 PM, Olin Lathrop <.....olin_piclistKILLspamspam.....embedinc.com>
wrote:

{Quote hidden}

> -

2008\07\11@180815 by threewheeler7

picon face

Hey thanks, i should have seen that right away! its always great to have
someone else to look over your code. i don't know anyone else that writes.
you're all i got. do any of you have any suggestions on what is a simpler
way of loading eeprom values into hex files. i have just been using mplab's
eeprom view, and then exporting the hex. i am using ic-prog.
--
View this message in context: www.nabble.com/EEPROM-Read-Problems-tp18395862p18413437.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2008\07\11@193237 by Jinx

face picon face
> MPLAB's default is to use TAB. So it is for vim - the first thing
> usually when I install these to change this to spaces, but I doubt
> if too many people would care of this

I wish they would, tabs make such a mess

In MPLAB, Edit/Properties/Sizes Insert Spaces

2008\07\11@194707 by William \Chops\ Westfield

face picon face

On Jul 11, 2008, at 8:29 AM, Mark Rages wrote:

> The horizontal tab character has been in ASCII for 40 years.  Perhaps
> it is time to upgrade your mail software.

Heh.  And poorly defined for all of those years!  We have battles  
over whether C indentation should be a mix of tabs and spaces, tabs  
only, or spaces only.  Over and Over Again.  Sigh.

Nowdays, of course, none of the indentation solutions works well in  
email, what with tab stops being ill- or un-defined, and spaces  
subject to compression due to (per-user defined) proportional fonts  
used for display...

BillW

2008\07\11@194735 by cdb

flavicon
face


:: In MPLAB, Edit/Properties/Sizes Insert Spaces

In v8.01, that is under

Edit/Properties/FILE TYPES

Colin
--
cdb, EraseMEcolinspam_OUTspamTakeThisOuTbtech-online.co.uk on 12/07/2008

Web presence: http://www.btech-online.co.uk  

Hosted by:  http://www.1and1.co.uk/?k_id=7988359

Friendship multiplies the good of life and divides the evil.
Baltasar Gracian





2008\07\11@201403 by olin piclist

face picon face
threewheeler7 wrote:
> do any of you have any suggestions on what is a
> simpler way of loading eeprom values into hex files.
> i have just been using mplab's
> eeprom view, and then exporting the hex.

Put the EEPROM values in the source code.  On a PIC 16:

eeprom  code h'2100'
        de   val, ... val

On a PIC 18:

eeprom  code_pack h'F00000'
        db   byte, ... byte

********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2008\07\12@085841 by John Chung

picon face
The poor definition of tabs has caused plenty of grief. After
this mail I think I will switch to spaces from now on.


Good post,
John Chung





--- On Sat, 7/12/08, Tamas Rudnai <tamas.rudnaispamspam_OUTgmail.com> wrote:

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2008 , 2009 only
- Today
- New search...