EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Bootstrap Mode

Started by Huey Fen October 31, 2005
Good day,
Here are some questions regarding the bootstrap mode.
I've read through the bootstrap mode application notes (AN1060). But there are something that
I don't really understand. From pg 7 of AN1060, there is a paragraph sounds like this:

"The number of data bytes in the downloaded program can be any number between 0 and 512 bytes (thesize of on-chip RAM). This procedure is called "variable-length download" and is accomplished by ending the download sequence when an idle time of at least four character times occurs after the last character to be downloaded. In M68HC11 Family members which have 256 bytes of RAM, the download length is fixed at exactly 256 bytes plus the leading $FF character."

I am using M68HC11A1 family; meaning that the RAM is 256 bytes. So, does it means that the length of downloaded program should be exactly 256 bytes before the MCU can run the downloaded program? I don't understand the leading $FF character as well. Can anybody explain to me?

Can anyone tell me more on bootstrap mode. Any information regarding this is most welcome. Thanks for the help.
Best regards,

Huey Fen
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.



----- Original Message -----
From: "Huey Fen" <circuitcyco@circ...>
To: <m68HC11@m68H... > In M68HC11 Family members which have 256 bytes of RAM, the download length is
> fixed at exactly 256 bytes plus the leading $FF character."

The leading $FF is for helping the on-chip loader determine your baud rate.

> So, does it means that the length of downloaded program should be
> exactly 256 bytes before the MCU can run the downloaded program?

Yes, but this is no problem. You can fill the unused bytes with a dummy value
to make the length equal to 256. For use with ASM11 (below), you need to write
the boot code (e.g., TALKER.ASM) as follows:

#MEMORY 0 255
ORG 0 ;talker variables

ORG 0 ;talker code
lds #$FF
...

ORG $FF
fcb 0

