EasyManua.ls Logo

Elprotronic MSP430 - Page 66

Default Icon
119 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
index - 0 to 19 -> device name - char by char starting from index->0
=> M eg. MSP430F149
index 0 -> 'M'
index 1 -> 'S'
index 2 -> 'P'
index 3 -> '4'
index 4 -> '3'
index 5 -> '0'
index 6 -> 'F'
index 7 -> '1'
index 8 -> '4'
index 9 -> '9'
index 10 -> 0x0000 -> end of string
index 11 to 19 -> after end of string - irrelevant data.
index 20 -> MAIN Flash Start Address eg 0x1100 (for F149)
index 21 -> MAIN Flash End Address eg 0xFFFF (for F149)
index 22 -> INFO start address eg 0x1000
index 23 -> INFO segment size eg 0x0080 (for F149)
index 24 -> No of INFO segments eg 0x0002 (for F149)
index 25 -> RAM size eg 0x0800 (for F149)
Note: The device info is related to selected microprocessor. Desired index processor should be
first set in the configuration using F_SetConfig( CFG_MICROCONTROLLER, uP_index);
Below is an example of the procedure that can take names of all supported devices by the API-DLL.
The max size can be tested from the API-DLL, until device name is empty when the microprocessor
index is incremented from the zero up to max value. In the example below is assumed that te max
number of supported devices is 300, however this value can be dynamically modified if required.
In the procedure below the names and uP index are saved in the DEVICELIST structure, where the
name and index pair are kept in the same DEVICELIST DeviceList[] element. When the
DeviceList[] is created, then all names are kept in the alphabetic order. Microprocessor name and
corresponded microprocessor index used by the API-DLL can be taken from following elements:
Microprocessor name (string) <- DeviceList[k].name;
Microprocessor index (int) <- DeviceList[k].index;
#include "MSPPrg-Dll.h"
#define MAX_NO_OF_DEVICES 300
typedef struct
{
char name[DEVICE_NAME_SIZE];
int index;
}DEVICELIST;
DEVICELIST DeviceList[MAX_NO_OF_DEVICES];
66

Table of Contents