Playing with STC15L204 : memory layout / IAP&EEPROM

Posted by

Well, the STC15L204 data-sheet is not very clear on some aspects (the device is simple enough to compensate…).

I almost totally forgot that this device had a 512 bytes E2PROM… And I also wanted to explore its memory to try to figure where ISP code could be located, thus I made a small program to dump the memory content , first using a code pointer (something like “ptr=(__code unsigned char *)addr;” ) and then using the IAP registers (and to get some output in the IAP section, I have put a write 0x55 at address 0x123).

Here are the results (only displaying lines that does not contain only 0xFF) :

On first run :

> Device ready
0000 02 00 13 32 FF FF FF FF FF FF FF 02 02 5F 12 00
....
0310 50 52 4F 4D 0D 0A 00 0D 0A 3E 20 45 4E 44 0D 0A
0320 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0FF0 FF FF FF FF FF FF FF FF FF 00 0B 00 54 00 A4 BD 

> IAP/ISP/EEPROM
0120 FF FF FF 55 FF FF FF FF FF FF FF FF FF FF FF FF 

> END

And then at second run (without reprogramming/erasing E2PROM with the ISP program) :

 

> Device ready
0000 02 00 13 32 FF FF FF FF FF FF FF 02 02 5F 12 00
....
0310 50 52 4F 4D 0D 0A 00 0D 0A 3E 20 45 4E 44 0D 0A
0320 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0FF0 FF FF FF FF FF FF FF FF FF 00 0B 00 54 00 A4 BD
1120 FF FF FF 55 FF FF FF FF FF FF FF FF FF FF FF FF (???)

> IAP/ISP/EEPROM
0120 FF FF FF 55 FF FF FF FF FF FF FF FF FF FF FF FF 

> END

So here are my conclusions :

  • There is a Chip ID at the end of the code region (0x0FF9-0x0FFF).
  • E2PROM region (0x000-0x3FF with IAP addressing) is is fact located just after the code region (0x1000-0x13FF) and accessible for reading just like regular code section. (This is, I think, somehow described in the Chinese version of the data-sheet).
  • I have not tested if it is possible to run code in that address range (could be the reason it is also called IAP, but there is also a IAP version of the chip IAP15L204 – so what are the differences between both ?).
  • I have not found any ISP code (that would be accessible from the code section – it is probably protected by some SFR register, or only visible from the boot code and the ISP software) – Oh, by the way, my ISP software gives me a firmware version of 6.7R, leave me a message if you have anything else…

Code : here (same, and thus includes the nrf24l01 / onewire from previous article)

 

 

One comment

  1. Hello, I need a programmer that can make a program p / 8051 using STC15L204 MCU Wireless Development Board + NRF24L01 module need a bridge rs232 RS232 9600 8N1 simply an extension RS232
    details email me cassio.franquini@gmail.com or (67) 3423-4540
    STC15L204 MCU + NRF24L01
    paypal payment

Leave a Reply

Your email address will not be published. Required fields are marked *