Then, use the EXBIN.EXE utility found in the same package
(http://www.aspisys.com/asm11d84.zip) like so:

EXBIN TALKER T <ENTER>

and this will take your TALKER.S19 and convert it to binary (TALKER.BIN)
complete with the needed leading $FF byte, and also create a batch file
TALKER.BAT that can be used to load your TALKER.BIN to the HC11 using standard
DOS (Win console) commands. This method should work OK for DOS, Win9x, and
(possibly) WinXP. You should now have TALKER.ASM, TALKER.BIN (of size 257), and
TALKER.BAT

Finally, run the batch file from a DOS window, giving the COM port (1 or 2) as
parameter, and follow the instructions:

TALKER 1 <ENTER>

> Huey Fen

tonyp@tony...



Sorry, but I think I don't really understand the boot code that you
suggested in the previous email.
> #MEMORY 0 255
> ORG 0 ;talker variables
> ORG 0 ; talker code
> lds #$FF
> ...
> ORG $FF
> fcb 0
Can you give some explaination to me?
Do you mean that I can write any program between the lds #$FF and
ORG $FF? The length of my program does not necessary to be 256
bytes, isn't it?
>EXBIN TALKER T <ENTER>
Can you explain this to me as well? I've gone through the EXBIN
program and what does it mean with " exbin prog T
(prepend $FF for HC11 talker and make .BAT)"?
May I know how to download the program into MCU? What did you mean
with batch file?
Hope to get your reply soon. Thank you in advance.
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.



Huey Fen wrote:
> Good day,
> Here are some questions regarding the bootstrap mode.
> I've read through the bootstrap mode application notes (AN1060). But there are something that
> I don't really understand. From pg 7 of AN1060, there is a paragraph sounds like this:
>
> "The number of data bytes in the downloaded program can be any number between 0 and 512 bytes (thesize of on-chip RAM). This procedure is called "variable-length download" and is accomplished by ending the download sequence when an idle time of at least four character times occurs after the last character to be downloaded. In M68HC11 Family members which have 256 bytes of RAM, the download length is fixed at exactly 256 bytes plus the leading $FF character."

You are not reading about the A family, but the E family.

> I am using M68HC11A1 family; meaning that the RAM is 256 bytes. So, does it means that the length of downloaded program should be exactly 256 bytes before the MCU can run the downloaded program? I don't understand the leading $FF character as well. Can anybody explain to me?

For the A family, the download size must be exactly 256 bytes.

> Can anyone tell me more on bootstrap mode. Any information regarding this is most welcome. Thanks for the help.

Tie ModA and ModB appropriately.
Reset the uC.
Send $FF.
Send 256 bytes.
Your program starts.

The download supports two Baud rates. Note that $FF
has all bits on. So there is a long period with the
SCI input high, then a low for one bit time, followed
by a high for 9 bit times at least. The uC times
the start bit to compute baud rate.

What more do you want to know? Willing to explain whatever
remains unclear.

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!



>Tie ModA and ModB appropriately.
>Reset the uC.
>Send $FF.
>Send 256 bytes.
>Your program starts.

I don't understand how to send $FF at the very beginning stage. Can you explain? thanks a lot.
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.



Huey Fen wrote:
>>Tie ModA and ModB appropriately.
>>Reset the uC.
>>Send $FF.
>>Send 256 bytes.
>>Your program starts. > I don't understand how to send $FF at the very beginning stage. Can you explain? thanks a lot.
>

Hmm.

You have a computer on which you are building programs
for the 6811. This computer is called the host. You have
a small computer with a 6811 on it. This computer is called
the taget. On each you need RS232 connections, and a cable.

If you use a PC as host, then the serial connections are wired
as DTE. This means that either the connections on the
target must be DCE or you must use a cross-over cable.
Connect the host to the target using the appropriate cable.

Run software on the host to create the program for the
target on the host. Write a little program for the host
(the appplication note has one in it, IIRC) to send a
character with all bits on, followed by the 256 bytes of
the program for the target. Reset the target, and run
the sender program on the host.

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!



----- Original Message -----
From: "Huey Fen" <circuitcyco@circ...>
To: <m68HC11@m68H... > Sorry, but I think I don't really understand the boot code that you
> suggested in the previous email.

> Do you mean that I can write any program between the lds #$FF and
> ORG $FF? The length of my program does not necessary to be 256
> bytes, isn't it?

I guess. Your usable program does not have to be 256 bytes long but your actual
program that will be loaded in has to, so add dummy code to make it long enough.

> EXBIN TALKER T <ENTER>
> Can you explain this to me as well?

In my original reply, I already have, as best as I could, without making a
dissertation of it.

> May I know how to download the program into MCU? What did you mean
> with batch file?

If you don't know what batch files are, either skip the answer as irrelevant, or
maybe show some courage and look it up with Google by typing batch-file and
pressing the "I'm feeling lucky" button. [Please don't ask what Google is :)]

Although I understand your frustration, let me close with this thought for
general audience consumption, as this seems to be a recurring phenomenon:

"There is a minimum of effort on your end for any help offered to you to be of
any use."

Good luck.

tonyp@tony...


Tony Papadimitriou wrote:

[snip]

> Although I understand your frustration, let me close with this thought for
> general audience consumption, as this seems to be a recurring phenomenon:
>
> "There is a minimum of effort on your end for any help offered to you to be of
> any use."

My sig:

I can explain it for you, but I can't understand it for you.

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!



I've got the MCU runs in bootstrap mode. Special thanks to Tony Papadimitriou and and Mike McCarty for supplying me such precious information.
But I've got another problem.
I would like to increase the acc A from 1 to 10 and output the value of acc A at Port B. The
program needs to wait for 1 sec for every increment of acc A.
However, the Port B can only output acc A with value of 10. I wonder why the hardware was
unable to output from value of 1 to 10.
Can anyone tell me the trick? Thanks a lot.

---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.



Hi to all:
Here's what I have happening:
I boot my PC in the dos mode, using a utility "Moslo" to slow the PC down to
XT speed.

I run PCBUG11A on COM1 to communication with my 68HC11E2FN board (just has
rs232 supporting chips along with the processor).

I have MODA and MODB strapped to ground. I am using the CGN-232 board with
the supporting chips for rs-232.

I'm using Tx, Rx, and Ground on the DB9 serial cable.
After resetting the board, starting PCBUG11A, I see Tx and Rx pulsing as
PCBUG says it is downloading talker.

It then follows with a bunch of errors, including comms fault, etc.
I can reset the board, then enter "restart" at the prompt, it spends a
little time downloading the talker, and then follows with the same errors.
I've tried a couple of the talkers, including "4" which is the one for the
68HC11E2 processor.

I'm entering that the talker is not on the board, do not use xirq, assume
8mhz crystal (which it does have on the board).
What am I doing wrong? Several years ago I think that I went through this
same thing, but can't remember if I added a wire or ??

Not sure.
Thanks for the help,
Art



The 2024 Embedded Online Conference