Combined TBDML/OSBDM Code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Combined TBDML/OSBDM Code

26,679 次查看
pgo
Senior Contributor V
Dear HCS12/HCS08 users,

I use a HCS12 processor board in undergraduate labs.  To support programming these we made a number of TBDML programmers.  It was reasonably straightforward to extend the use of these to HCS08 through some simple modification of the OSBDM code.  Unfortunately, this had the disadvantage of requiring the flash in the programming hardware to be changed when moving between programming HCS12 and HCS08 devices.

There has been some discussion on these forums about combining the OSBDM and TBDML code to produce a single more flexible programmer.

To make this easier I have produced a combined version of the TBDML/OSBDM code.  It is also necessary to have a modified windows driver file TBDML.dll so that Codewarrior will talk to the modified BDM which identifies itself as an OSBDM.  The OSBDM windows driver file remains unchanged since the software remains compatible with TBDML (at least as far as HCS08 devices).
This code is attached along with brief instructions.

Please let me know if this is useful or if you have other comments - preferably through this discussion board.

Good Luck!


USBDM_Snapshot_2008_2_19.zip


Message Edited by pgo on 2008-02-19 07:10 AM

Message Edited by pgo on 2008-02-19 07:10 AM
Message Edited by t.dowe on 2009-07-28 11:21 AM
0 项奖励
回复
88 回复数

1,533 次查看
pgo
Senior Contributor V

Dear carloscuevas,

 

I'm sorry the USBDM code is very much JB16 specific and would not fit in a JB8 in any case.

 

The original TBDML code is for a JB8 but only supports HC12 devices.  See

http://forums.freescale.com/freescale/board/message?board.id=TBDML&thread.id=2

 

It also appears that Freescale no longer have the JB16s available in their sample program.

 

Farnell and Digi-key both have JB16s but shipping might well be excessive.

 

Sorry I can't be of any real help!

 

bye

 

0 项奖励
回复

1,533 次查看
Macias
Contributor I

 

Dear Pgo,
My hardware is this same as TBDML minimal.
I attache usbdm_dll.log. I tryed to use precompiled software but I have the same errors.

Best Regards,
Maciej Bojczuk

 

 

usbdm_dll.txt

Message Edited by t.dowe on 2009-08-31 02:26 PM
0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V
Dear Macias,

The log your provided indicates that the hardware has been programmed with the USBDM_JB16.s19 flash file or your modified version.  It is indicating the wrong hardware capabilities to the driver.

Could you program the hardware with the pre-compiled TBDML_JB16.s19 file and repeat the process please.

If you get the same error message on connect:
extendedConnect() - 1st attempt
============================
USB EP0 receive request (CMD_CONNECT, size=1):
01 1F 00 00 00 00
USB EP0 receive: Cmd Failed (Reset pin timeout):
USB EP0 receive (size = 1, recvd = 1):
13
then this would indicate something wrong with the reset circuitry.
(The above message indicates that the reset pin is staying low or high too long.)

bye


Message Edited by pgo on 2009-02-01 11:20 PM
0 项奖励
回复

1,533 次查看
Macias
Contributor I
Dear Pgo,
I programm my hardware with you pre-compiled TBDML_JB16.s16 and check it with your schematic, everythink is correct. Setboot.exe was recognized my hardware as TBDML (minimal).

I tryed to repet process, but I get the same error. It's possible that this error is connected with my logic buffer? I using 74HCT125.

Regards,
Maciej



Message Edited by Macias on 2009-02-01 04:21 PM

 

usbdm_dll.txt

Message Edited by t.dowe on 2009-08-31 02:22 PM
0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V

Dear Macias,

I believe the 74HCT125 should be fine if the target is at 5V.

I've attached a modified Flash file and utility command to allow you to check the interface more easily.  You will need a logic probe or a multimeter to check the physical levels on the target pins

The testinterface command allows direct control of the RESET and BKGD pins and reports the input values measure.  These should agree!

Try the following commands & checks after updating the flash:
=============================================
settarget 0
testinterface 0 -- Check that RESET & BKGD = 0 & 0 and measure correctly.
testinterface 1 -- Check that RESET & BKGD = 0 & 1 and measure correctly.
testinterface 2 -- Check that RESET & BKGD = 1 & 0 and measure correctly.
testinterface 3 -- Check that RESET & BKGD = 1 & 1 and measure correctly.
exit

If the pins measure incorrectly then check your output buffers.
If the pins measure correctly but are REPORTED incorrectly then check the input buffers.
In either case check the following:
Pull-up resistors on the target RESET pin.
Power on the target and 74HCT125 buffer.
3-state control signals are as expected.

That's about as far as I can go by remote control :smileyhappy:

Good Luck.

bye

Special.zip

Message Edited by t.dowe on 2009-08-31 03:09 PM
0 项奖励
回复

1,533 次查看
Macias
Contributor I
Dear Pgo,
Thank you very much!

I found hardware problem 74hct125 was broken.
now I've another problem when I trying to enable PLL (with external crystal 12MHz) in JM60 (bus speed 24MHZ) debbuger was stoped at this line: while(!MCGSC_OSCINIT) { /* Wait until external reference is stable */}
When I select internal oscilator (bus speed 16MHZ) everything works fine, but I see something strange in debugger window, When I reset target and click "Step Over" button debbuger made one step but a moment later debbuger start executing random commands (halt, step over, step out, step in). This problem disappears when I change bus speed to 8MHz.
I'm using Processor Expert.

Regards,
Maciej Bojczuk


Message Edited by Macias on 2009-02-02 10:53 PM
0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V
Dear Macias,

The JB16 BDM is limited in the maximum target clock frequency it can handle.  This can cause some funny results when the target clock is changed.  This may be what you are seeing.

Try setting the Force BDM Clock Source option.

bye


Message Edited by pgo on 2009-02-03 11:16 AM
0 项奖励
回复

1,533 次查看
markslFS
Contributor I
Dear pgo,

My local suppliers do not stock some of the parts you use. If you have a moment, would you be able to tell me if the following substitutions are ok (in order of price):

MOSFET-N: BSS138: 2N7002 or MMBF170 or IRLML2502
MOSFET-P: BSS84: NDS0605 or IRLML5103 or NDS0610
MOSFET-P: IRLML6302: IRLML5103
Comparator: MCP6541T: LM311D or MAX9119
3.3V regulator: LP2981AIM5-3.3: MAX8885 or MAX8867

Different footprints are OK, as I am having to redo the board layout. I am making the USBDM a removable "daughter board" for a MCU "mainboard".

Could you also give an indication of the value of the ferrite bead you use in the 5V USB line? From the other designs, it looks like it could be 10uH ?

Thanks for all your efforts,
Kevin


Message Edited by marksl on 2009-02-05 10:47 AM
0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V
Dear Marksl,

For both FETS the currents are small and I don't think speed (capacitance etc) is important.

For the N-mosfet a low vgs(th) is important especially if low target Vdd is being used. IRLML2502 seems best but also check the Vgs(max)>>12V if supporting RS08.

For the P-mosfet Vgs(max) >>12V but the Vgs(th) is less important. NDS0605 seems OK

The 3v3 regulator is not critical.  They just have to operate with Vin 5V and have a suitable current limit. Note that the 5V transistor or schottky diode is required if the regulator is used.

The comparator should operate from 5V and not have output inversion problems when the inputs are near the rail. Speed is not important.

Please check the above considerations yourself.

bye





0 项奖励
回复

1,533 次查看
markslFS
Contributor I
Dear pgo,

I do indeed want to support the RS08.

As I understand it, the Vgs(th) must be clearly lower than the signal levels, and since all have values <= 1.7V, they're all ok on this point?

Again, as I understand it, the Vgs(max) is the greatest voltage that can be switched, so, as you say, greater than 12V is required for the RS08.

Sorry - I don't understand what you meant by "Note that the 5V transistor or schottky diode is required if the regulator is used" ? Which part references are you referring to? If Q1, I should be able to use the IRLML5103 (Vgs(max) = -20V, Vgs(th) = -1V), but I can get the IRLML6302.

