At 01:09 PM 07/02/01 -0700, you wrote:
{Quote hidden}>OK folks..its me again, asking about the EEPROM read/writes.
>
>I've been solving other issues (interupts,etc) and finally back to this being
>my final but worse problem. There pretty much is no workaround for this since
>its timer values that are modified on the fly.
>
>I'm concentrating on reads first. I used MPLAB to fill the EEPROM memory with
>a value, and then simply reading it to store and display on a LCD
>
>But it only shows zero for the value. I init the variables, and if I bypass
>the read routine it displays the default
>
>here is the code
>
> movlw 0x01 ; initial values to variable
> movwf MINUTES
> movlw 0x04
> movwf SECONDS
>testread:
> movlw 0
> movwf EEADDR ; set up eeprom address from W
> bsf STATUS,RP0 ; change to page 1
** You should be clearing EEPGD here to make sure you're reading data EE
** EECON1 is in bank 3 not bank 1
> bsf EECON1,RD ; set the read bit
> bcf STATUS,RP0 ; back to page 0
** EEDATA is in bank 2 not bank 0
Have a read of pages 39-41 of the 'F871 datasheet (DS30569A)
{Quote hidden}> movf EEDATA,W ; return value in W
>
> movwf MINUTES ; store W to minutes
>
>; display to LCD
> movlw 0xCD
> movwf CURSOR_POSITION
> call DISPLAY_COLON
> movlw 0xCB
> movwf CURSOR_POSITION
> movf MINUTES,0
> movwf TIME_VALUE
> call DISPLAY_TIME ; pass cursor_position & time_value
> movlw 0xCE
> movwf CURSOR_POSITION ; set initial cursor position
> movf SECONDS,0
> movwf TIME_VALUE
> call DISPLAY_TIME ; pass cursor_position & time_value
>
> goto testread
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics