Working with HEF


Results 1 to 5 of 5

Threaded View

  1. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    Did you find this post helpful? Yes | No

    Default Re: Working with HEF

    Quote Originally Posted by mpgmike View Post

    Code:
    Cyls        var     byte
    Start:
    GOSUB Write_HEF
    GOSUB Read_HEF
    
    
    Write_HEF:
    ASM
        BANKSEL PMADRH
        MOVLW    1Fh
        MOVWF   PMADRH                          ;PMADRH = $1F, 1st HEF Address is 1F80h
        MOVLW   80h
        MOVWF   PMADRL                          ;PMADRL = $80
        BCF     PMCON1,CFGS
        BSF     PMCON1,WREN
        BSF     PMCON1,LWLO
        ????  MOVIW   _Cyls  see below
        MOVWF   PMDATL
        
    ENDASM
        GOSUB UnlockHef
    @   BCF     PMCON1,LWLO
        GOSUB UnlockHef
    @   BCF     PMCON1,WREN   
    RETURN
    What am I missing?
    start here I think
    1st HEF Address is 0x1F80h not 0x0f80


    MOVIW _Cyls
    this won't work that's an indirect load of wreg but a fsr has not been loaded or selected
    Code:
    
    
    BANKSEL _Cyls
    movf _Cyls,w  
    BANKSEL PMDATL
    movwf PMDATL
    clrf      PMDATH  ? ;  a write is 1 word


    does writecode not work for these chips ?
    Last edited by richard; - 16th August 2017 at 10:13. Reason: a few typos
    Warning I'm not a teacher

Similar Threads

  1. HEF (High Endurance Flash) What to do?
    By mehmetOzdemir in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 6th June 2016, 06:25
  2. SERIN Not Working, SEROUT Working
    By cc1984 in forum Serial
    Replies: 11
    Last Post: - 26th October 2010, 19:16
  3. SHIFTOUT is not working
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th August 2010, 22:56
  4. Anyone working with the MRF24J40MA's?
    By JD123 in forum Off Topic
    Replies: 4
    Last Post: - 18th April 2010, 03:49
  5. Working with money
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 25th July 2007, 22:46

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