This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28335: Trying to do Label recognition from holt HI-35850 with TMS320F28335

Part Number: TMS320F28335


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 

  • Hi Chaya,

    Thanks for the information. To clarify, my understanding is the following (please correct if I am wrong - just want to understand the big picture of what is happening and what you are trying to do):

    • You are trying to communicate between F28335 (master device) and HI35850 (slave device) and using 16-bit words
    • You start by writing data from F28335 to HI35850 in order to send op codes to configure HI35850 while HI358580 sends back control words that are used to configure F28335 registers (which registers are the control words used for?)
    • You then send data from F28335 to HI35850 to send another op code while HI35850 sends back a dummy filed address (what is this address used for?)
      • Then you send the array (of 32 16-bit values) to the HI358580
    • You write another op code to HI358580 and are HI35850 sends back another dummy filed address
      • Then you try to read an array of 32 16-bit values from the HI35850

    Some questions:

    1. Have you scoped the SPI lines to monitor the behavior of all four lines during communication and check if they are valid? If not, please do so and share an oscilloscope capture if you are able. This is always the best way to start debugging SPI behavior to determine if there is a hardware, software, or configuration issue.

    2. At what point are you sending 0xE01111C0? Is this being transmitted from F28335 to HI35850? Or is this supposed to be received by the F28335? It is a bit unclear to me the events happening for this and what you are trying to do - could you please explain this further?

    3. If you are unable to receive data, can you please step through your code line by line and also check the RXEMU register in CCS to see if you are receiving data throughout the program?

    Best Regards,

    Allison

  • Hi,

    Yes we are trying to communicate between F28335(master) and HI35850(slave) using 16 bit word.
    Yes, Your understanding is correct.


    Answer for questions:
    1. Yes I had monitored SPI lines behavior, they are valid. If i give configuration of Conrol registers without Label recognition selection
    transmission and reception is happening properly.

    Configuration of control registers without Label recognition: (with this configuration transmission and reception are happening)
    Here using control registers CR5, CR13
    /* Enable Mcu2 CS line */
    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(0x2000);
    /* 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();

    when I configure along with Label recognition, reception is not completing.

    Configuration of control registers with Label recognition:
    Here using control registers CR2, CR5, CR13
    /* Enable Mcu2 CS line */
    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();

    2. 0xE01111C0 is transmitted from F28335 to HI35850. This is supposed to be received by HI35850.

    We are able to do transmission and reception wihtout label recognition configuration.

    3. Yes I had tried going step through in code line by line, in that time it was looping in this for loop
    only, this for loop we are using to copy our LabelArray to holt memory.

    It is starting from 31 index and going to negative numbers,
    (we saw this code in holt example, will attach that document here)


    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();

    ***we saw RXEMU register it is having 0x0009 it means FIFO is empty.

    I tried changing the loop values as
    for(label_index=0; label_index<=31; label_index++)

    even with this we are not able to get label filter. But transmission is completing

    an-140_v-rev-d (1).pdf

  • Hi Chaya,

    Glad to hear that the transmission/reception looks correct in regard to scoping the lines! Sounds like there is no issue specifically with SPI configurations or SPI functionality here - so this is purely a software issue in terms of trying to get the labeling to work. 

    Unfortunately, my expertise lies in the SPI module; I am not well versed in implementing a label filter like this and am still a bit confused on what you are trying to use it for. Could you please explain a bit more how you are trying to implement the label filter and what the purpose of it is as well as why/how you determined the ranges for each of the array values? 

    Best Regards,

    Allison

  • Hi Allison, 

        Yes, I will explain.

    PURPOSE of Label Filter:

    We are using Label filter because we have ARINC-429 data's with different labels 

    for example:  0xE000FFC6

                          0xE01111C0

                         0xE000FFC5

    • These are few ARIN-429 data's with different Labels (C6, C0, C5)
    • Let's consider we enabled LABEL RECOGNITION in Holt-35850 
    • Suppose we received an ARINC data (for example: We are expecting data with Label C0) as we enabled Label filter. 
    • Once we receive ARINC data, if Label is C0 then only we consider it as a valid data and we will process it, else it will consider it as invalid.

    HOW We are trying to Implement Label Filter: 

    In HOLT-35850 we have " Enable Label Recognition" Function (CR2 is Control register bit). We are configuring this bit in configuration. 

    Configuration: 

    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();
    

    1. In this we are giving "10" opcode for "Write to Control register", then enabling Control Register Bits

    • "CR13" bit for "Transmission Enable mode"  
    • "CR5" bit for “Self Test”
    • “CR2” bit for “Enable Label Recognition”
    • That's why (0x2000) & (0x2400) we are giving. 

    2. We also have some opcodes related to Label i.e.,

    3. After configuration we are transmitting opcode. "06" this is opcode to Copy HI-3585 ARINC label selections from Label Array[ ] to HI-3585 (Write 256 Label memory to HI-3585)

    (we tried this by seeing example program of holt)

    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. "0D" opcode is to Read 256 Label memory from HI-3585 

    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();

    ARRAY :

    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,
    };

    1. We given array value with 16-bit, because F28335 is 16-bit processor. (even tried giving 8 bits in array value)

    2. Here We are setting Label address 192, because

    3. We are transmitting 0xE01111C0, here I want to check if label is C0 then only process.

    4. As C0 is in hex value it's decimal value is 192 so am setting 192 bit. In index 24 

    199 198 197 196 195 194 193 192

      0      0    0      0     0     0     0     1  = (0x01)  

    hi-35850_v-rev-a.pdf

    Thanks & Regards,

    Chaya

     

  • Hi Chaya,

    Thanks so much for the thorough explanation! Please allow for me discuss to a bit with a few colleagues as well and update you later this week if we have suggestions.

    Best Regards,

    Allison

  • Hi Chaya,

    I discussed this and unfortunately we can only answer questions about the SPI module in C2000; any questions on any features or application of the Holt device is outside the scope of the E2E forum and we cannot properly support. If you are not having any issues specifically with the SPI module/configurations of the SPI module, then we can go ahead and close thread.

    Best Regards,

    Allison

  • Hi, 

    Thank you for your support. 

    Actually, now we are able to do label filter. 

    1. We have a for loop in "06" opcode

    2. In for loop we are using an variable. "label_index" this variable we declared as UNS16. 

    3. This for loop was going for infinite loop. 

    4. We tried by changing UNS16 to INT16 or INT8. now, loop is not going for infinite loop. 

    (for loop was an issue, configuration for label filter is same)

    We can close this thread. 

    Thanks & Regards,

    Chaya