SLAU358Q September 2011 – October 2019
The MSP-GANG Programmer contains a temporary data buffer that can be used for writing and reading data to each target device. Buffer size is 128 bytes for each target device when used it for data and 16 bytes when used for serialization.
Buffer[8] [128];
MSPGANG_SetGangBuffer writes data to selected Buffer. MSPGANG_GetGangBuffer reads contents from the selected buffer.
Syntax
LONG MSPGANG_SetGangBuffer(BYTE target, BYTE size, BYTE *data)
LONG MSPGANG_GetGangBuffer(BYTE target, BYTE size, BYTE *data)
Arguments
#define GANG_DATA_BUF_SIZE 128
#define SN_GANG_BUF_SIZE SN_DATA_MAX_SIZE
#define TARGET_MASK 0x1F
#define SN_DATA_FLAG 0x40
If used for data:
BYTE target | Target number (1 to 8) |
BYTE size | Size of data (1 to 128) |
If used for serialization:
BYTE target | Target number (1 to 8) ORed with SN_DATA_FLAG (SN_DATA_FLAG | Target_Number) |
BYTE size | Size of data (1 to 16) |
BYTE *data | Pointer to data buffer from where data is taken or to where the data should be saved |
Result
LONG | Error code |
Example
Write unique 16 bytes of data to RAM or Flash
BYTE data[16];
MSPGANG_Interactive_Open_Target_Device( "test" );
for(target=1; target<=8; target++)
{
for(k=0; k<16; k++)
data[k] = enter_desired_data_per_target...
MSPGANG_SetGangBuffer( target, 16, data );
}
MSPGANG_Interactive_Copy_GANG_Buffer_to_RAM( MC_addr, 16 ); //copy unique data to RAM
//or
MSPGANG_Interactive_Copy_GANG_Buffer_to_FLASH( MC_addr, 16 ); //copy unique data to FLASH