This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

serial acess to code memory

im facing problem to acess the data bytes serially to the code memory.if it is possible give me a solution.

Parents Reply Children
  • No, it is not possible - because the 8051 architecture has no facility to write to CODE memory.

    So, you either have to design your own custom hardware that can temporarily switch your physical memory between XDATA (read, write, but no execute) and CODE (read, execute, but no write) "logical" spaces...

    Or use a chip with ISP or IAP capability (In-System or In-Application Programming).

  • i can write to the code memory statically.
    example unsigned char code array[10]={10,20,30------}
    this is working
    but wen i write the databytes from serial port it is not possible why??????????????
    example wat im trying out---

    unsigned char code array[10];
    array[i]=SBUF;
    i++;

    if possible give me an example code

  • "i can write to the code memory statically."

    No, you can't.

    "example

    unsigned char code array[10]={10,20,30------}
    

    this is working"

    That's because the data is loaded into your PROM by your PROM programmer - it is not loaded at run-time by the processor.

    "wen i write the databytes from serial port it is not possible why?"

    I explained that to you in my previous post.