Hi,
We are doing SPI communication from TMS320F28335 with HOLT HI-35850 device board
Now I am trying to use label filter in HI-35850
1. we are giving LabelArray as label look-up
UNS16 LabelArray[32] =
{//[0] [1] [2] [3] [4] [5] [6] [7]
//000-007 008-015 016-023 024-031 032-039 040-047 048-055 056-063
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
// [8] [9] [10] [11] [12] [13] [14] [15]
//064-071 072-079 080-087 088-095 096-103 104-111 113-119 120-127
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
// [16] [17] [18] [19] [20] [21] [22] [23]
//128-135 136-143 144-151 152-159 160-167 168-175 176-183 184-191
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
// [24] [25] [26] [27] [28] [29] [30] [31]
//192-199 200-207 208-215 216-223 224-231 232-239 240-247 248-255
0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
//C0 is hexa, 192 is decimal
2. As we need to configure control registers, configuring as
(before this configuration we are doing master reset by giving "01" opcode)
Mcu1_Spi_Mcu2_CsLow();
/* write the byte-1 control register opcode for configuration */
Mcu1_Spi_Write(0x1000);
/* Control Word byte-2 for configuration */
Mcu1_Spi_Write(0x2000);
/* Control Word byte-3 for configuration */
Mcu1_Spi_Write(0x2400);
/* Read dummy byte-1 from Mcu2 for control word */
read_config_dummy_Mcu2 = Mcu1_Spi_Read();
/* Read dummy byte-2 from Mcu2 for control word */
read_config_dummy_Mcu2 = Mcu1_Spi_Read();
/* Read dummy byte-3 from Mcu2 for control word */
read_config_dummy_Mcu2 = Mcu1_Spi_Read();
/* Disable Mcu2 CS line */
Mcu1_Spi_Mcu2_CsHigh();
we are using "10" opcode to write to control register. then, we are using CR5,CR13 control registers and now
i added CR2 also as i need label recognition. so we are giving control word as (0x2000),(0x2400)
3. As we need to use opcode "06" opcode to copy my LabelArray to holt memory, I am configuring like this
Mcu1_Spi_Mcu2_CsLow();
/* Transmit opcode for label*/
Mcu1_Spi_Write(0x0600);
/* Read dummy byte for data filed address */
read_config_dummy_Mcu2 = Mcu1_Spi_Read();
/*for loop to copy label array to holt memory*/
for(label_index=31; label_index>=0; label_index--)
{
Mcu1_Spi_Write(LabelArray[label_index]);
read_config_dummy_Mcu2 = Mcu1_Spi_Read();
}
/* Disable Mcu2 CS line */
Mcu1_Spi_Mcu2_CsHigh();
4. As we need to use opcode "0D" to read label look-up memory
Mcu1_Spi_Mcu2_CsLow();
/* opcode to read label*/
Mcu1_Spi_Write(0x0D00);
/* Read dummy byte for data filed address */
read_config_dummy_Mcu2 = Mcu1_Spi_Read();
/*loop to do dummy read */
for(label_index1=31; label_index1>=0; label_index1--)
{
Mcu1_Spi_Write(0x0000);
read_config_dummy_Mcu2 = Mcu1_Spi_Read();
}
/* Disable DSCS CS line */
Mcu1_Spi_Mcu2_CsHigh();
We are transmitting 0xE01111C0, here I want to check if label is C0 then only read.
As C0 is in hex value it's decimal value is 192 so am setting 192 bit
199 198 197 196 195 194 193 192
0 0 0 0 0 0 0 1 == (0x01)
I am enabling 192 bit like this and giving in the index [24],as I need only this label.
when we are trying in this format, I am not able to receive data.
I also tried using opcode "0B" to read control register
Please, guide me on this to do label filter.
Thanks & Regards,
Chaya