??? 09/28/04 07:29 Read: times |
#78231 - RE: BOOTLOADER Responding to: ???'s previous message |
hi,
I am sorry but I lost the idea what you wish to do completely. 1) If you wish to start firmware bootloader then all you need is just make hardware conditions of bootloader during reset state and then release reset. For example, next way is used and works with AT89C51RD2, ED2 and CC03: - reset MCU; - keep reset active and tie /PSEN to GND; - release reset when /PSEN is held low; - release /PSEN. Or: - switch power off; - tie /PSEN to GND; - switch power on during /PSEN is held low; - release /PSEN. Moreover, if you have obtained the fresh part "just-from-factory" then you even need not create hardware conditions because such part is factory programmed to go into bootloader mode by default (BLJB programmed, BSB=0xFF, SBV=0xFC). [below is about AT89C51RD2 if another not said] Programming via FLIP: - put MCU into firmware bootloader mode by one of ways shown above (do not forget to release reset); - run FLIP, select derivative, COM speed and then press "connect" button. 2) If you need with your own bootloader. First of all, to upload custom bootloader, anyway you will need to program MCU either via FLIP or parallel programmer. 2a) way A: - create your bootloader (program, compile, generate hex file). Be careful about align of address (see below); - program it into MCU at any address aligned to 256 (0x0000, 0x0100, 0x0200 etc). Note: address must be below 0xFC00; - put high byte of address where your bootloader is placed, into SBV; - put value 0xFF into BSB; - program bit BLJB (in FLIP: make it marked, then press "Set"). That`s all. Now after reset your bootloader software will be executed. 2b) way B: - create your bootloader (program, compile, generate hex file). - program it into MCU anywhere; - put LJMP bootloader_entrance instruction at address 0x0000; - erase bit BLJB (in FLIP: make it unmarked, then press "Set"). That`s all. Now after reset your bootloader software will be executed. The differences between 2a and 2b. - With way A, the custom bootloader may be placed anywhere inside program memory (with care about align of course) - it will be autovectored and executed. So you may place it at the upper end of flash memory and allow a user to program rest of flash memory by IAP of both your and firmware bootloaders. That`s very useful: you may create own bootloader`s conditions for end user and you take control over programming process as well. With way B you must notice a user that locations 0x0000...0x0002 are reserved and you should provide another start address for user application (not good, ugly way). - With way A the firmware ROM is activated (ENBOOT=1) after reset. It checks BSB and SBV and then goes to your bootloader. With way B your bootloader is executed immediately after reset without mapping firmware boot ROM inside program space (ENBOOT=0). So, in the way A you are not able to place your bootloader at address 0xFC00 and above. With way B it is possible. - With way A, the custom bootloader may be disabled with appropriate way. For example, after user application is downloaded into MCU, you may program value 0x00 into BSB or clear BLJB. With way B, it is possible via delete LJMP at 0x0000 (not safe way if something happens during re-program these three bytes). As well, if during reset the hardware conditions occur then firmware bootloader will be executed nevertheless has a chip custom bootloader or does not. By the way, AT89C51RD2 has bootloader programmed into ROM and so it is not possible to change it. You may create only "user" bootloader then. Opposite it, AT89C51CC03 has bootloader programmed into extra flash memory. For this derivative it is possible to make own "firmware" bootloader with parallel programmer. It is very nice feature when you need not someone use standard FLIP access to a chip. From other side, ROM is more safe than Flash for accidental erasure. Okay, let me continue about your code posted at the next message. Regards, Oleg |
Topic | Author | Date |
BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: BOOLOADER | 01/01/70 00:00 | |
RE: | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: 12V Sigs | 01/01/70 00:00 | |
RE: BOOTLOADER | 01/01/70 00:00 | |
RE: BOOTLOADER | 01/01/70 00:00 | |
RE: BOOTLOADER![]() | 01/01/70 00:00 | |
RE: BOOTLOADER | 01/01/70 00:00 |