Elprotronic Inc.


Can the Fast MSP430 Flash programmer safely

 and reliably program the target device ?


Gregory Czajkowski, Ph.D.

 

Some of our customers asked for reassurance that our programmer does not violate internal MSP430 specifications. We can assure you that no MSP430 specifications are violated by any of our products. Our products are a result of careful research. Based on materials and software from TI related to the MSP430 JTAG and BSL interfaces and algorithms, and without violating our agreement with Texas Instruments, we can offer a more detailed explanation to you, our valued customers.


Programming a target device, such as an MSP430 microcontroller, is performed in two steps. The first step is to transfer the data from the PC, through the adapter to the MSP430 microcontroller. The speed with which this can be done depends on JTAG or BSL communication speed and the speed between PC and programming adapter - parallel port or USB version. The second step is to program the FLASH memory, which MUST meet the MSP430 specification. This step is key in programming MSP430 reliably.


So how fast can it be done? To answer this question we turn to the documents published by Texas Instruments that describe flashing procedures and hardware limits of their microcontroller devices. Some of these documents provide examples of full functional software, such as in the Application Report SLAA148. The WriteFLASH procedure described there that uses the JTAG interface requires approximately 200-250us (90us flashing time plus 110-160us transfer data time via JTAG interface) to program a single word to flash memory, given that JTAG communication speed is about 1 Mb/s. Therefore, it takes this procedure 6 to 7.5 seconds to program 60 Kbytes of data to flash memory. This yields an effective transfer rate of 8-10 kBytes per second. If extra communication between programming adapter and PC is taken into consideration, then effective programming speed can be below 8 kBytes/s.


We use the above procedure for some functions, such as writing serial number, model and revision within our programming software, MSP430.dll and the API-DLL. However, for tasks such as programming 60kBytes of data to flash memory, this procedure takes a long time. For this reason, we use a different algorithm that is described in Texas Instruments documents SLAU049, SLAU056 and SLAU144. This allows to decrease a transfer data time via JTAG interface about 7 times keeping unmodified flashing time.


As example consider an MSP430 with 60 kB Flash size. It can program one byte or one word per cycle. The word method is faster because it allows two bytes to be programmed in a single flash programing cycle. One flash programing cycle requires 35 cycles of the Flash Timing Generator (FTG) when used in Byte/Word Write mode, or 21 FTG cycles when used block write mode. To operate properly, the FTG frequency must be between 257 to 476 kHz (period 2.1 to 3.89 ms). See data sheets for this information.


Using these numbers we can get the following timing requirements to program 60 kbytes (30 kwords) of flash:


  Single Word Write mode: 30k * 35 * (2.1 to 3.89 ms) = 2.25 to 4.2 seconds

  Block Word Write mode: 30k * (21+16/32) * (2.1 to 3.89 ms) = 1.4 to 2.6 seconds


Note that the newest features in upcoming MSP430F2xx family will allow to program flash even faster.


A 60 kbytes of flash MUST be programmed in no less than 1.4 seconds and no more than 4.2 seconds. Otherwise the programmer will violate internal limits, which is not desired. Our programmer completes this step in the programming process in 1.6 seconds, well within the block word write mode timing specifications.


Now that we have established that the flash can be programmed within 1.3 to 4 seconds, the question becomes why do some flash programmers require 10, 20 or more seconds for the entire programming process? The answer is that the simple programming method described in SLAA148 is used or time is spent to transfer data from the PC to internal part of the MSP430.


The parallel port or the USB port is used to transfer data from the PC to the adapter first and then a JTAG/BSL interface to communicate with the MSP430 microcontroller. The parallel port communication protocol is in most cases custom made and very easy to control. Unfortunately, it is not very fast. USB communication protocol is faster, but standard protocol is much more complicated and it is oriented for transfer of packets of data. Because of this the FLASH programmer using the USB interface can be slower than the FLASH programmer using the parallel port interface. It required a lot of careful research and development effort on our part to make the USB protocol efficiently transfer small packets that an MSP430 JTAG or BSL interface requires.

 

Our programmer takes 1.6 second to flash, 0.5 seconds for data communication and 0.2 seconds for initialization, totaling 2.3 seconds (USB model, 60kB flash). This is equivalent to 29 kBytes/s programming speed (initialization excluded).


Programming adapters from other vendors have similar programming speed (data from January, 2005):

* Rowley Associate CrossConnect - 28 kB/s www.rowley.co.uk/msp430/CrossConnect.htm

* IAR J-Link - 25 kB/s www.iar.com

* Segger J-Link - 20 kB/s www.segger.com/jlink_430.html


Our communication techniques are fast and reliable. As we discussed above, our innovative techniques do not violate any internal limitations. The maximum TCK frequency in JTAG interface can be up to 5 MHz when Vcc>2.2V or up to 10 MHz when Vcc>3V. We use maximum TCK frequency of 4 MHz. This requires cables between programming adapter (FPA) and target device to be short. Also no additional components, such as capacitors and suppressors, should be connected on the JTAG line.


In our software we also provide the capability to program the flash memory at lower rates. This was done to facilitate programming of microcontrollers when programming cables are long, or JTAG lines have additional components connected to them. To cover these cases our USB FPA has software selectable JTAG communication speed. The speed can be set to 4, 1 or 0.4 MHz.


While we are a new company, our staff has over 20 years of experience in DSP, microcontrollers and communication. We are in touch with TI experts and we are in the TI's Third Party Tools supplier list. At the ATC-2003 in Dallas we presented our programming methods in presence of TI experts. We received a positive response from participants. Part of the programming method using Fast BSL interface that was presented in ATC-2003 was later published at the MSP430 ATC-2004 TI's Conference in Dallas (USA) and Freising (Germany). We presented on the topic of "Production Automation with Flash Programmers" (download ATC-2004-Elprotronic.zip ).


The success of our company in mainly due to the years of experience of our staff, careful research and development, consultations with Texas Instruments, and the support of our loyal customers. We will continue to use our best efforts and high quality research and development techniques as they add up to high quality products and customer satisfaction.


So if you decide to buy a programmer, take it from company that has a staff with years of experience and is able to implement fast, effective and reliable method based on the algorithms described by TI, and save you time and money.