Sign in

username:

password:



Not a member?

Search hc11



Search tips

Subscribe to hc11



Ads

Discussion Groups

Discussion Groups | M68HC11 | Re: static config reg can not be changed

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

Re: static config reg can not be changed - Mark Schultz - Sep 21 13:10:00 2004

Note to John Beatty: See end of this message for a suggestion for a
JBug enhancement.

--- In , "jackson_cp" <jackson_cp@y...> wrote:
> Thank you for the information. I have tried the sane thing, but
> unfortunately it is giving some error.
>
> 1. First I have tried to change the CONFIG register using the
> command F 1030 +0 7F
> But it gave a error message in the popup window Echo error
> writing RAM
> 2. Second I have experimented with AUTOSTART macro. But that
> also give an error message
> F 103F +0 7F
> cannot be used to write config
> F 1030 +0 7F
> Writing control regs 1030..1030
> Diagnostics for : Echo error writing RAM
>
> What would be the problem here. In our hardware we have mapped
> only External SRAM from the location 0x8000-FFFF. No other memory
> mapping is changed.
> Could you please find out what went wrong here.

Ok, now I remember why I used the approach I did to initialize my
system.

The procedure I outlined in my earlier message is not the procedure
I actually use to initialize my 'F1 target. Instead, I wrote a
small program using the JBug mini-assembler to perform my
initialization. It is a bit more complex to set up than the
procedure I outlined earlier, but it avoids the errors that you are
getting.

Here's how to go about it:

Invoke the JBug mini-assembler:

A 200

Now, enter a small program that initializes your target. At a
minimum, add the instructions necessary to initialize the CONFIG
register:

0200 > LDAA #$7F
0202 > STAA $103F
0205 > (add any additional instructions to init registers here)
...
0220 > NOP
0221 > BRA $0220
0223 >

Obviously, you can use a different start address for this program if
you like.

Note that the end address of your init program ($0223) will likely
be different from the example shown above. Take this into account
when following the instructions below.

Now, save your init program:

SV 200 222 d:\path\to\project\dir\Init.REC

You can test your init program if you like:

G 200

Use the JBug S(top) command to stop it. Use the appropriate JBug
commands (R, MM, L, etc.) to verify that the register(s) you
attempted to change have been appropriately modified.

Now, create the following macro and save it in your project
directory:

DEFM AUTOSTART
BEGIN
S ;Stop CPU if running
LD d:\path\to\file\Init.REC ;Load init program
G 200 ;Start it
PAUSE 100 ;100mS delay, wait for completion
S ;Stop it now
END

After saving the macro, configure JBug to auto-load it at startup,
as you did before.

I *know* that the method I've outlined above works, because it is
the actual approach that I use to initialize my target.

------------------

One feature I'd like to see added to JBug is a *command* that would
allow one to turn on and off the "Ignore echo errors on writing"
configuration option. The command keywords I would suggest would
be "WVOFF" to turn the write-verify feature off, and "WVON" to turn
it on, and perhaps a "WVDEF" command to reset the write-verify
option back to the default as specified in Settings. Alternatively,
a single command (e.g. "WV") that accepts a numeric parameter
(0=Off, 1=On, >=2 default) could be provided instead. These
commands would be particularily useful in macros such as the one I
described in my prior message on this topic. It would also be
useful for general debugging, esp. if one is performing tests or
experimenting with register settings. Many HC11 (and peripheral
device) registers do not read back the same value as written. The
write-verify feature is more of an annoyance than a feature when
performing write operations on them. However, the write-verify
feature *is* useful as a means to ensure that JBug is working
properly, thus it is usually desriable to have this feature turned
on.





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