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.

TMS570LS1224: SPI cannot get interrupt

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Hi, there. I only can make SPI (not mibspi) work for the polling mode, code is something like

    while ((spiREG1->FLG & 0x0200) == 0);
    spiREG1->DAT1 = 0x1111 | 0x10010000;   //0x1111 is the data

    while ((spiREG3->FLG & 0x0100) == 0);
    printf("%x\n", spiREG3->BUF & 0xFFFF);

But I do not make the interrupt way work, the code is

    while ((spiREG1->FLG & 0x0200) == 0);
    spiREG1->DAT1 = 0x1111 | 0x10010000;   // This transmission is successed

  while(1);  // I should get interrupt inside notification.c here.

where SPI1 is the master and SPI3 is the slave. I enable the SPIINT0 RX interrupt bit, which is bit 8, then I enable the VIM channel 37 and 38, which are mibspi3 low and high with IRQ. I call _enable_IRQ() in my init process. However, I cannot get interrupt in the notification.c, I see there are 2 functions, spiEndNotification() and spiNotification(), both of them cannot get the interrupt. By the way, what's the difference of this two?

Thanks.

  • Hello joe,

    The CSNR should be 0xFE for using CS0 to select slave device. Which interrupt line (INT0 or INT1) is used?
  • Hi, QJ Wang :

      Yesterday, I use oscilloscope to check, it does not send any data in the physical line. However, it work when I connect SPI 1 to SPI 3 in same device, AND, I MUST SET ALL SCS TO GIO THEN IT WOULD WORK, otherwise it would not work if I set any SCS to SPI functional. I use oscilloscope to check both SCS all GIO and enable 1 SCS, none of them could send any data. The CLK is high when I not load my code, when I load my code, CLK immediately goes to low, SCS keeps high always, SIMO keeps high, SOMI keeps low. I believe hardware has no problem, it is some problem of source code setting, the current code is :

    main :

        spiInit();

        while ((spiREG1->FLG & 0x0200) == 0);
        spiREG1->DAT1 = 0x5555 | 0x10FE0000;

        while(1);

    does not work in oscilloscope when I enable only SCS[0]. My HalCoGen is 4.7 version,

    For configuration, the only unsure part is, see the screen shot, I believe if I enable SPI 1, then, MIBSPI would goes to compatible mode, and I do all the setting under "SPI" tag. The other setting is correct, in default except disable all SCS except the SCS[0]. Everything keep

     

    Very wierd and make people crazy. Thanks.

  • Hi, QJ Wang :

    Finally, I make it work. I guess it is the oscilloscope's problem, it cannot display the data sequence of CLK, SIMO, SOMI, SCS, I have no idea, maybe oscilloscope has some wrong configuration or something else. I have another post, e2e.ti.com/.../683690 , thanks.