OK - I got all the stuff now how do I program this thing

Got everything running, wrote some code, used the simulator - all great.

Wrote a quicky program in assembly to raise and lower the port pins. Just something tp prove that the chip is programmed and running:

ORG 0F800h

;Clear RAM

;Clears RAM but leaves return address unchanged

Clear_Ram: MOV.W #0200h, R4 ; Set RAM Pointer

MOV.W #128, R15

ClrLoop: MOV.W #0, 0(R4)

INCD.W R4

DECD.W R15

JZ ClrOut

Jmp ClrLoop

ClrOut: MOV.W #0280h, SP ; Initialize stackpointer

MOV.W #05A80h, 0120h

MOV.B #07Fh, 021h ;Enable P1 I/O

MOV.B #07Fh, 022h ;Set direction of I/O bits

MOV.W #060FFh, 026h ;Select direction and resistors

PulseLp: MOV.B #0FFh, 021h

NOP

MOV.B #00h, 021h

JMP PulseLp

END

I bought the MSP JTAG … Dongle and made a board with the connections shown in the MSP430 user’s manual. Read the meager instructions and set all the options and as far as I can tell nothing happens. I got an error message once. But, now I don’t even get that.

With the options set, the debug button is disabled. I do not get any verification of the download. But, then, I don’t find any download or program button. I do not get any C-Spy messages. Is there something else that needs doing?

I disabled the printer driver and restarted the system.

Set the options per the manual and clicked on ‘Make’

Clicked on debug

Get an error mesage saying that the device cannot be found. Tried LPT2 with the same result.

I just have a socket with the device and the circuitry shown for the JTAG interface - no osc input or I/O. Just trying to program it.

I do not know what you got. Sounds like you have a MSP430F2013 chip on your own board and a TI JTAG FET with Parallel Port Interface. Please be more specific. Do you have a eZ430-F2013?

I spotted a few problems in your code. But it sounds like you have problem with the IAR IDE too. Again, I need more information before I can help you. Here are the problems that I spotted in you code.

