Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Ads

Discussion Groups

Discussion Groups | 68HC12 | MC9S12DP256B - Serial Bootloader - AN2153

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

MC9S12DP256B - Serial Bootloader - AN2153 - Kai Schneider - Aug 18 3:39:00 2004

Hello,

I am searching for a serial Bootloader for the MC9S12DP256B. On the
Freescale website I found the AN2153. (Serial Bootloader for Reprogramming…)
Has somebody of you implemented this Bootloader with the Code Warrior? Does
it work?

Does somebody know an <http://dict.leo.org/?p=2Ib6..&search=alternative>
alternative <http://dict.leo.org/?p=2Ib6..&search=solution> solution, for
example in C?
Thanks for your answers!

Mit freundlichen Grüßen / Kind regards
FRIEDRICH LÜTZE GmbH & Co.KG

Kai Schneider
Entwicklung

Bruckwiesenstr. 17-19
D-71384 Weinstadt
Tel.: +49 (0) 7151 / 60 53-361
Fax: +49 (0) 7151 / 60 53-6361
email:

Besuchen Sie uns im Internet: <file:///\\www.luetze.de\> www.luetze.de [Non-text portions of this message have been removed]





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


Re: MC9S12DP256B - Serial Bootloader - AN2153 - Oliver Betz - Aug 19 4:23:00 2004

"Kai Schneider" <> wrote:

> I am searching for a serial Bootloader for the MC9S12DP256B. On the
> Freescale website I found the AN2153. (Serial Bootloader for Reprogramming )
> Has somebody of you implemented this Bootloader with the Code Warrior?

no, because it has some disadvantages, see my mail dated 2004-08-11.

> Does it work?

Why not? Although it contains some strange code portions, e.g. the
complicated "switch to RAM" which I don't think to be necessary. The
interrupt driven TX routine is also unnecessary.

If you have CW, it should be simple to try out.

> Does somebody know an <http://dict.leo.org/?p=2Ib6..&search=alternative>
> alternative <http://dict.leo.org/?p=2Ib6..&search=solution> solution, for
> example in C?

I asked the same 2004-08-11, and got no satisfying reply. So I
started to roll my own, with smaller file format (base64 instead of
Motorola hex), no need for handshake and likely encryption.

Oliver
--
Oliver Betz, Muenchen





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

FPROT in HCS12C32 - Peter Lissenburg - Aug 19 7:43:00 2004

Hi all,
I'm trying to use the first 2 sectors of FLASH as EEPROM.
And so I need to unprotect the address range 0x8000 to 0x83FF
I have used the value 0x61 in the FPROT register
But I am getting a PVIOL error.

The 0x61 is derived from
* FPOPEN = 0, this sets the scheme to "unprotect",
* NV6 = 1,
* FPHDIS = 1, because of this FPHS1 and FPHS0 = x don't care
* FPLDIS = 0, as we want to unprotect in the lower region
* FPLS1 = 0 and FPLS0 = 1, to make it the first 1k
* so the FPROT register => 0110 0001 => 0x61

I note that the
FTS32K Block User Guide V01.03
On page 22 referes to memory ranges of $4000 to $4FFF
But in the C32 the FLASH starts at $8000
I assume this is a typo, or cut and paste error.
Or have I missed something?

Can anyone spot the error or point me in the right direction?

All suggestions appreciated.
Thanks.
Peter L.





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

Re: FPROT in HCS12C32 - Doron Fael - Aug 19 8:47:00 2004

Peter,

This no typo in the document.
The MC9S12C32 has the Flash arranged as follows:

One 16K Flash portion is always accessible at $C000 - $FFFF.

A second 16K Flash portion is always available at $4000 - $7FFF, provided
that the MISC ROMHM bit is cleared (default condition after Reset).

The $8000 - $BFFF address range can access either one of the above two 16K
Flash portions: When PPAGE is initialized to an odd number the $C000 -
$FFFF Flash portion is also available through $8000 - $BFFF. When PPAGE is
initialized to an even number the $4000 - $7FFF Flash portion is also
available through $8000 - $BFFF.

This behavior is in order to provide compatibility with the larger HCS12
parts, to allow the MC9S12C32 to also work in a banked environment if needed.

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 22:43 19/08/2004 +1000, you wrote:
>Hi all,
> I'm trying to use the first 2 sectors of FLASH as EEPROM.
>And so I need to unprotect the address range 0x8000 to 0x83FF
>I have used the value 0x61 in the FPROT register
>But I am getting a PVIOL error.
>
>The 0x61 is derived from
> * FPOPEN = 0, this sets the scheme to "unprotect",
> * NV6 = 1,
> * FPHDIS = 1, because of this FPHS1 and FPHS0 = x don't care
> * FPLDIS = 0, as we want to unprotect in the lower region
> * FPLS1 = 0 and FPLS0 = 1, to make it the first 1k
> * so the FPROT register => 0110 0001 => 0x61
>
>I note that the
>FTS32K Block User Guide V01.03
>On page 22 referes to memory ranges of $4000 to $4FFF
>But in the C32 the FLASH starts at $8000
>I assume this is a typo, or cut and paste error.
>Or have I missed something?
>
>Can anyone spot the error or point me in the right direction?
>
>All suggestions appreciated.
>Thanks.
>Peter L. >Yahoo! Groups Links
[Non-text portions of this message have been removed]





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

Re: FPROT in HCS12C32 - Peter Lissenburg - Aug 19 8:52:00 2004

Ahh ...
Doron,
Thank you very much.
It was starting to get to me...
Peter L.

At 04:47 PM 19/08/2004 +0300, you wrote:
>Peter,
>
>This no typo in the document.
>The MC9S12C32 has the Flash arranged as follows:
>
>One 16K Flash portion is always accessible at $C000 - $FFFF.
>
>A second 16K Flash portion is always available at $4000 - $7FFF, provided
>that the MISC ROMHM bit is cleared (default condition after Reset).
>
>The $8000 - $BFFF address range can access either one of the above two 16K
>Flash portions: When PPAGE is initialized to an odd number the $C000 -
>$FFFF Flash portion is also available through $8000 - $BFFF. When PPAGE is
>initialized to an even number the $4000 - $7FFF Flash portion is also
>available through $8000 - $BFFF.
>
>This behavior is in order to provide compatibility with the larger HCS12
>parts, to allow the MC9S12C32 to also work in a banked environment if needed.
>
>Hope this helps,
>Doron
>Nohau Corporation
>HC12 In-Circuit Emulators
>www.nohau.com/emul12pc.html
>
>At 22:43 19/08/2004 +1000, you wrote:
> >Hi all,
> > I'm trying to use the first 2 sectors of FLASH as EEPROM.
> >And so I need to unprotect the address range 0x8000 to 0x83FF
> >I have used the value 0x61 in the FPROT register
> >But I am getting a PVIOL error.
> >
> >The 0x61 is derived from
> > * FPOPEN = 0, this sets the scheme to "unprotect",
> > * NV6 = 1,
> > * FPHDIS = 1, because of this FPHS1 and FPHS0 = x don't care
> > * FPLDIS = 0, as we want to unprotect in the lower region
> > * FPLS1 = 0 and FPLS0 = 1, to make it the first 1k
> > * so the FPROT register => 0110 0001 => 0x61
> >
> >I note that the
> >FTS32K Block User Guide V01.03
> >On page 22 referes to memory ranges of $4000 to $4FFF
> >But in the C32 the FLASH starts at $8000
> >I assume this is a typo, or cut and paste error.
> >Or have I missed something?
> >
> >Can anyone spot the error or point me in the right direction?
> >
> >All suggestions appreciated.
> >Thanks.
> >Peter L.
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >[Non-text portions of this message have been removed] >Yahoo! Groups Links





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

Re: FPROT in HCS12C32 - Peter Lissenburg - Aug 19 10:57:00 2004

Hi again,
Thanks Doron, now that works. But...
now I get a ACCERR error , directly after I write to the
CBEIF flag in the FSTAT register to start the command.
I've poured over the "Illegal Flash Operations", I can't see where I'm
falling foul of them. But I must be doing so.
The code looks like....(from Compiler output)