As for the comparator, I'm not sure how to confirm the LM311D. It specifies a minimum supply of 5V, and am I looking at the saturation voltage? Would I leave the balance/strobe pins unconnected?

Sorry, but I am a (reformed) physicist, not an electronics engineer, learning as I go along.

Sincerely,
Kevin
0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V
Dear marksl,

Most low drop out regulators have a (catastrophic) problem if their output voltage is raised above their input voltage.  This can occur if the circuit is connected to a powered target when not plugged in.  The FET used for the 5V supply provides an internal diode across the regulator that prevents this.  If you are not using the 5V supply you  need an external diode instead.

Vgs(th) is the threshold but you want the FET to be well turned on so you need vgs(th) to be well below the voltages used in the circuit.  The BSS188 has a Vgs(th) of ~1V (1.4max)  so would be better for low target Vdd.

I don't think the LM311d is suitable.  While it does say it will operate on 5V its input range is quite limited (a bit hard to judge since the specs aren't given for 5V).  The comparitor used has "rail-to-rail" input operation which is desirable if the input can potentially swing 0 to Vcc (of the BDM).  The MAX9119 would be suitable I believe but it comes in a very small package?

Finally, I missed the question about the ferrite bead.  The choice was based on an App note from murato I think.  I'm not an expect on this area. This bead isn't really important and could be omitted if not concerned about interference (put a pad in and use a 0-ohm resistor initially).

bye


0 项奖励
回复

1,533 次查看
Macias
Contributor I

Dear Pgo,

Please tell me on which traget speed you was testing your TBDML solution? When I setup my target MC9S08JM60 with external 12Mhz crystal in PLL mode, internal bus freq was set on 24Mhz, I have problem with programming target. But when I'm using it for MC9S12NE64 with 25Mhz crystal, PLL mode to 50Mhz everythink works fine.

 

Best Regards,

Maciej Bojczuk

0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V

Dear Macias,

 

The JB16 version has been tested at a range of connection speeds.  Operation has been confirmed with a JM60 operating with a 24MHz Bus clock (external 12MHz crystal, PEE mode).  This happens to be the set up for the JM60 version of USBDM which I have debugged with the JM16 version :smileyhappy:.

 

It requires the use of the ALT clock option since the connection speed is too fast for the JB16 version otherwise.

 

The JB16 USBDM is limited to a BDM clock of around 21MHz = Bus clock for the JM60 by default.  The ALT clock is the MCGLCLK which is around 17MHz for the one I checked.

 

Note:  The frequency reported by the debugger under BDM status is 2xBDM clock - it assumes (wrongly) that the BDM clock is always half the bus clock and so multiplies it by two when reporting it - trying to be helpful.

 

The situation is different for the NE64 I believe (from memory).


bye

 

0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V

Dear Macias,

 

Follow up.

 

The  JM60 is on the verge of operation when using the ALT clock option which uses the internal clock.  If you have a fast chip it may be unreliable.

 

bye

0 项奖励
回复

1,533 次查看
byron
Contributor I

