Writecode/Erasecode/Readcode


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795

    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
    3,795


    Did you find this post helpful? Yes | No

    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...!

    Ioannis

Members who have read this thread : 1

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