Programming PIN MC9S12NE64

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Programming PIN MC9S12NE64

5,968 Views
PsychoDebugger
Contributor I
Hi all,

       I want to know which PIN are required for downloading code.
I'm going to use serial port for programming. Do I need to connect MISO MOSI pin?
I hope not...
Labels (1)
0 Kudos
Reply
14 Replies

1,743 Views
mjbcswitzerland
Specialist V
Hi

If you mean which pin switched the serial monitor (when loaded) to debug/download mode it is either PG4 or UART RxD0. Pulling either to GND on reset will enter the mode.

Regards

Mark

www.uTasker.com

0 Kudos
Reply

1,743 Views
Raffaele
Contributor I
Hi All!! I'm new gust of this forum. Maybe I have the some trouble with MC9S12NE64. I have connected pins 30 and 31 (112 pins micro) to ST3232 driver. The same connection shown on EVB9S12NE64 board.
When I try to download code, the code warrior shows me error message by connection or no power....
Did I miss some electronic configuratios on the micro? Do some pins need pull up or pull down?
I dont have any idea...
Thank for you kind attention
Raffaele

0 Kudos
Reply

1,743 Views
mjbcswitzerland
Specialist V
Raffaele

It depends on whether the NE64 on your board has the Freescale Serial Monitor loaded in FLASH or not.
If it does, you can program over SCI0 and to do this, the LOAD switch needs to be set to force the NE64 to run the serial monitor. If there is no application loaded the serial monitor will also start automatically.

If you do not have the serial monitor loaded you can only communicate using BDM (Background debug mode).
When loading an application using BDM it will also overwrite any Freescale Serial Monitor previously loaded in FLASH.

For some more details see also the application note about converting an NE64 demo board into a BDM - find it on the following page: http://www.utasker.com/docs/documentation.html

Regards

Mark

www.uTasker.com

0 Kudos
Reply

1,743 Views
Mayuwi
Contributor I
Hello:

I'm a litle confused with programming in Monitor mode, the switch RUN/LOAD only need PG4 pin? or it can be other pin? NOTE AN2548 describes S12SerMonxrx.def to define SwPort,Switch,SwPullup,mSwPullup . I've read in other application pin PG4 is used for switch RUN/LOAD , is this pin for default ? Is there a register to change that .

Regards

Vanessa
0 Kudos
Reply

1,743 Views
mjbcswitzerland
Specialist V

Hi

 

The debug mode is entered when either PG4 is held low out of reset, or when the SCI0 Rx is held low.

 

If you can find the serial monitor code (it is available somewhere - possibly in SW package to the app.note) this is visible in the assembler code. If you can reassemble this code and load it via BDG you can also define different pins to be used.

 

Regards

 

Mark

 

www.uTasker.com

 

0 Kudos
Reply

1,743 Views
PsychoDebugger
Contributor I
I downloaded your utility (NE64_deb) and your sw (zip file with BDM_ne64.s19).
I opened your utiliyu it seems to works because i see the registers,
but i don't understand how to download the file BDM_ne64.s19.

0 Kudos
Reply

1,743 Views
mjbcswitzerland
Specialist V
Hi

Yes, if you see the registers that means that it is communicating correctly.

There are instructions to downloading in the uTasker tutorial:
 http://www.utasker.com/docs/NE64/uTaskerV1.2-Tutorial.PDF
Page 8/24

However the tool expects the file to be called "ETHERNET.s19" and to be in the same directory as the exe. So copy it there and rename it, and then you can download it by simply executing "Delete Program and program new" 
in the FLASH menu.

To use your device as BDM to another device you will also need to load the web pages via FTP. This is described in the application note.

Good luck.

Regards

Mark


0 Kudos
Reply

1,743 Views
PsychoDebugger
Contributor I
Ok I renamed the file... I was searching for something like "open file..".

Anyway the http server works fine but my own board doesn't.

I have uploaded the sofware on my demo,
the http server e ftp server works fine.
The reset command works too.
When I try to upload the N_FreescaleSerialMonitor.bin
the server says it's all' right,
but the PC register value is 0xffff.

I think the .bin is not uploaded correctly and so
my board doesn't respond yet at serial cable.

What can be?


