Sign in

username:

password:



Not a member?

Search hc11



Search tips

Subscribe to hc11



Ads

Discussion Groups

Discussion Groups | M68HC11 | Axiom CMD-711EX and ImageCraft ICC11 Baud Problems

Technical discussions about Freescale Microcontrollers: M68HC11. (Freescale Semiconductor is a Subsidiary of Motorola).

Axiom CMD-711EX and ImageCraft ICC11 Baud Problems - joe_photog - Mar 24 9:33:00 2006

First off I am new to writing in C language, so I apologize for my
lack of sure footedness in that area.  I work for a school that uses
the Axiom CMD-711EX Microcontroller Boards and we are in the process
of testing the demo of ImageCraft's ICC11 Ver. 6 C Compiler Tools.  We
have no problem writing the C code, compiling and downloading to the
board.  The problem occurs when we execute the program, we get a
screen of garbage.

A single line Trace of the program reveals that the __HC11Setup
subroutine does a LDD #$0030.  Then the _setbaud subroutine loads the
#$0030 into the BAUD Register.  The problem is that the board is now
set for something other that 9600 baud.  When I single step through
the program and manually set the LDD #$0030 to LDD #$0004 it works
fine I see the printf statement put the right stuff on the screen and
life is good.

How can I change the __HC11Setup so that it loads a #$0004 and not
#$0030?  The people above me have talked to ImageCraft and said write
a new __HC11Setup.  I have changes to the HC11.H file and put the 0x04
where is say BAUD9600 =, but to no avail.  Does anyone have the ICC11
working with the Axiom CMD-711EX Board or can shed any light on the
situation?  Thanks in advance of any pointers or help.

JoeD
	


(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )


Re: Axiom CMD-711EX and ImageCraft ICC11 Baud Problems - Mike McCarty - Mar 24 11:36:00 2006

joe_photog wrote:
> First off I am new to writing in C language, so I apologize for my
> lack of sure footedness in that area.  I work for a school that uses

Your question does not relate to C. Your question does not relate
to the MC68HC11. Your question relates to the startup code for
the particular compiler you are using. So, on all counts you are
in the wrong place. You need to be asking the ICC11 people.
to get

However...

I looked up the spec's on that board, and it has a crystal frequency
of 9.8304MHz. In order to get the Baud rate you want, you need
E-clock / 16 / BaudDivisor = 9600, or in your case
2.4576 / 16 / Divisor = 9600, giving Divisor = 16. Putting $04 into
BAUD does exactly that, so this is the correct value.

[snip]

> How can I change the __HC11Setup so that it loads a #$0004 and not
> #$0030?  The people above me have talked to ImageCraft and said write
> a new __HC11Setup.  I have changes to the HC11.H file and put the 0x04
> where is say BAUD9600 =, but to no avail.  Does anyone have the ICC11
> working with the Axiom CMD-711EX Board or can shed any light on the
> situation?  Thanks in advance of any pointers or help.

There are at least two ways you can accomplish what you want.
One is to modify the startup code (as suggested), and the other
is to put a single line of code at the beginning of main() which
sets BAUD the way you want.

The first I mentioned is the "right" way, but requires rebuilding
your startup code, which I don't know how to do, since I'm not
familiar with your build environment. Just changing a #define in
a text file #included when you compile your source is not going
to change the startup used by the compiler. Somewhere you should have
a file named something like crt0.s or crt0.asm or similar. Anyway,
this is the file which contains the source for __HC11Setup.

You need to reassemble this, and put it where your compiler will
use the new object file, possibly by putting it into a library using
a librarian, or possibly just by copying it to some special location.
You also need to modify *all* the #defines in the HC11.H so your
other code will work.

The second way requires no intimate knowledge of the toolset whatever.
Somewhere in HC11.H you will find the definition of the BAUD register.
Simply place a line in your main() which says

	BAUD = BAUD9600;

or whatever the #defined value is called for that Baud rate. Or you
could put that line in a function you call like this:

void	InitSCI(void) {
	BAUD =  BAUD9600;
}

which you then call from main(). This is a little bit cleaner, because
later if you want to use interrupts or whatever with the SCI, you'll
need one to do your setup for you, anyway.

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!



(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )

Re: Axiom CMD-711EX and ImageCraft ICC11 Baud Problems - joe_photog - Mar 24 12:51:00 2006

Mike,

Thanks.  I did edit the crt11.s file but fell for the stupid I forgot
to recompile trick.  Once I did recompile things worked.  Thanks again
the fresh set of eyes always solves the problem.

JoeD

Hey, is that a forest over there. I can't see it there are trees in
the way.
	


(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )