Failure of 68HC908KX8 Monitor Mode

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Question: Is it possible to somehow disable the KX8's monitor mode by
means of an application loaded into its flash memory?

My setup as follows: I built a MON08 circuit as per circuit on page
193 of 68HC908KX8.pdf. I used a 74HC04 inverter with 9.8304MHz
crystal, and constructed the circuit on Veroboard.  All voltage levels
on the device measures OK, as well as the clock signal.  I proceeded
to upload the bootloader as contained in AN2295 using prog08sz, but
never managed to get it working in conjunction with hc08sprg.exe (HC08
never ACK'ed on power reset).  I then erased the device and compiled a
small test program derived from AN2616 page 26, using Metrowerks
CodeWarrior.

I then uploaded the file named P&E_FCS.abs.s19, and straight after
that I lost all control with the device from within prog08sz.  I could
not establish a connection with the device again through the MON08
interface. Even in Hyperterminal I do not see double echo characters
coming back from the micro, only 1 byte is echoed back.  I checked my
voltage levels on IRQ1, etc, but to no avail.  I inserted another
virgin device into my MON08 circuit, and it functions without
problems.  But the original device seems to be unable to enter into
monitor mode.

Surely uploaded firmware should not preclude the use of the monitor
mode, especially if one presets IRQ1, PTA0, PTA1, PTB0 and PTB1
externally, and use an external oscillator?  Why would this upload
cause one to lose control of the device in monitor mode?  What did I
do wrong?  Please advise.

Thank you.

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it

  Does your application alter the vectors from 0xf6 to 0xfd?
These are also used as security bytes that have to be sent
to enable the user flash memory.
  I am not familiar with the development software you're
using: I wrote my own monitor mode programming software
that runs on gnu/linux and FreeBSD. My software has a
command line switch to load an eight byte security file.
  How does the software you're using handle the security
bytes?

Ian
--
Ian Stirling, G4ICV, AB2GR

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it

oops .. I meant 0xfff6 to 0xfffd

Ian
--
Ian Stirling, G4ICV, AB2GR


Re: Failure of 68HC908KX8 Monitor Mode
Quoted text here. Click to load it

Hi Ian

Thank you for the post.  The problem I am experiencing occurs before
one sends the security bytes to the KX8.  When using the MON08
interface in conjunction with P&E software prog08sz, the software
executes a series of steps to ascertain whether the KX8 can be
accessed.

Step 1 is to check for hardware loopback on the serial channel.  Step
2 is to check whether the KX8 echo's all bytes sent to it - in this
case it would be the 8 security bytes.  When one uses e.g. Windows
Hyperterminal connected to the KX8 via MON08 circuit, one would
normally see double characters echoed for each character sent to the
MON08.  The first echo will be hardware loopback, and the second will
be the KX8 echoing (the KX8 being in monitor mode).

In my case the second step fails, i.e. I see only 1 character being
echoed due to hardware loopback.  Seems like the KX8 has turned deaf -
something aint right...

Regards
Jack

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it

Hi Jack,

  I read your original post again and in it you said
that you erased the KX8 after putting the AN2295
software in it.  Erasing is a monitor function and is
possible without the correct security code being sent.
  When the security block is written, reset isn't
sufficient to recognise the new security data sent by
the host - the hc908 has to be power cycled.

Ian
--
Ian Stirling, G4ICV, AB2GR



Re: Failure of 68HC908KX8 Monitor Mode
Thanks for your last response Ian.

Your first statement is correct.  However, I suspect that I will not
be able to communicate with the KX8 since I do not see any bytes
echoed by the KX8 itself when in monitor mode.  In other words, it
does not seem as if the monitor mode code (which is in ROM) is able to
echo characters, let alone accept a Flash erase command.

As far as your second statement is concerned, I have tried
communicating with the KX8 multiple times, after having power cycled
it several times.  The SAME circuit operates flawlessly with another
virgin KX8 device.

After I programmed the KX8, the controlling/programming software
IMMEDIATELY lost control of the device.  It seemed as if the flash
program started running right after programming it and took control
from the monitor mode even though the monitor mode setup pins were
still set up to force the device into monitor mode.

I had the following code in main():

void main(void) {

   EnableInterrupts;
   DDRA_DDRA = 0x1f;   // configure as output
   DDRB_DDRB = 0x00;   // configure as input

   for(;;) {

    __RESET_WATCHDOG();
    PTA_PTA0 = PTB_PTB0;    // light LED on PTA0 when button on PTB0
is pressed

   }
}

Now keep in mind that, after having been programmed, the KX8 would
still be installed in the MON08 circuit wherein the serial line from
the MAX232 would be connected to PTA0.  I have configured PTA as an
output in my code.  Does a program start to run as soon as one has
programmed it, even though control pins is supposed to force it into
monitor mode?  If yes, could it be that the PTA0 line was destroyed
because, configured as an output by the flash code, the PTA0 line
would have driven into the output from the MAX232 line?

Apologies for these communications, but this is my first attempt at
68HC908 programming, and I am very hesitant to program another device,
fearing that I might again destroy it.

Regards
Jack

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it

Hi Jack,

  It is unlikely that PTA0 is destroyed - it is never connected
to the MAX232 RS232 lines.
 On page 258 of the KX8 manual, there is a diagram of a monitor
mode circuit. PTB0 should be tied high, PTA1 low, PTB1 low and
IRQ1 at the Vtst voltage. These are all necessary conditions
with Motorola's KX8 example circuits to enter monitor mode when
the reset vector is not 0xffff.
  When the reset vector is 0xffff, the conditions of PTB0 and
PTB1 do not matter (page 257), and you appear to have no
problem programming a blank KX8.

  Having your test application use the monitor mode configuration
pins might be a problem - e.g., is PTB0 high on attempting to go
into monitor mode with a non blank reset vector?

With monitor mode conditions applied, user code will not run.
 I find it easier to use my board as a monitor mode
programming board and move the device to another circuit
to test application code.

Ian
--
Ian Stirling, G4ICV, AB2GR

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it


 Be advised that there are some more-specific Freescale HC08 NGs:
http://groups.yahoo.com/group/68HC05_08 /
http://groups.yahoo.com/group/hc08 /
codewarrior.embedded
also Metrowerks.com >> support >> community >> forums will lead you to a
number of CodeWarrior forums

There's also a brand-new NG that leans a bit toward Freescale:
http://groups.yahoo.com/group/MicrocontrollerWorld /


They should be able to help you too.

Gary



Re: Failure of 68HC908KX8 Monitor Mode
Quoted text here. Click to load it

Thank you Gary - I will follow up.
Ian, I have triple-checked my MON08 circuit to see if the pins are set
up correctly for normal monitor mode entry, and all seem fine.
I will now test my IC in a target test circuit to see if it actually
runs off the flash code.
Also, I am in constant communication with a support guy at Freescale
who is also in the process of helping me sort out this issue.
I will advise as soon as I am able to resolve this.
Regards
Jack

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it

I cannot offer any direct advice on your problem. My involvement with the
HC08/HC12 is redoing Valvano's HC11/HC12 Using C with Hiware, etc. tutorial
by adding some CodeWarrior documentation to it plus some of my own
rewriting. It's about 1/2 redone at this point.


Gary



Re: Failure of 68HC908KX8 Monitor Mode
Jack,
 I'm the owner of the MicrocontrollerWorld gropu.  There is a guy in
my group called Iceman that works a lot with the 908 and probably
knows exactly what the problem is.  Either try contacting him through
the group or just email me and I'll get you his email address after I
talk to him.  I want to respect him if he wants his privacy.   But
he's definately the guy.

Michael
Quoted text here. Click to load it

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it

Hi Jack,

  I look forward to your resolving the problem and I'm interested
in what the problem is: I am out of ideas now.
  My own board with sockets wired up for monitor mode with
the GP32, GR8, JL3, JK3, QT, QY, KX8 and JB8, all 0.1 inch
pitch PDIP versions, works faultlessly with my own gnu/linux
and FreeBSD software. The software identifies the processor on
board, except for the JB8 so far because I haven't added a 6 MHz
clock to the board yet.  When I do that and write the documentation,
 I'm going to put all the source code on my web site under the GPL.
   My MC68HC705C8A programming software seems to be still very
popular three years after I released it. Given that that processor
is obscure, my 908 software should be even more popular.
  I just wish more than two people out of thousands who downloaded
the software would have contacted me.

Best Wishes,
Ian
--
Ian Stirling, G4ICV, AB2GR

Re: Failure of 68HC908KX8 Monitor Mode
Quoted text here. Click to load it

Hi Ian
According to Freescale it might be the absence of the 74HC125 buffers
that might be the issue (I am using wired OR on the PTA0 line), as
well as possibly timing between the reset pulse and the application of
Vtst on IRQ line...I will check it out over the weekend and advise.
Regards
Jack

Re: Failure of 68HC908KX8 Monitor Mode

Quoted text here. Click to load it

Hi Jack,

  My board is based on the "Simpler Monitor Mode Circuit",
figure 5 in AN2317. It uses a diode instead of the 74HC125.
The rest of the wiring is from the individual processors'
manuals for configuring specific pins.
  I made a separate MAX232 board that connects to the board
with five wires, the fifth to give the MAX232 V+ voltage
for the Vtst voltage. It's all described in AN2317.

Ian
--
Ian Stirling, G4ICV, AB2GR

Site Timeline