Hi there,
I've got a C164CI and I have to write a bootloader in assembly to load my Hex-Files into the Flash memory. I've got a 32-Byte primary loop that loads another loop, refered to as secondary loop, which should load the main prog and write it into the flash memory. Everything seems to work fine, as I've inserted some LED controll codes, and the code seems to work, but when I've finshed sending the Hex-File and reseted the microcontroller it starts the prog that was (and obviously still is) in memory before. My secondary loop only temporarly stores the data in a register and then directly writes it into the flash starting on 00h.
I've got the disassembled code of an existing bootloader and there I found that it is deleting the flash memory before it writes the data to it. But I could not really find out how that works. The dissasembled code uses instructions like MEMMOV 0XAAAA, #0xAAAA, R3 but I havn't found out what this instruction does and the assembler I use (Reads166 - Rigel Cooperation) doesn't even know it. So could anybody tell me what MEMMOV does? (google didn't help :'-( )
Or/And
how you can erase the flash with assembly code? What exactly is the principle of erasing memory? Is it to set every bit to zero or exactly does that mean?
Thanks for your help
Thomas