Prog68HC11
Curious hey?
When the MODA and MODB pins of the MCU select "boot mode", the processor starts an internal program at address $BFxx. This program is stored in an internal ROM which is visible only in "boot mode". If you are curious you can see the code of the program with PICOBUG - dump the word at address $BFFE - this is the start of the "boot mode" code. You can disassemble from there.
It is a small piece of code and it varies between different revisions of the MCU, but essentially does the same thing. First it sets up the serial transfer for the odd speed of 7812 bps (assuming you have 2MHz bus speed - 8MHz crystal). Then is sends a "break" signal trough the serial port. After that it waits for the first byte and then reads it.
Prog68HC11 has the option to wait for the "break" signal, so this way you start the program on your PC, then power up (or reset) the MCU board. Prog68HC11 sets the speed of the serial port to the more standard 1200 bps - don't panic the MCU is designed to understand that.
If you have not specified a binary to download, Prog68HC11 sends a 00 character to the serial port and exists. Regardless of the speed mismatch the 00 symbol is read as 00. The ROM of my MCU interprets this as a signal to jump straight to $F800, which is the beginning of the EEPROM of the 68HC811E2.
If you have specified a binary to download, Prog68HC11 sends the first byte of your binary, which have to be $FF - it will give you an error it it is not. The ROM program reads this byte - because of the speed mismatch the symbol is read as $E0 or $C0. This is a signal for the ROM code to switch the speed to 1200 bps. Then it starts receiving the rest of the code and stores it starting from address $00 echoing all characters it receives.
Prog68HC11 will start printing "." for each byte it sends and receives the echo correctly. If your code is shorter than 256 bytes, Prog68HC11 will send 00 until all the 256 bytes of memory are filled - for those 0s, it prints "+" character. After all the 256 characters have been send by the PC and received by the MCU ROM firmware the firmware starts executing the instruction at address 00 - which should be the first instruction of your program. After sending 256 bytes the Prog68HC11 terminates execution.
Go Back