Dear pgo,

    Thanks for sharing the information. I have followed the instructions and  successfully made a TBDML with the JB16JDWE.

    However, when I replace the "tbdml.dll" file, there seems something wrong. I can only find the "tbdml_gdi12.dll" in the reletive documentation folder in my computer. So I changed your file name and replaced my "tbdml_gdi12.dll". Then I try to set dgi in the codewarrior, a message showed as following pic. 

    I also found that if my original "tbdml_gdi12.dll" as well as your "tbdml.dll" both exist, the TBDML can work, I can download the code to the MCU successfully. I can also use the "Start/Continue", "Single Step","Step over" etc buttons to debug the program. But the "Reset Target" is invalid. when press that button, the program still run without a interruption.  Do you know the reasons?

   attached is the referred mistaking dialog and the "tbdml_gdi12.dll" in my computer.(If you couldn't open the "tbdml_gdi12.dll.txt", just change its name to "tbdml_gdi12.dll" )

  Can you help me with this?

  Thank you.

http://www.freescale.com/files/community_files/TBDML/msg349_tbdml_gdi12_dll.txt

mistake.jpg

Message Edited by t.dowe on 2009-08-31 03:19 PM
0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V

Dear Byron,

 

Please read the What is provided  and Installation sections of the USBDM_JB16.chm (Help file) provided with the software.

 

You do not replace any files! The original opensourcebdm.dll file is in the windows directory somewhere.  Placing the modified files in the Codewarrior directory hides the original files.  Also, as you found, the existing GDI file is still required.

 

  • What target are you using?
  • Do you get the correct USBDM Configuration dialogue when starting the debugger (see the help file above)?
  • What actual BDM hardware did you build - The software supports several versions.  Did you build the complete USBDM or the minimal TBDML? Please specify which schematic supplied with the software corresponds to your hardware.

 

If you are using a HCS12 chip then I would check the reset circuitry on the BDM.  I can't think of any reasons why the reset wouldn't work for the HCS08 chips.

 

bye

 

Message Edited by pgo on 2009-04-30 07:00 PM
0 项奖励
回复

1,533 次查看
slyrye
Contributor I

Sir pgo:

    Thanks so so much for continuous development I'd like to ask if TBDML_JB16_SOIC20(MINIMAL) is up to the task of burning my newly discovered chip MC9S12C64MFAE since It's so minimalistic what could be the drwaback of using this instead of the other 28pin mcu based burner?

 

Yours Trully,

Ryan

0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V

Dear Slyrye,

 

There is no functional difference between the 20p & 28p 'minimalistic' versions.  They are both a basic TBDML style interface.

 

Things that are missing relative to full USBDM (from memory):

No support for RS08 devices (no 12V supply)

No Target Vcc supply or supply monitoring i.e. its can't report absence of target power.

 

That's about it.

 

I have used a very similar circuit with a 9S12C32  & C128 devices which  I believe would be similar to the 9S12C64. I did not have any problems.

 

bye

0 项奖励
回复

1,533 次查看
vkojin
Contributor I

Dear pgo,

sorry for my english, is there a way to run your usbdm project on mc68hc908jb08, i don't good in programming and i dont know how to modify firmware.

Can You help me?

0 项奖励
回复

1,533 次查看
pgo
Senior Contributor V

Dear vkojin,

 

The JB08 was used in the original TBDML so you can try that but it is limited in speed.  See this thread:

TBDML debugging interface for HC12, S12, S12X and S12XE microcontrollers

 

The USBDM code is not available for JB08 as it is too limited in memory (and speed).

 

I would very much recommend you look at a JB16 based version.

 

bye

 

0 项奖励
回复

1,533 次查看
vkojin
Contributor I

Dear pgo,


I made the USBDM according to the schematics described in USBDM_JB16_SOIC(USB Stick).pdf with firmware USBDM_JB16.s19. I use MC908JB16DWE for processor and MC74HC125N for buffers.


When device is plugged in the USB port it is found as new hardware. I installed the appropriate drivers, put your dll files in the CodeWarrior (version 6.2) folder.

When I try to connect to the target (panasonic PAN802154HAR00, MC9S08GT60CFBE processor) the USBDM Configuration window pops up but then this error appears: TEST CONNECTION FAILURE  Connection with target has failed (described in your help file). The green and red LED is on.


In Command window I get TARGET SECURED? NO TARGET CONNECTED?

In the Open Source BDM status dialog the following parameters appear:
Hardware version: 15.15
Firmware versin: 0.12
USB DLL version: 2.1
GDI DLL version: GDI V1.0
BDM Status Reg: 0x64(secured?)
System Clock: 8000000.00 MHz

 

In Test_USBDM tool  I get :

Status: Wait, Not Connected, Reset

Speed = 15360.00 MHz (1 tick, sync=0.0us)

 

Can you tell me where things could be wrong?

Message Edited by vkojin on 2009-08-10 09:21 AM
0 项奖励
回复