Message Edited by PsychoDebugger on 2007-07-16 03:29 PM
0 Kudos
Reply

1,743 Views
mjbcswitzerland
Specialist V
Hi

The simplest way to check whether the serial monitor has really been loaded to your new board is to use a memory display window.

Set the address to 0xf800 and look to see whether the memory is still blank (all 0xff). You can compare the content with the N_FreescaleSerialMonitor.bin content.

If you reset the target and write the PC to 0xf800 (assuming code has really been correctly copied) you should be able to step through the code and see that it performs some instructions (there is a small loop at the start which is easy to identify).

If your target hardware has never worked before your should check that all voltages are accurate and that its clock is operating correctly. If there are problems it is also possible that uploads do not work as expected.

Good luck

Mark

0 Kudos
Reply

1,742 Views
PsychoDebugger
Contributor I
Nothing...
I have controlled the voltages and  clock at 25 MHz.
I set the RUN/LOAD switch (on my board) on LOAD also if I think this is not important for BDM:
I see with oscilloscope the signal arriving from the programmer board into my micro.
The software says ok.

A strange thing... also if I don't connect the programmer board
to my own board the software says it's all ok.

Is not there any handeshaking in BDM protocol?



Message Edited by PsychoDebugger on 2007-07-17 11:00 AM
0 Kudos
Reply

1,743 Views
mjbcswitzerland
Specialist V
Hi
The BDM protocol doesn't have handshaking at the lowest level (it is a one-wire connection) and relies on the timing being correct.
When performing a download the success message says that the file was correctly received and copied. It can't guarantie that the device actually programmed. To do this is is best to read back the FLASH.
In your case it really seems as though the BDM is not working or is not connected correctly. It is possibe to verify this before downloading and downloading only makes sense when the connection is known to be good.

1. The target must be in BDM mode. This is entered by performing the reset command on a fresh chip but it is advisable to perform Force Debug Mode since this will ensure that BDM is entered, whatever mode the target is presently running in.
2. Display the internal registers (address 0) to be sure that it is really operational. There is a screen shot of a typical display in the document (note that at one location - 0x22 I think - there is a timer which counts so this will seen to be incrementing on each refresh). Note that it is also possible to see that the device has been forced into BDM mode since the PC always gets set to a 'strange' value like 0x4a4c - I don't remember the exact value at the moment but once you have seen it working you will recognise it.

At this point downloads should then work correctly.

If you can't get into debug mode then you will need to verify that the debug connector wiring is correct. It should have a ground, a reset line and a DBM line. All should be conected to ensure that the background mode can be forced and that the signals are clean. If you can look at the signals with an oscilloscope you can verify that your board is generating them correctly.

I hope you find the problem.

Regrards

Mark
0 Kudos
Reply

1,743 Views
PsychoDebugger
Contributor I
Thank you very much of interesting in my case.

With my oscilloscope I see the signal from the "BDM programmer",
but the flash on target doesn't respond (or is always erased).

Maybe my target is not in BDM mode, and so I cannot program flash.
I pull MODA , MODB PIN to ground (i have to do anytihn else?)
Does the software send Hardware command or only Firmware command?

Maybe the target Flash is protected.
Is there a way to control it ?
Does the software unlock the flash when i try to erase it?




Message Edited by PsychoDebugger on 2007-07-17 04:37 PM
0 Kudos
Reply

1,743 Views
mjbcswitzerland
Specialist V
Hi

If you use the Force Debug command it should always go into the BDM mode. This method uses also the RESET signal rather than just the BDM signal.

If your FLASH is protected it should still be possible to perform a bulk erase command, after which it will be unprotected. I have has such a case and this solution worked correctly.

Do you have a known working board to test with to verify that otherwise the tools are operational?

Looking at the NE64 DEMO circuit, the MODC (BDM) is pulled up with 4k7 to 3V3. MODA and MODB are left non-connected. I don't however know whether they are relevant for the BDM.

Regards

Mark



0 Kudos
Reply

1,743 Views
PsychoDebugger
Contributor I
MODC is pulled up, MODA e MODB are now disconnected again.
Reset signal works fine, but flash doesn't.

I have no idea yet.
I have not another board to try and so I'll wait it.

Thank you very much Mark




0 Kudos
Reply