+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,243

    Default Writecode/Erasecode/Readcode

    The following test code works OK first time (after programmer erases memory), but on the second run it does not erase the block specified.

    The chip under testing is the 16F886, 8 words block size.

    Code:
    clear
    erasecode #1e00
    hserout ["1st test",13,10]
    for temp=$1e00 to $1e07
        readcode temp,code
        hserout [#temp," : ",#code,13,10]
    next temp
    
    hserout [13,10,"2nd test",13,10]
    for temp=$1e00 to $1e07
        writecode temp,temp
    next temp
    for temp=$1e00 to $1e07
        readcode temp,code
        hserout [#temp," : ",#code,13,10]
    next temp
    
    hserout [13,10,"3rd test",13,10]
    for temp=$1e00 to $1e07
        writecode temp,12345
    next temp
    for temp=$1e00 to $1e07
        readcode temp,code
        hserout [#temp," : ",#code,13,10]
    next temp
    
    stop
    Results on first run:
    Code:
    1st test
    7680 : 16383
    7681 : 16383
    7682 : 16383
    7683 : 16383
    7684 : 16383
    7685 : 16383
    7686 : 16383
    7687 : 16383
    
    2nd test
    7680 : 7680
    7681 : 7681
    7682 : 7682
    7683 : 7683
    7684 : 7684
    7685 : 7685
    7686 : 7686
    7687 : 7687
    
    3rd test
    7680 : 12345
    7681 : 12345
    7682 : 12345
    7683 : 12345
    7684 : 12345
    7685 : 12345
    7686 : 12345
    7687 : 12345
    Results on second run:
    Code:
    1st test
    7680 : 12345
    7681 : 12345
    7682 : 12345
    7683 : 12345
    7684 : 12345
    7685 : 12345
    7686 : 12345
    7687 : 12345
    
    2nd test
    7680 : 7680
    7681 : 7681
    7682 : 7682
    7683 : 7683
    7684 : 7684
    7685 : 7685
    7686 : 7686
    7687 : 7687
    
    3rd test
    7680 : 12345
    7681 : 12345
    7682 : 12345
    7683 : 12345
    7684 : 12345
    7685 : 12345
    7686 : 12345
    7687 : 12345
    Why Erasecode does not erase the block?

    Ioannis

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,243

    Default Re: Writecode/Erasecode/Readcode

    Now, that is interesting. It compiled and programmed just fine a couple of times.

    Then MCS said it needs to reload the different time stamp file and since then, Erasecode is not valid command...!


    Hi, we are pleased to see that you are using our forum.

    We'd like you to become a member of our community. Membership is FREE, please REGISTER and view our forums without these annoying reminders!

    Once registered you may post on the forums, download from the file areas and use the WIKI without interruption.






    Ioannis

Members who have read this thread : 4

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