• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » Problem when I using SPI and UART simultaneously on the TMS320VC5505
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Problem when I using SPI and UART simultaneously on the TMS320VC5505

    Problem when I using SPI and UART simultaneously on the TMS320VC5505

    This question is not answered
    CHAIX Julien
    Posted by CHAIX Julien
    on Feb 08 2011 10:48 AM
    Prodigy160 points

    Hi,

    I work on the TMS320VC5505 with DSP/BIOS. I have a problem when I want to use the UART and SPI. I initialized the UART and the SPI BUS with csl. When I use just SPI BUS or UART ,the both works very well. But if I configure UART in first and after and i configure the SPI ,the UART's configuration is changed and it doesn't work but the SPI Bus is ok.

    I have seen that registers IER,FCR,LCR,DLL,DHR and PWREMU_MGMT had been  changed. I don't think that this registers are shared by both SPI and UART, But I  don't understand why the SPI's configuration can change the  UART's configuration. Have you got any ideas?

    Is It possible to use simultaneously the SPI Bus and  the UART?

    thank you

     

    CSL DSP UART
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Steve Tsang
      Posted by Steve Tsang
      on Feb 08 2011 13:28 PM
      Genius12485 points

      Yes. all the peripherals are designed to work concurrently and is routed to the I/O pins via the External Bus Selection Register. It is located in 0x1C00. Double check your program. Refer to the Device Spec or System User's Guide for details. Are you using CSL version 2.10? Which examples are you combining? The CSL examples are written as individual tests. Modification is required when merging together.

      Regards.

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • M MAR
      Posted by M MAR
      on Feb 09 2011 03:57 AM
      Intellectual965 points

      Steve Tsang

      Yes. all the peripherals are designed to work concurrently and is routed to the I/O pins via the External Bus Selection Register. It is located in 0x1C00. Double check your program. Refer to the Device Spec or System User's Guide for details. Are you using CSL version 2.10? Which examples are you combining? The CSL examples are written as individual tests. Modification is required when merging together.

      Regards.

      Hi,

      I am also experiencing a similar problem. You suggest to go to CSL 2.10 ? Currently I am using CSL 2.01 with a VC5505 DSP. Is there a potential problem with the older CSL 2.01 ?? I have downloaded the CSL 2.10 but it does not have the cslVC5505L.lib which I normally use to link with my project. Where are these library files for 2.10, or do I need to build the CSL 2.10 libraries myself ?

      Regards,

      M

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • CHAIX Julien
      Posted by CHAIX Julien
      on Feb 09 2011 04:18 AM
      Prodigy160 points

      Thanks for your answer !

      Yes I know the register EBSR  located in 0x1c00. I have fixed it to  0x593f wich is :

      • PPMODE=mode 5:(8-bit LCD Controller, SPI, and UART). 8-bits of pixel data of the LCD Controller module, 4 signals of the SPI module, and 4 signals of the UART module are routed to the 21 external signals of the parallel port.
      • SP1MODE:Mode 2 ( GP[11:6]). 6 GPIO signals (GP[11:6]) are routed to the 6 external signals of the serial port 1.
      • SP0MODE 01 = Mode 1 (I2S0 and GP[5:0]). 4 signals of the I2S0 module and 2 GP[5:4] signals are routed to the 6 external signals of the serial port 0.

      Else I don't use version 2.10 but 2.01. Do you think that I need to use the latest?

       I don't know wich examples has been used to write this code because  I have recover this code from a old projet. But this my initialization  for the UART  and for the SPIBUS
      are :

      /****************************************************************************************************************************************

       

      CSL_UartSetup mySetup =
      {
      /* Input clock freq in Hz */
          100000000,
      /* baud rate */
         9600,
      /* word length of 8 */
          CSL_UART_WORD8,
      /* To generate 1 stop bit */
          0,
      /* Disable the parity */
          CSL_UART_DISABLE_PARITY,
      /*disable fifo */
      //    CSL_UART_FIFO_DISABLE,
      /*enable trigger 14 fifo */
       CSL_UART_FIFO_DMA1_DISABLE_TRIG14,
      /* Loop Back enable */
        CSL_UART_NO_LOOPBACK,
      /**No auto flow control*/
       CSL_UART_NO_AFE ,
      /** No RTS */
       CSL_UART_NO_RTS ,
      };

      Uint16 uart_IntcSample(void)
      {

       CSL_UartIsrAddr isrAddr;
       CSL_Status    status;
       
       UART_init(&uartObj,CSL_UART_INST_0,UART_INTERRUPT);
         
          // Handle created
          hUart = (CSL_UartHandle)(&uartObj);

          // Configure UART registers using setup structure   
          status = UART_setup(hUart,&mySetup);

       IsrAddr.rbiAddr  = uart_rxIsr;  

       isrAddr.tbeiAddr =  uart_txIsr;   

      isrAddr.ctoi     =  uart_ctoIsr; 

       isrAddr.lsiAddr =   uart_lsiIsr;.
        UART_setCallback(hUart,&isrAddr);
       status = UART_eventEnable(hUart,CSL_UART_XMITOR_REG_EMPTY_INTERRUPT);
       status = UART_eventEnable(hUart,CSL_UART_RECVOR_REG_DATA_INTERRUPT);
       return status;

      }

       

       

      void TI_CC_SPISetup(void)
      {
       SPI_Config      spiHwConfig;
       Uint16          value;
       CSL_SpiHandle   hSpi;
          
         SPI_init();

      ****************************************************************************************************************************************

      /****************************************************************************************************************************************

       

       hSpi = SPI_open(SPI_CS_NUM_1, SPI_POLLING_MODE);
         
          // Set the SPI hardware configuration.
       spiHwConfig.spiClkDiv = 13;     // DIV=13+1=14, donc 100MHz/14=SPI_CLK=7,14MHz @ 100MHz.
       spiHwConfig.wLen  = SPI_WORD_LENGTH_8;
       spiHwConfig.frLen  = 1;
       spiHwConfig.wcEnable = SPI_WORD_IRQ_ENABLE;
       spiHwConfig.fcEnable = SPI_FRAME_IRQ_DISABLE;
       spiHwConfig.csNum  = SPI_CS_NUM_1;
       spiHwConfig.dataDelay = SPI_DATA_DLY_0;
       spiHwConfig.csPol  = SPI_CSP_ACTIVE_LOW;
       spiHwConfig.clkPol  = SPI_CLKP_LOW_AT_IDLE;
       spiHwConfig.clkPh  = SPI_CLK_PH_FALL_EDGE;
       


          SPI_config(hSpi, &spiHwConfig);

       /****************************************************************************/
       /** This configuration for the EEPROM*/
        do { /* Check for bsy status */
                  value=CSL_FEXT(CSL_SPI_REGS->SPISTAT1,SPI_SPISTAT1_BSY);
              }while(value & 0x01==1);
      }

      ****************************************************************************************************************************************

      /****************************************************************************************************************************************

      Thanks  for you help

      /****************************************************************************************************************************************

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • CHAIX Julien
      Posted by CHAIX Julien
      on Feb 09 2011 07:06 AM
      Prodigy160 points

      Hi,

      I have changed the configuration of the Uart directly in my CSL_UartHandle structure. I have done this after I have initialize my SPI BUS and now the two can work simultaneously

      I have changed this :

       hUart->uartRegs->DLH=2;                                                // Fixe  the baud rates for the UART
      hUart->uartRegs->DLL=139;

       hUart->uartRegs->PWREMU_MGMT=24579;               // Power and Emulation Management Register : Transmitter/ Receiver enabled;  Free-running mode is enabled
       hUart->uartRegs->IER=3;                                     
       hUart->uartRegs->FCR=194;                                           // Fixe the  Line Control register
       hUart->uartRegs->LCR=3;                                                // Fixe the fifo control register 

      Thanks for your help

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Simon Attard
      Posted by Simon Attard
      on Apr 10 2012 17:13 PM
      Intellectual730 points

      Hi CHAIX, well done for this solution. I had the same problem, and followed your method. It works.

      I would appreciate if anyone from TI can shed some light on why these registers are overwritten when the SPI  is being configured.

      Regards,

       

      Simon

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • MikeH
      Posted by MikeH
      on May 09 2012 11:06 AM
      Guru12685 points

      Gents,

      I too am running into anomolies while using the UART + SPI. Here are a couple of interesting observations:

      1) The CSL UART_init() function resets the entire peripheral group(4), not just he UART peripheral. This will cause the SPI peripheral to be reset which will erase any configuration of the SPI done before configuring the UART.

      CSL_FINST(uartObj->sysAddr->PRCR, SYS_PRCR_PG4_RST,RST);

      2) Also, the value of SYS_PSRCR_COUNT is not set before the above reset occurs. In my case the value of SYS_PSRCR_COUNT = 0x02 when the reset is issued, which appears to be too short according to sprufx5d.

      I have tried modifying the csl_uart.c with a value of 0x20 (which is what is used in csl_spi.c), but it has not fixed the problems I am seeing.

      WOULD SOMEONE FROM TI PLEASE GIVE US SOME GUIDANCE ON THIS ISSUE? Is there a problem with the CSL when using both the SPI + UART simultaneously?

      Thx,

      MikeH

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use