Some questions about WRITECODE


Closed Thread
Results 1 to 38 of 38

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default Some questions about WRITECODE

    Hi. Ive had a search around the forums but i didnt find anything that answers these questions (unless i just didnt understand it)

    Would i be right in saying that WRITECODE will write to the same place as my PIC programmer? I did read something about erasing before writing. I cant find an erase command on the commands list but would using it make the chip asif it was never programmed?

    Assuming that WRITECODE does what i think it does then does that mean i can re-program a chip through serial without using ICSP?

  2. #2
    Join Date
    Oct 2004
    Location
    North Norfolk UK
    Posts
    146


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Would i be right in saying that WRITECODE will write to the same place as my PIC programmer?
    I assume you mean code space as appose to eeprom, the answer is yes. you need to choose a suitable address to writecode to, otherwise you can overwrite active program memory. I allocate an area as far away from the active space as possible.



    I cant find an erase command on the commands list
    which programmer was that?


    ________________

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    You have to erase a "block" of memory with ERASECODE before you can write to it. Depending on your device, the size of the erase block and the size of the write block can vary. And sometimes the erase block size is different than the write block size. The datasheet generally explains this.

    If you have a device larger than 65K in FLASH, you will either have to use PBPL 2.50, modify your PBP 2.47 libraries, or write an assy language routine to get to the upper half.
    Charles Linquist

  4. #4
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Yeah. Ive donw EEPROM before. Im talking about the program code.

    Not a programmer. Its a site i found on google that lists the commands PBP supports http://www.rentron.com/PicBasic2.htm
    Is there a better list somewhere?

    So it is possible to overwrite active program memory? Would it be possible to overwrite the whole chip? The only problem i can think of is that the code space is usually bigger than the ram on the chip so that would require multiple serin commands and once it gets overwritten then it doesnt work again.

    If i wanted to write just a little bit of code onto the chip then how does that work? To run it do i just tell the chip to goto the address of the first line or something?

    Ive never programmed a chip to reprogram itself before. It sounds like something that would be very usefull to know

  5. #5
    Join Date
    Oct 2004
    Location
    North Norfolk UK
    Posts
    146


    Did you find this post helpful? Yes | No

    Default

    Is there a better list somewhere?
    Do you have a manual ?

    Hi Charles,
    absolutely right, I forgot about the 18F needing erasecode




    _________________________

  6. #6
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by duncan303 View Post
    Do you have a manual ?
    Nope. Should i have?

    Edit: Can it be downloaded?

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Nope. Should i have?
    Edit: Can it be downloaded?
    ?????????????????????????????????????????????????? ????????????????????????????????????
    Ding.... You're done....

Similar Threads

  1. Bootloader For 18F4520
    By isaac in forum mel PIC BASIC Pro
    Replies: 36
    Last Post: - 24th March 2010, 17:56
  2. WRITECODE, ERASECODE, and interrupts
    By RussMartin in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th March 2010, 02:46
  3. WRITECODE stores wrong 14-bit word values in FlashMEM
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th June 2009, 04:35
  4. Can anyone help me to use Writecode for pic18f458 ?
    By dip1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th June 2006, 22:29

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