(a) You did not use a header file (e.g., #include ). What you did is fine, but it makes the code harder to read and more error prone.

(b) In your “Clrloopâ€

Old Cow,

Device is MSP430f2012

Thanks for the critique. I was a bit over enthusiastic clearing RAM. I dropped it to 64 words. It is my understanding that the program memory runs from 0F800h to 0FFFFh. I assume the ORG should be at 0F800h. When I change it to OFFFEh I get a ‘segment too long’ error near the beginning of the program.

In Project>Options>General Options>Target the MSP430f2012 device is in the window. Does this substitute for the #include directive?

My assembler source code file extension is .s43

I have set everything I could find to MSP430f2012.

I have set the debugger to use the FET.

My target board has a 10Mhz oscillator. The system is running on 3.3 V.

I built a connector on the board to accept the Dongle.

I am running code on two PCs. I use one (Windows XT) for software and the other (Windows 98) for the hardware debug.

The error message I get when I go to Debug is:

No target device found

Failed to load Debugee C:.…\PulsePin.d43

Schematic is at:

http://www.rcgroups.com/forums/report.php?p=5946732

[/img]

About clearing RAM, you were correct to begin with. I was wrong. You loaded R15 with 128 and were counting it by 2s. My apologies for the false alarm.

About location 0FFFEh, you misunderstood me. What you need to do is just add two lines before END:

ORG 0FFFEh

DW Clear_RAM ; or “DW 0F800h”

After a Reset, MSP430 loads the contents of 0FFFEh-0FFFFh to Program

Counter (PC) and start to run. Without those two lines, PC=>garbage.

Are you going to use a 10MHz oscillator or crystal? A 10 MHz crystal will not work for F2012. It can only take a low frequency one such as 32 kHz. But let’s worry about this later.

The error msg “No target device found” means the FET is talking to the PC but cannot talk to a MSP430 chip (via JTAG). You better check the JTAG connection to you F2012 chip. How did you wire them? Following what TI document?

So the DW is a start vector. I vaguely remember reading that. Have to look for it again.

I am using a xtal controlled oscillator with an input to Xin. The schematic is on the link above.

I will check the wiring. I am using the schematic from the TI user’s manual and the connector diagram shown by SparkFun.

Will try it early in the morning. Time to retire.

Thanks,

Crane

Old Cow,

Checked everything. Found a wiring error on the Dongle connector (that’s an understatement).

Now I do not get the ‘No target device found’ message - That’s progress!

In the debug log I get the message:

Sat Aug 26 06:07:52 2006: Failed to load debugee: C:\Nav\Debug\Exe\PulsePin.d43

That file contains:

¥2j½

I will check my software set up and work at it some more.

Crane

Old Cow,

Sometimes I get the ‘No device found’ message and sometimes I don’t.

I always get the ‘Unable to load… .d43’ message.

Something odd about the DW 0F800 line:

23 00F82E FA3F JMP PulseLp

24 00F830

25 00FFFE ORG 0FFFEh

26 00FFFE 00F8 DW 0F800h

27 010000

28 010000

29 010000

30 010000 END

Seems that the line should be 00FFFE F800. I assume the assembler is correct. It just looks odd.

Crane

The assembler is correct. MSP430 uses little-endian, thus the word 1234h consists of the bytes 34h 12h.

By the way, DW stands for Define Word.

You can download code samples from

http://www-s.ti.com/sc/techzip/SLAC081.zip

The files with a “ca” or “sd16A” in the file name cannot be used with F2012. All the others are usable (you need to change the “#include ” to “#include

Could you tell me which of the F2012 pins are connected to which of the FET-JTAG pins? (Please list them one by one.)

Are those F2012 pins listed above connected to anything else (on your board)?

I still think there is something wrong with the FET to F2012 connection that makes FET unable to download.

I wired a F2013 target board to an old TI “MSP-FETP430IF 1.4â€

Old Cow,

Thanks for your patience.

I read the following pins from the board wiring not the schematic.

MSP430 connections. From the bottom 1 is the upper right pin - pins count down the right side and back up the left. I checked for dumb errors like chip inverted:

1 +3.3V

2 X

3 X

4 X

5 X

6 X

7 X

8 X

9 X

10 Pin 1 on JTAG Connector and 47K to +3.3V

11 Pin 7 on JTAG Connector

12X

13 Output of 10MHz Osc

14 Gnd

JTAG Connector from bottom. Pin 1 is in the upper right corner. Pins are numbered side to side. Pin 2 is in upper left hand corner:

1 Pin 10 of MSP430 and 47K to +3.3V

2 +3.3V

3 X

4 X

5 X

6 X

7 Pin 11 of MSP 430

8 X

9 Gnd

10 X

11 X

12 X

13 X

14 X

There is no printer on this PC

I am using one of the programs you suggested. It toggles the output

port, similar to what I was attempting. It assembles without errors or warnings.

When I go to Project>Debug I get the ‘Device not found message’. When I click on retry I get the … .d43 file not loaded message.

I have checked all of the wiring and signals. The output of the 10MHz oscillator is not swinging from rail to rail. It does not reach ground. I Will substitute some signal that does have a full supply swing.

When you use IAR IDE, go to [Project]=>[Options]=>[FET Debugger].

Under [Debug Protocol], can you select [Spy-Bi-Wire] instead of

[4-Wire-JTAG]? In my case, I cannot.

Do not get mad. Marketing people counts different from us. You used

4 wires to connect your F2012 to the FET, they call that Bi-wire. Look

at what I did in my previous msg. I used 8 wires, they call that 4-wire.

Another thing, do you have your own 3.3V on your board? If so, do

not use JTAG pin #2, use pin #4 instead!

Old Cow,

I made all of the connections you listed. Still does the same thing.

Under FET Debugger I found something interesting. The protocol is greyed out. The only way I have a selection is to use the TI USB button. Then I can select a protocol option. Perhaps This one only works with the little TI plug in. I haven’t yet figured out what that thing does.

Does this mean they want more money for one that works with the printer port?

Also I notice that pin 4 on the JTAG connector is labeled Vout - that’s where you put Vin. Hmmm marketing?

I installed the little USB gadget that I got with my development kit. The Debug downloads to it fine on my main desk top. Does not work with my older W98 lab computer.

I can solder a cable onto the USB gadget and use it for an In Circuit Emulator. But I can’t program a chip with it unless I rip off the 430 device that is on the board. Might get another one and do just that. Doesn’t seem that it should be necessary. Everything should work like you describe.

eZ430-F2013 (the little USB gadget) does not work with Windows 98 because Windows 98 does not fully support USB. The target interface

of that little USB gadget consists of 4 wires (Spy-Bi-Wire). IAR debugger

supports that.

When you use Parallel Port FET, IAR only supports JTAG-4-Wire. Thus

you have to solder 8 wires. Use up 8 pins on a 14 pin uC is too much.

I think you should be able to use the little USB gadget (under Windows 2K

or XP) to do in circuit emulation. I think what you need to do is:

(a) Unplug the tip section (F2013+LED) from the USB section.

(b) Connect 3 wires to your board, GND, RST, and TEST.

Thanks Old Cow,

Looks like two of the wires on the little connector go to Pins 10, 11 so the other two must be power and ground. That’s an eentsie beentsie connector. Don’t think I have anything close to it.

I’ll have to give it some thought. Probably the best way to start is to solder a header onto the removable board and use it as an emulator. When I get familiar with the process I can try programming from the connector.

Thanks again. I think I can move on now.

Crane:
Thanks Old Cow,

Looks like two of the wires on the little connector go to Pins 10, 11 so the other two must be power and ground. That’s an eentsie beentsie connector. Don’t think I have anything close to it.

I’ll have to give it some thought. Probably the best way to start is to solder a header onto the removable board and use it as an emulator. When I get familiar with the process I can try programming from the connector.

Thanks again. I think I can move on now.

The connectors are made by Mill-Max and have 0.05" spacing leads. They are virtually impossible to buy from a distributor but I got some samples out of them and have made a PCB for the MP430F2001, which connects to the eZ430 in place of the 'F2013 board.

Leon

Yes, those connections are exactly the ones you listed – Spy-Bi-Wire.

I think you can get that kind of connector from Mouser. Or, you may

be able to solder something on the other side of PCB. But either way

the wires to your board should not be more than a few inches long.

Please post your results/experience as others and I can learn from it.

Leon,

It would be a nice product for SparkFun. Looks like it’s the only way to go. I looked at all the stuff I have and nothing came close. Either too big or too small.

Old Cow,

All of the literature on the Olimex device says it works with KickStart so I spent some more time with it. I have a bit more understanding and confidence having seen the system work. No dice. I cannot get the printer port to work at all.

I wired a 14 pin header onto the USB gadget. It did not like the extra load on pins 10 and 11. The wires are only 2 inches long. When I disconnected pins 10 and 11 it worked fine.

I programmed the LED blinking demo into it, removed it from the USB thing and plugged it into my applications board. Nervously plugged in the power supply and, Ta Da, the little green LED blinks. It works! It works with my 10Mhz external oscillator. Now, that is progress.

I’ll play with the LED program for a while to get my I/O initialization errors corrected then get back to programming the application. I think the little green LED will come in handy for debug.