pic12f629 EEPROM problem in MPLABSIM


Results 1 to 2 of 2

Threaded View

  1. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    MPSIM can be a real pain in few occasion, what i suggest is to loop on the READ subroutine and wait the Watch Windows to refresh.

    Code:
            include     P12F629.inc
            errorlevel -302
            __CONFIG    _INTRC_OSC_NOCLKOUT & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _BODEN_ON 
            
    MyData = 0xFA ; whatever your value
    MyAddr = 0x10 ; EEPROM Address    
    TEMP            EQU 0x21
    
            org     0
            call    WRITE
            call    READ
            goto    $-1
    
    
    
    WRITE: 
            BANKSEL EECON1
            MOVLW   MyAddr
            MOVWF   EEADR
            MOVLW   MyData
            MOVWF   EEDATA
            BSF     EECON1,WREN
            MOVLW   0X55
            MOVWF   EECON2
            MOVLW   0XAA
            MOVWF   EECON2
            BSF     EECON1,WR
            BCF     EECON1,WREN
            RETURN
    
    READ: 
            BANKSEL EEADR
            MOVLW   MyAddr
            MOVWF   EEADR;
            BSF     EECON1,RD 
            MOVF    EEDATA,W 
            BANKSEL TEMP
            MOVWF   TEMP  
            RETURN
            
            end
    NOTE: This may not work in 'Animate' mode.
    Last edited by mister_e; - 16th May 2008 at 19:21.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 15:46
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 04:17
  3. Problem with 12F629, servo and EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 1st March 2008, 10:53
  4. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 07:26
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 20:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts