Difference between revisions of "MSP430 Datalogger"

From DIDEAS Wiki
Jump to: navigation, search
m (Setup)
m (Support Software / Hardware)
Line 16: Line 16:
  
 
===other===
 
===other===
 +
You can try using ICC430 and the following project to debug the parallel port / J-Tag cable issue.
 +
 +
Install the following compiler:
 
*[http://www.imagecraft.com/software/ Imagecraft MSP430 compiler to test parallel port] ftp://ftp.imagecraft.com/pub/pub/icc430dem.exe
 
*[http://www.imagecraft.com/software/ Imagecraft MSP430 compiler to test parallel port] ftp://ftp.imagecraft.com/pub/pub/icc430dem.exe
  
 +
Unzip the following project.
 +
 +
[http://www.dideas.com/docs/datalogger/icc430-project.zip ICC430 DL6 TEST PROJECT]
 +
 +
To compile and download the project into the DL6 (erasing the existing application)
 +
From ICC430 goto Project->Open and select dl6test.prj.
  
 +
Then press "Shift F9" to compile and download the project into DL6.  If it works then the 3 LEDs will flash each 120 degrees out of phase.
  
 
==Software and Tools Setup==
 
==Software and Tools Setup==

Revision as of 16:03, 25 August 2005

Setup

Support Software / Hardware

required

optional / informative

other

You can try using ICC430 and the following project to debug the parallel port / J-Tag cable issue.

Install the following compiler:

Unzip the following project.

ICC430 DL6 TEST PROJECT

To compile and download the project into the DL6 (erasing the existing application) From ICC430 goto Project->Open and select dl6test.prj.

Then press "Shift F9" to compile and download the project into DL6. If it works then the 3 LEDs will flash each 120 degrees out of phase.

Software and Tools Setup

  • MSP430 firmware, Download and extract source code for the datalogger.

My Tools Setup

Executable binaries and source code are available from : http://www.dideas.com/docs/datalogger

At minimum download each of the binaries and copy into either the "working directory" or better yet or somewhere in your executable path. I keep them in c:\bin

Hardware Setup for MSP430 Programming

  • Connect the JTAG cable to the PC printer board and to the "Adapt3" PCB. The JTAG cable is polarized to help connect it properly.
  • Optionally connect "Adapt3" to the PC via the USB cable (you many need to install drivers). USB will provide power to the board - however the parallel port can also do this (but may not be reliable). This USB interface is also used for debugging.
  • Connect the 1.5mm cable (10 pins) to the "Adapt3" PCB and to the datalogger board requiring programming.

Working with the Datalogger

Programming the Datalogger

  • Complete the software and hardware setup
  • From the datalogger source code directory, build and download the package by typing "make download". The download should take less than 1 minute. After the download, jtag-talk will be run and will program the clock.
  • some other commands:
  • make - just build the project, don't download
  • make clean - clean up the project in preparation for a total rebuild
  • make clock - start the "jtag_clock" program that will attempt to talk with the datalogger and set it's clock
  • reset - a batch script that resets the datalogger

SD Card Preperation

The SD Card preparation is essentially a process of wiping the card with a known value and also creating a single sequential file in the card's root directory.

The following information was created and verified using Windows 2000 SP4.

Format card using FAT16 and largest allowable cluster size:


format <drive_letter> /FS:FAT /A:16K /V:

(/A:8192 for 64MB MMC card)


A cluster size of 16K was the largest permitted with the SD 128MB card. Possibly a smaller cluster size will need to be used with a smaller SD card. (Large cluster size means that FAT is smaller (which isn't used anyway) - and thus more space is available for logging)


If format doesn't report the drive size, use chkdsk <drive letter> to determine the size of the SD card. The card size is reported in bytes, but then may also be given in "allocation units". If so - record the allocation units and the cluster size.


Use "genfile" to write a file named "sdtest00.txt" ("timing00.bin" next version) that fills the SD card. This binary file contains a single value 0x5A (next version will be 0xFF) and is designed to overwrite previous data on the card and most importantly to cause windows to create a single FAT file chain the starts with cluster 2, 3, 4, 5, ..., last available cluster.


Example : genfile n:timing00.bin 7666C 0x5a 16k

Next version Example : genfile n:timing00.bin 7666C 0xff 16k

Finally before removing the SD card, flush file system buffers. You can use the cygwin "sync" command, or rom explorer, right click on the drive letter representing the SD card, and select eject.

Shortening the Preparation Procedure

Format and genfile can take several minutes to complete for a large card.

When "wiping" the card, the procedure may be shortened if you know that only small portion of the card has been overwritten. For example its not necessary to reformat the card every time, nor is it necessary to use genfile to fill the entire card. However, it is necessary to format and fill the entire card before the first use.

How the datalogger chooses where to write data on the SD card

The datalogger only consults the SD card's FAT when the card is inserted and thus does not modify the FAT or follow it. (Using the FAT to direct the write activity would require additional RAM and/or require additional power / time to freqently read the FAT). At insertion the partition table, boot record, and root directory are analyzed ultimately to find the cluster number of a single file "sdtest00.txt" (next version "timing00.bin"). If the file doesn't exist then the logger stops and waits for a card insertion event. If the file is found then the starting cluster is read and from that the LBA (logical block address) of the start of the file is calculated. The datalogger will then using a binary search algorithm searching the card's complete data area to locate "end of file". End of file is defined as the last sector that does NOT start with 4 bytes of 0x5a (next version 0xFF). Writing will commence with the first LBA that does contain 0x5a5a5a5a (next version 0xFFFFFFFF).

Information and Specs


Delivered

  • 8-21-05 : modified device (xxx-nnnn, 64MB MMC flash card, DL6 datalogger ser#2) with "alpha firmware"
  • 8-21:05 : JTAG programming system (Olimex adapter, parallel port extension, adapt3 interface card, USB cable, 1.5mm DL6 programming cable)
  • 8-23-05 : Bill of materials V1.1 for DL6F (XLS format)
  • 8-23-05 : PCB Camera artwork for DL6F and instructions for re-producing datalogger.