ldab #48 /* to clear the Pvoil and ACCERR bits */
stab 0x105
ldy 2,x /* Address of data to write is on the stack */
ldd 6,x /* Data word is on the stack */
std 0,y /* Write the data word to the flash */
ldab #32 /* Write the program word command */
stab 0x106
jsr _RAMWaitFunction

_RAMWaitFunction
sei /* I''ll, have to change this, for other
reasons */
movb $80,$0105 /* Start the command by writing $80 to the
FSTAT reg */
brclr $0105,$80,. /* Loop here until it is done, but this is
when the error appears */
cli /* I''ll, have to change this, for other
reasons, As above! */
rts

I have single stepped through the code and checked that the FCLKDIV is
written to, and that the command is written OK. But once the FSTAT is
written to start the command, the error code appears in the FSTAT reg.
Again, any insight would be appreciated.
Thanks
Peter L. At 11:52 PM 19/08/2004 +1000, you wrote:
>Ahh ...
>Doron,
>Thank you very much.
>It was starting to get to me...
>Peter L.
>
>At 04:47 PM 19/08/2004 +0300, you wrote:
> >Peter,
> >
> >This no typo in the document.
> >The MC9S12C32 has the Flash arranged as follows:
> >
> >One 16K Flash portion is always accessible at $C000 - $FFFF.
> >
> >A second 16K Flash portion is always available at $4000 - $7FFF, provided
> >that the MISC ROMHM bit is cleared (default condition after Reset).
> >
> >The $8000 - $BFFF address range can access either one of the above two 16K
> >Flash portions: When PPAGE is initialized to an odd number the $C000 -
> >$FFFF Flash portion is also available through $8000 - $BFFF. When PPAGE is
> >initialized to an even number the $4000 - $7FFF Flash portion is also
> >available through $8000 - $BFFF.
> >
> >This behavior is in order to provide compatibility with the larger HCS12
> >parts, to allow the MC9S12C32 to also work in a banked environment if
> needed.
> >
> >Hope this helps,
> >Doron
> >Nohau Corporation
> >HC12 In-Circuit Emulators
> >www.nohau.com/emul12pc.html
> >
> >At 22:43 19/08/2004 +1000, you wrote:
> > >Hi all,
> > > I'm trying to use the first 2 sectors of FLASH as EEPROM.
> > >And so I need to unprotect the address range 0x8000 to 0x83FF
> > >I have used the value 0x61 in the FPROT register
> > >But I am getting a PVIOL error.
> > >
> > >The 0x61 is derived from
> > > * FPOPEN = 0, this sets the scheme to "unprotect",
> > > * NV6 = 1,
> > > * FPHDIS = 1, because of this FPHS1 and FPHS0 = x don't care
> > > * FPLDIS = 0, as we want to unprotect in the lower region
> > > * FPLS1 = 0 and FPLS0 = 1, to make it the first 1k
> > > * so the FPROT register => 0110 0001 => 0x61
> > >
> > >I note that the
> > >FTS32K Block User Guide V01.03
> > >On page 22 referes to memory ranges of $4000 to $4FFF
> > >But in the C32 the FLASH starts at $8000
> > >I assume this is a typo, or cut and paste error.
> > >Or have I missed something?
> > >
> > >Can anyone spot the error or point me in the right direction?
> > >
> > >All suggestions appreciated.
> > >Thanks.
> > >Peter L.
> > >
> > >
> > >
> > >
> > >
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> >
> >
> >[Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >Yahoo! Groups Links




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

Re: FPROT in HCS12C32 - Mike Elphick - Aug 20 7:38:00 2004

Peter,

You need to precede the dollar with hash when using immediate addressing
mode:-

movb $80,$0105 should be
movb #$80,$0105

Mike ----- Original Message -----
From: Peter Lissenburg
To:
Sent: Thursday, August 19, 2004 4:57 PM
Subject: Re: [68HC12] FPROT in HCS12C32 Hi again,
Thanks Doron, now that works. But...
now I get a ACCERR error , directly after I write to the
CBEIF flag in the FSTAT register to start the command.
I've poured over the "Illegal Flash Operations", I can't see where I'm
falling foul of them. But I must be doing so.
The code looks like....(from Compiler output)

ldab #48 /* to clear the Pvoil and ACCERR bits */
stab 0x105
ldy 2,x /* Address of data to write is on the stack */
ldd 6,x /* Data word is on the stack */
std 0,y /* Write the data word to the flash */
ldab #32 /* Write the program word command */
stab 0x106
jsr _RAMWaitFunction

_RAMWaitFunction
sei /* I''ll, have to change this, for other
reasons */
movb $80,$0105 /* Start the command by writing $80 to the
FSTAT reg */
brclr $0105,$80,. /* Loop here until it is done, but this is
when the error appears */
cli /* I''ll, have to change this, for other
reasons, As above! */
rts

I have single stepped through the code and checked that the FCLKDIV is
written to, and that the command is written OK. But once the FSTAT is
written to start the command, the error code appears in the FSTAT reg.
Again, any insight would be appreciated.
Thanks
Peter L. At 11:52 PM 19/08/2004 +1000, you wrote:
>Ahh ...
>Doron,
>Thank you very much.
>It was starting to get to me...
>Peter L.
>
>At 04:47 PM 19/08/2004 +0300, you wrote:
> >Peter,
> >
> >This no typo in the document.
> >The MC9S12C32 has the Flash arranged as follows:
> >
> >One 16K Flash portion is always accessible at $C000 - $FFFF.
> >
> >A second 16K Flash portion is always available at $4000 - $7FFF,
provided
> >that the MISC ROMHM bit is cleared (default condition after Reset).
> >
> >The $8000 - $BFFF address range can access either one of the above two
16K
> >Flash portions: When PPAGE is initialized to an odd number the $C000 -
> >$FFFF Flash portion is also available through $8000 - $BFFF. When PPAGE
is
> >initialized to an even number the $4000 - $7FFF Flash portion is also
> >available through $8000 - $BFFF.
> >
> >This behavior is in order to provide compatibility with the larger
HCS12
> >parts, to allow the MC9S12C32 to also work in a banked environment if
> needed.
> >
> >Hope this helps,
> >Doron
> >Nohau Corporation
> >HC12 In-Circuit Emulators
> >www.nohau.com/emul12pc.html
> >
> >At 22:43 19/08/2004 +1000, you wrote:
> > >Hi all,
> > > I'm trying to use the first 2 sectors of FLASH as EEPROM.
> > >And so I need to unprotect the address range 0x8000 to 0x83FF
> > >I have used the value 0x61 in the FPROT register
> > >But I am getting a PVIOL error.
> > >
> > >The 0x61 is derived from
> > > * FPOPEN = 0, this sets the scheme to "unprotect",
> > > * NV6 = 1,
> > > * FPHDIS = 1, because of this FPHS1 and FPHS0 = x don't care
> > > * FPLDIS = 0, as we want to unprotect in the lower region
> > > * FPLS1 = 0 and FPLS0 = 1, to make it the first 1k
> > > * so the FPROT register => 0110 0001 => 0x61
> > >
> > >I note that the
> > >FTS32K Block User Guide V01.03
> > >On page 22 referes to memory ranges of $4000 to $4FFF
> > >But in the C32 the FLASH starts at $8000
> > >I assume this is a typo, or cut and paste error.
> > >Or have I missed something?
> > >
> > >Can anyone spot the error or point me in the right direction?
> > >
> > >All suggestions appreciated.
> > >Thanks.
> > >Peter L.
> > >
> > >
> > >
> > >
> > >
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> >
> >
> >[Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >Yahoo! Groups Links





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

Re: FPROT in HCS12C32 - Peter Lissenburg - Aug 20 7:43:00 2004

AH,
so stupid of me,
thanks for pointing it out.
I have avoided looking at it for the last 24hours, in the hope of a fresh
set of eyes.
But now I'm sure it will be well.
In my post I mentioned that the code was from the compiler output, but
those few instructions are in-line ASM.
Thanks
PL
At 01:38 PM 20/08/2004 +0100, you wrote:
>Peter,
>
>You need to precede the dollar with hash when using immediate addressing
>mode:-
>
>movb $80,$0105 should be
>movb #$80,$0105
>
>Mike > ----- Original Message -----
> From: Peter Lissenburg
> To:
> Sent: Thursday, August 19, 2004 4:57 PM
> Subject: Re: [68HC12] FPROT in HCS12C32 > Hi again,
> Thanks Doron, now that works. But...
> now I get a ACCERR error , directly after I write to the
> CBEIF flag in the FSTAT register to start the command.
> I've poured over the "Illegal Flash Operations", I can't see where I'm
> falling foul of them. But I must be doing so.
> The code looks like....(from Compiler output)
>
> ldab #48 /* to clear the Pvoil and ACCERR bits */
> stab 0x105
> ldy 2,x /* Address of data to write is on the stack */
> ldd 6,x /* Data word is on the stack */
> std 0,y /* Write the data word to the flash */
> ldab #32 /* Write the program word command */
> stab 0x106
> jsr _RAMWaitFunction
>
> _RAMWaitFunction
> sei /* I''ll, have to change this, for other
> reasons */
> movb $80,$0105 /* Start the command by writing $80 to the
> FSTAT reg */
> brclr $0105,$80,. /* Loop here until it is done, but this is
> when the error appears */
> cli /* I''ll, have to change this, for other
> reasons, As above! */
> rts
>
> I have single stepped through the code and checked that the FCLKDIV is
> written to, and that the command is written OK. But once the FSTAT is
> written to start the command, the error code appears in the FSTAT reg.
> Again, any insight would be appreciated.
> Thanks
> Peter L. > At 11:52 PM 19/08/2004 +1000, you wrote:
> >Ahh ...
> >Doron,
> >Thank you very much.
> >It was starting to get to me...
> >Peter L.
> >
> >At 04:47 PM 19/08/2004 +0300, you wrote:
> > >Peter,
> > >
> > >This no typo in the document.
> > >The MC9S12C32 has the Flash arranged as follows:
> > >
> > >One 16K Flash portion is always accessible at $C000 - $FFFF.
> > >
> > >A second 16K Flash portion is always available at $4000 - $7FFF,
>provided
> > >that the MISC ROMHM bit is cleared (default condition after Reset).
> > >
> > >The $8000 - $BFFF address range can access either one of the above two
>16K
> > >Flash portions: When PPAGE is initialized to an odd number the $C000 -
> > >$FFFF Flash portion is also available through $8000 - $BFFF. When PPAGE
>is
> > >initialized to an even number the $4000 - $7FFF Flash portion is also
> > >available through $8000 - $BFFF.
> > >
> > >This behavior is in order to provide compatibility with the larger
>HCS12
> > >parts, to allow the MC9S12C32 to also work in a banked environment if
> > needed.
> > >
> > >Hope this helps,
> > >Doron
> > >Nohau Corporation
> > >HC12 In-Circuit Emulators
> > >www.nohau.com/emul12pc.html
> > >
> > >At 22:43 19/08/2004 +1000, you wrote:
> > > >Hi all,
> > > > I'm trying to use the first 2 sectors of FLASH as EEPROM.
> > > >And so I need to unprotect the address range 0x8000 to 0x83FF
> > > >I have used the value 0x61 in the FPROT register
> > > >But I am getting a PVIOL error.
> > > >
> > > >The 0x61 is derived from
> > > > * FPOPEN = 0, this sets the scheme to "unprotect",
> > > > * NV6 = 1,
> > > > * FPHDIS = 1, because of this FPHS1 and FPHS0 = x don't care
> > > > * FPLDIS = 0, as we want to unprotect in the lower region
> > > > * FPLS1 = 0 and FPLS0 = 1, to make it the first 1k
> > > > * so the FPROT register => 0110 0001 => 0x61
> > > >
> > > >I note that the
> > > >FTS32K Block User Guide V01.03
> > > >On page 22 referes to memory ranges of $4000 to $4FFF
> > > >But in the C32 the FLASH starts at $8000
> > > >I assume this is a typo, or cut and paste error.
> > > >Or have I missed something?
> > > >
> > > >Can anyone spot the error or point me in the right direction?
> > > >
> > > >All suggestions appreciated.
> > > >Thanks.
> > > >Peter L.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >[Non-text portions of this message have been removed]
> > >
> > >
> > >
> > >
> > >
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >Yahoo! Groups Links




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