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.

DSP开发板

Other Parts Discussed in Thread: TMDSLCDK6748, TVP5147, TMS320C6748, SYSBIOS

刚买的DSP开发板(TMDSLCDK6748),运行板上自带的facedetect demo,监控器画面老是跳动,换了监控器和摄像头,问题依旧,什么原因?

  • facedetect demo程序运行有问题吗?监控器和摄像头是否和LCDK板子插紧?是否按照下面的wiki网站调试。

    http://processors.wiki.ti.com/index.php/BIOS_C6SDK_2.0_User_Guide#Hardware_Setup_for_demos

  • 我是严格按照 http://processors.wiki.ti.com/index.php/L138/C6748_Development_Kit_(LCDK)  中的How to setup a C6748/OMAPL138 Development Kit (LCDK)的步骤来做的,应该没问题吧。

  • 请问facedetect demo程序运行有没有问题?能进行人脸识别,只是画面会跳动吗?

    其他demo程序运行有问题吗?

  • camera 对着自己的人脸, 检测出来的人脸 数目还是0,监控器画面老跳动,而且跳得很厉害, 画面都看不清了。其他demo程序还没运行。

  • 是否按照下面的要求做了?

    • For best results, stand a few feet away from the camera and make sure the camera is placed in such a way that your face and the camera are exactly at the same level. This is needed as it is a frontal face detection demo. Also, for the same reason, make sure your head is not tilted with respect to the camera.
  • to run the face detect  demo, external hardware is needed,         后面这两个    "composite display",   "composite camera"   是什么意思,跟一般电脑显示器,摄像头有何区别?我再强调一下, 是连DSP板的VGA口的监控器画面老跳动。而连USB口的电脑显示器正常。

  • 你看的"composite display"是EVM板上的,你用的是LCDK,是下面的配置。

    • Connect the Composite camera input at the J9 on composite video input port.
    • Connect the LCD screen at J8 on the VGA connector on the LCDK.
    composite是复合端子(RCA)

     

  • face detect demo 偶尔能检测人脸,绝大部分情况不能检测人脸

  • 你们能否写个鉴定: 这个板子有问题,好让我去换

  • 帮我写个有关这个板子的鉴定

  • 你们电话多少?想跟你们直接聊聊。

  • 你们有没有DSP开发板的检测工具,检测内部参数或硬件的好坏

  • 如果要换板子的话,请联系你的购买渠道。

  • 你好:

        你们有没有TMDSLCDK6748的手册,另外,我是从www.mouser.com买的板子,他们说必须要TI公司对板子开具鉴定,才能换板子

  •    从哪里下载TMDSLCDK6748的手册,

    我是从www.mouser.com买的板子,他们说必须要TI公司对板子开具鉴定,才能换板子

  • LINGFANG AI 说:
    camera 对着自己的人脸, 检测出来的人脸 数目还是0,监控器画面老跳动,而且跳得很厉害, 画面都看不清了。其他demo程序还没运行。

    我刚试了一下,我的板能正常显示与检测,但是如果用手碰一碰camera的连接头,则会出现画面跳动。所以我建议你确定一下你的camera的连接,以及你的camera能否在别的显示器上直接连接显示验证一下是否是好的。

  • camera 是好的,连在别的显示器没问题,板子刚买回来,demo是板子自带的,没改动过。  在摄像头对着人脸时, facedetect demo 偶尔能检测出人脸,但大部分时间检测不出来,  你们还是帮我写个鉴定吧。 

  • 我是严格按照 http://processors.wiki.ti.com/index.php/L138/C6748_Development_Kit_(LCDK)  中的How to setup a C6748/OMAPL138 Development Kit (LCDK)的步骤来做的

  • 摄像头出来的画面是黑白的,输出的视频信号是PAL模式

  • facedetect mode默认支持NTSC模式。如果用PAL制,需要修改代码,见下面的e2e帖子。
    https://e2e.ti.com/support/embedded/starterware/f/790/p/223776/810098 

  • 你好

             你测试facedetect demo 时用的是PAL模式的摄像头还是NTSC模式的摄像头?

     

  • 用的NTSC的,用的PAL的没反应,不确定手头这个PAL的camera是否是好的。

  • facedetect demo 的源程序好多函数看不懂,这些函数在哪里能够查找到解析,  如在facedetect_lcdk.c 中的

    RasterDMAFBConfig函数

    /* Configuring the base ceiling */
    RasterDMAFBConfig(SOC_LCDC_0_REGS, (unsigned int) Rgb_buffer2,
    (unsigned int) (Rgb_buffer2 + DISPLAY_IMAGE_WIDTH * DISPLAY_IMAGE_HEIGHT + 15), 0);
    RasterDMAFBConfig(SOC_LCDC_0_REGS, (unsigned int) Rgb_buffer2,
    (unsigned int) (Rgb_buffer2 + DISPLAY_IMAGE_WIDTH * DISPLAY_IMAGE_HEIGHT + 15), 1);

    base ceiling是啥意思,

    PSCModuleControl函数

    /* Power on VPIF */
    PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_VPIF, PSC_POWERDOMAIN_ALWAYS_ON,
    PSC_MDCTL_NEXT_ENABLE);

    I2CPinMuxSetup函数

    /* Initialize I2C and program UI GPIO expander, TVP5147, and ADV7343 via I2C */
    I2CPinMuxSetup(0);


  • 主要是starterware里的函数。你看工程加了哪些库就知道来源了。

  • 你好! 

              face detect demo 源程序改成适合PAL模式的摄像头,比较麻烦,不一定成功,你们有没有另外的 适合PAL模式的摄像头现成demo,  不一定要有face detect 这一功能,但要有摄像和同时显示摄像头传过来的视频。

  • 你好,

          有没有文档详细介绍TMS320C6748内部SPI的各个寄存器的用法

  • TRM 

    http://www.ti.com/lit/ug/spruh79c/spruh79c.pdf

  • 谢谢!!找到了,但PSC  寄存器 的详细文档不知哪里下载,    TMS320C6748 DSP Technical Reference Manual.pdf 文档不知哪里下载  

  • TMS320C6748 DSP Technical Reference Manual (Rev. A)

    http://www.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spruh79a&fileType=pdf

    上面这个链接为空,TMS320C6748的PSC 寄存器的详细说明在哪 呢?

  • http://www.ti.com/lit/ug/spruh79c/spruh79c.pdf

    版本升级了。A到C了。

  • 您好!

              c6748有两个SPI, 地址也不一样,它们的作用区别在哪? Serial Peripheral Interface Ports (SPI0, SPI1), SPI0 BYTE ADDRESS 0x01C4 1000,

     SPI1 BYTE ADDRESS   0x01F0 E000

  • 就是两个,还有3个的,4个的。

  • 你好,

       我的DSP芯片上写着TMS320C6748EZWT  57A7CGW GID450  527 ZWT,

    我想知道DSP 的频率是375MHZ 还是 456MHZ

  • 你好

       我想用TMS320C6748 的SPI0接口与 max4896的SPI接口通信,

    max4896的spi_clk 的是10MHz    数据入口DIN的是5MHz,  那么在TMS320C6748的SPI, 用SPIClkConfigure(SOC_SPI_0_REGS, 150000000, 1000000, SPI_DATA_FORMAT0), 是否正确?


  • yh zhang 说:

       我的DSP芯片上写着TMS320C6748EZWT  57A7CGW GID450  527 ZWT,

    我想知道DSP 的频率是375MHZ 还是 456MHZ

    这个应该是375MHz的。上面的信息里没有关于频率的信息,即为空白,空白代表375MHz。

  • yh zhang 说:
    max4896的spi_clk 的是10MHz    数据入口DIN的是5MHz, 

    这句话怎么理解?

    至于后面函数的配置对不对,没有不对的。SPI通信在做主的情况下,只要能送出时钟就可以。

  • max4896也有SPI接口, 也是五个信号,spi_clk,cs, DIN,DOUT, RESET  其中  spi_clk 的频率是10MHz , 因为是同步通信, TMS320C6748的SPI 接口是否也要把

    spi_clk 的频率调整为10MHZ

  • 他指的10MHz,是指它最高支持到10MHz,不是你理解的一定要10MHz。

    即然时钟是10MHz,如你所说是同步接口,为什么数据是5MHz?

  • 确实,max4896的SPI_CLK最大值是10MHZ ,  那么C6748作为主模式时候,max4896的SPI_CLK是否自动调整和C6748的SPI_CLK的频率保持一致?

  • 这是基本概念的问题,没有自动调整这个说法与需要。既然是同步接口,slave就按host的时钟收发数据。host提供的时钟只要不超过10MHz就可以。

  • 你好,

      我现在用C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\examples\lcdkC6748\spi\spi.c

    来做TMS320C6748与MAX4896通讯,spi.c修改如下:

    原来的                                  修改后的

    SOC_SPI_1_REGS         SOC_SPI_0_REGS

    SYS_INT_SPI1_INT         SYS_INT_SPI0_INT

    HW_PSC_SPI1                 HW_PSC_SPI0

    cs  = 0x04;                            cs  = 0x10;
    dcs = 0x04;                           dcs = 0x10   // cs用SPI0_SCSn_4

    下面是修改后的:

    SPIDat1Config(SOC_SPI_0_REGS, (SPI_CSHOLD | SPI_DATA_FORMAT0), 0x10);

    SIMO_SOMI_CLK_CS   = 0x00000F10

     SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10);

    但spi中断没有触发,不知什么原因?  想问一下:触发spi中断需要什么条件?

    软件我使用CCS7.0

  • 你好!

    我想用TMS320C6748(开发板是TMDSLCDK6748) 的SPI0接口与MAX4896的SPI接口通信,

    下面是我修改C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\examples\lcdkC6748\spi\spi.c后的程序,现象是SPI中断没有触发,不知什么原因。请您指点一下。cs用SPI0_SCSn_4

    #include <xdc/std.h>

    #include <xdc/runtime/System.h>

    #include <ti/sysbios/BIOS.h>

    #include <ti/sysbios/knl/Task.h>

    #include <string.h>
    #include "soc_C6748.h"
    #include "hw_psc_C6748.h"
    #include "lcdkC6748.h"
    #include "uart.h"
    #include "spi.h"
    #include "psc.h"
    #include "interrupt.h"
    #include "uartStdio.h"



    #define SIMO_SOMI_CLK_CS        0x00000F10   
    #define CHAR_LENGTH             0x8

    /******************************************************************************
    **                      INTERNAL FUNCTION PROTOTYPES
    *******************************************************************************/
    static void SPIConfigDataFmtReg(unsigned int dataFormat);
    static void SpiTransfer(void);
    static void SetUpInt(void);
    static void SetUpSPI(void);
    //static void GetStatusCommand(void);
    static void SendCommand(void);
    void SPIIsr(void);

    /******************************************************************************
    **                      INTERNAL VARIABLE DEFINITIONS
    *******************************************************************************/
    volatile unsigned int flag = 1;
    unsigned int tx_len;
    unsigned int rx_len;
    unsigned char vrf_data[260];
    unsigned char tx_data[260];
    volatile unsigned char rx_data[260];
    unsigned char *p_tx;
    volatile unsigned char *p_rx;
    volatile unsigned char StatusResponseMessage[16];










    /*
     *  ======== taskFxn ========
     */
    Void taskFxn(UArg a0, UArg a1)
    {
        System_printf("enter taskFxn()\n");
        
        Task_sleep(10);
        
        System_printf("exit taskFxn()\n");
    }




    /*
     *  ======== main ========
     */
    Int main()
    {
        /*
         * use ROV->SysMin to view the characters in the circular buffer
         */
        System_printf("enter main()\n");
        

        PSCModuleControl(SOC_PSC_0_REGS, HW_PSC_SPI0, PSC_POWERDOMAIN_ALWAYS_ON,
                                     PSC_MDCTL_NEXT_ENABLE);

                    /* Initializing the UART instance for serial communication. */
        UARTStdioInit();

        UARTPuts("Welcome to StarterWare SPI application.\r\n\r\n", -1);
        UARTPuts("Here the SPI controller on the SoC communicates with", -1);
        UARTPuts(" the Fingerprint Sensor present on the LCDK.\r\n\r\n", -1);


        SPIPinMuxSetup(0);
        SPI0CSPinMuxSetup(4);
            /* Enable use of SPI1 interrupts. */
        SetUpInt();
        SetUpSPI();


        SendCommand;
        BIOS_start();    /* does not return */
        return(0);
    }




    static void SetUpInt(void)
    {
        // Setup the ARM or DSP interrupt controller

    #ifdef _TMS320C6X
        // Initialize the DSP interrupt controller
        IntDSPINTCInit();

        // Register the ISR in the vector table
        IntRegister(C674X_MASK_INT4, SPIIsr);

        // Map system interrupt to the DSP maskable interrupt
        IntEventMap(C674X_MASK_INT4, SYS_INT_SPI0_INT);

        // Enable the DSP maskable interrupt
        IntEnable(C674X_MASK_INT4);

        // Enable DSP interrupts globally
        IntGlobalEnable();
    #else
        /* Initialize the ARM Interrupt Controller.*/
        IntAINTCInit();

        /* Register the ISR in the Interrupt Vector Table.*/
        IntRegister(SYS_INT_SPINT1, SPIIsr);

        /* Set the channnel number 2 of AINTC for system interrupt 56.
         * Channel 2 is mapped to IRQ interrupt of ARM9.
        */
        IntChannelSet(SYS_INT_SPINT1, 2);

        /* Enable the System Interrupts for AINTC.*/
        IntSystemEnable(SYS_INT_SPINT1);

        /* Enable IRQ in CPSR.*/
        IntMasterIRQEnable();

        /* Enable the interrupts in GER of AINTC.*/
        IntGlobalEnable();

        /* Enable the interrupts in HIER of AINTC.*/
        IntIRQEnable();
    #endif
    }

    void SPIIsr(void)
    {
        unsigned int intCode = 0;

    #ifdef _TMS320C6X
        IntEventClear(SYS_INT_SPI0_INT);
    #else
        IntSystemStatusClear(56);
    #endif

        intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);

        while (intCode)
        {
            if(intCode == SPI_TX_BUF_EMPTY)
            {
                tx_len--;
                SPITransmitData1(SOC_SPI_0_REGS, *p_tx);
                p_tx++;
                if (!tx_len)
                {
                    SPIIntDisable(SOC_SPI_0_REGS, SPI_TRANSMIT_INT);
                    break;
                }
            }

            if(intCode == SPI_RECV_FULL)
            {
                rx_len--;
                *p_rx = (char)SPIDataReceive(SOC_SPI_0_REGS);
                p_rx++;
                if (!rx_len)
                {
                    flag = 0;
                    SPIIntDisable(SOC_SPI_0_REGS, SPI_RECV_INT);
                }
            }

            intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);
        }
    }


    static void SetUpSPI(void)
    {
        unsigned char cs  = 0x10;
        unsigned char dcs = 0x10;
        unsigned int  val = SIMO_SOMI_CLK_CS;
        SPIReset(SOC_SPI_0_REGS);

        SPIOutOfReset(SOC_SPI_0_REGS);

        SPIModeConfigure(SOC_SPI_0_REGS, SPI_MASTER_MODE);

        //SPIClkConfigure(SOC_SPI_1_REGS, 150000000, 20000000, SPI_DATA_FORMAT0);
        SPIClkConfigure(SOC_SPI_0_REGS, 150000000, 1000000, SPI_DATA_FORMAT0);

        SPIPinControl(SOC_SPI_0_REGS, 0, 0, &val);

        SPIDefaultCSSet(SOC_SPI_0_REGS, dcs);

        /* Configures SPI Data Format Register */
        SPIConfigDataFmtReg(SPI_DATA_FORMAT0);

         /* Selects the SPI Data format register to used and Sets CSHOLD
          * to assert CS pin(line)
          */
        SPIDat1Config(SOC_SPI_0_REGS, (SPI_CSHOLD | SPI_DATA_FORMAT0), cs);

         /* map interrupts to interrupt line INT1 */
        SPIIntLevelSet(SOC_SPI_0_REGS, SPI_RECV_INTLVL | SPI_TRANSMIT_INTLVL);

        /* Enable SPI communication */
        SPIEnable(SOC_SPI_0_REGS);
    }
    /*
    ** Configures Data Format register of SPI
    **
    */
    static void SPIConfigDataFmtReg(unsigned int dataFormat)
    {
        /* Configures the polarity and phase of SPI clock */

        SPIConfigClkFormat(SOC_SPI_0_REGS,
                           (SPI_CLK_POL_HIGH | SPI_CLK_INPHASE),
                           dataFormat);

        //SPIConfigClkFormat(SOC_SPI_0_REGS,
        //                   (SPI_CLK_POL_LOW | SPI_CLK_INPHASE),
         //                  dataFormat);

        /* Configures SPI to transmit MSB bit First during data transfer */
        SPIShiftMsbFirst(SOC_SPI_0_REGS, dataFormat);

        /* Sets the Charcter length */
        SPICharLengthSet(SOC_SPI_0_REGS, CHAR_LENGTH, dataFormat);
    }

    static void SendCommand(void)
    {
        // Issue Reset Command
        tx_data[0] = 0x10;
        tx_data[1] = 0x10;
        tx_data[2] = 0x10;
        tx_data[3] = 0x10;
        tx_data[4] = 0x08;
        tx_data[5] = 0x08;
        tx_data[6] = 0x08;

        tx_len = 7;
        rx_len = 7;

        SPIDat1Config(SOC_SPI_0_REGS, (SPI_CSHOLD | SPI_DATA_FORMAT0), 0x10);
        SpiTransfer();
    }


    static void  SpiTransfer(void)
    {
        //unsigned int intCode = 0;
        p_tx = &tx_data[0];
        p_rx = &rx_data[0];
        SPIIntEnable(SOC_SPI_0_REGS, (SPI_RECV_INT | SPI_TRANSMIT_INT));
        //while(flag);
        flag = 1;

        /*
        intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);

            while (intCode)
            {
              //  if(intCode == SPI_TX_BUF_EMPTY)
              //  {
                    tx_len--;
                    SPITransmitData1(SOC_SPI_0_REGS, *p_tx);
                    p_tx++;
                    if (!tx_len)
                    {
                        SPIIntDisable(SOC_SPI_0_REGS, SPI_TRANSMIT_INT);
                        break;
                    }
              //  }
            }

            */
        /* Deasserts the CS pin(line) */
        SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10);
    }



  • 你好,

      现在我想知道 spi0 module clock 的频率,  但SPI0 module clock (PLL0.SYSCLK2) is fixed ratio to SYSCLK1/2,

    Table 6-5. Maximum Internal Clock Frequencies at Each Voltage Operating Point

    CLOCK
    SOURCE
    CLOCK DOMAIN 1.3V NOM 1.2V NOM 1.1V NOM 1.0V NOM
    PLL0_SYSCLK1 DSP subsystem 456 MHz 375 MHz 200 MHz 100 MHz
    SYSCLK2 clock domain peripherals and optional clock source for ASYNC3 clock domain peripherals 228 MHz 187.5 MHz 100 MHz 50 MHz


    所以我现在想知道  CPU的电压操作点,如何知道CPU的电压操作点,我用的板是TMDSLCDK6748


  • 现在spi0中断可以触发了,但没有时钟信号啊,也就是spi0_clk一直是某一低电平,没有频率

  • 你好

    我想用TMS320C6748(开发板是TMDSLCDK6748) 的SPI0接口与MAX4896的SPI接口通信,

    下面是我修改C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\examples\lcdkC6748\spi\spi.c

    现在现象是SPI0_CLK, SPI0_MOSI都没有信号,不知什么原因。但SPI0中断可以触发  cs用的是SPI0_SCSn_4

    #define SIMO_SOMI_CLK_CS        0x00000E10

    #define CHAR_LENGTH             0x8

     

    static void SPIConfigDataFmtReg(unsigned int dataFormat);

    static void SpiTransfer(void);

    static void SetUpInt(void);

    static void SetUpSPI(void);

    void SPIIsr(UArg arg);

     

    main()

    {

         PSCModuleControl(SOC_PSC_0_REGS, HW_PSC_SPI0, PSC_POWERDOMAIN_ALWAYS_ON,

                                             PSC_MDCTL_NEXT_ENABLE);

     

                            //Initializing the UART instance for serial communication. //

            UARTStdioInit();

     

            UARTPuts("Welcome to StarterWare SPI application.\r\n\r\n", -1);

            UARTPuts("Here the SPI controller on the SoC communicates with", -1);

            UARTPuts(" the Fingerprint Sensor present on the LCDK.\r\n\r\n", -1);

     

     

            //This function selects the SPI0 pins for use. The SPI0 pins

             //          are multiplexed with pins of other peripherals in the

             //         System on Chip(SoC).

            SPIPinMuxSetup(0);

     

     

            //This function selects the specified Chip Select(CS) pin of

            //          SPI0 for use.

            SPI0CSPinMuxSetup(4);

            // Enable use of SPI1 interrupts. //

            SetUpSPI();

    Hwi_Params_init(&params);

        params.eventId = 37;

        params.enableInt = FALSE;

        Error_init(&eb);

        Hwi3 = Hwi_create(4, &SPIIsr, &params, &eb);

        if (Hwi3 == NULL)

        {

            System_printf("Hwi_create() failed for SPI!\n");

            BIOS_exit(0);

        }

        Hwi_enable();

            Hwi_enableInterrupt(4);

        while(1)

            SendCommand();

     

           

    }

     

    static void SendCommand(void)

    {

        // Issue Reset Command

        tx_data[0] = 0x10;

        tx_data[1] = 0x10;

        tx_data[2] = 0x10;

        tx_data[3] = 0x10;

        tx_data[4] = 0x10;

        tx_data[5] = 0x10;

        tx_data[6] = 0x10;

     

        tx_len = 7;

        rx_len = 7;

     

     

        SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10);  //select dataformat0,  0x10 is SPIx_SCS[4] ?????? what is dataformat0 and CSDEF field

        //The CSDEF field defines the state of the the SPIx_SCS[n] pins when no transmissions are performed.

        //The CSNR field defines the state of the SPIx_SCS[n] pins during a master data transfer.

        SpiTransfer();

    }

     

    static void SetUpSPI(void)

    {

      

        unsigned char cs  = 0x10;

        unsigned char dcs = 0x10;

     

        unsigned int  val = SIMO_SOMI_CLK_CS;

      

        SPIReset(SOC_SPI_0_REGS);

     

        SPIOutOfReset(SOC_SPI_0_REGS);

        SPIModeConfigure(SOC_SPI_0_REGS, SPI_MASTER_MODE);

     

        SPIClkConfigure(SOC_SPI_0_REGS, 150000000, 1000000, SPI_DATA_FORMAT0); //? set the prescale of clock = 150000000/1000000 - 1

     

        SPIPinControl(SOC_SPI_0_REGS, 0, 0, &val);

     

      

      

        SPIDefaultCSSet(SOC_SPI_0_REGS, dcs);

        /* Configures SPI Data Format Register */

        SPIConfigDataFmtReg(SPI_DATA_FORMAT0);

     

         /* Selects the SPI Data format register to used and Sets CSHOLD

          * to assert CS pin(line)

          */

     

        SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, cs);

         /* map interrupts to interrupt line INT1 */

     

        SPIIntLevelSet(SOC_SPI_0_REGS, SPI_RECV_INTLVL | SPI_TRANSMIT_INTLVL);

        /* Enable SPI communication */

     

        SPIEnable(SOC_SPI_0_REGS);

    }

    /*

    ** Configures Data Format register of SPI

    **

    */

    static void SPIConfigDataFmtReg(unsigned int dataFormat)

    {

        /* Configures the polarity and phase of SPI clock */

      

     

     

        SPIConfigClkFormat(SOC_SPI_0_REGS,

                               (SPI_CLK_POL_LOW | SPI_CLK_INPHASE), //?PHASE

                               dataFormat);

     

     

     

        /* Configures SPI to transmit MSB bit First during data transfer */

        SPIShiftMsbFirst(SOC_SPI_0_REGS, dataFormat);

        /* Sets the Charcter length */

     

        SPICharLengthSet(SOC_SPI_0_REGS, CHAR_LENGTH, dataFormat);

    }

     

    /*

    ** Enables SPI Transmit and Receive interrupt.

    ** Deasserts Chip Select line.

    */

    static void  SpiTransfer(void)

    {

        p_tx = &tx_data[0];

        p_rx = &rx_data[0];

        SPIIntEnable(SOC_SPI_0_REGS, (SPI_RECV_INT | SPI_TRANSMIT_INT));

        while(flag);

        flag = 1;

        /* Deasserts the CS pin(line) */

     

        SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10);

    }

     

    /*

    ** Data transmission and receiption SPIIsr

    **

    */

    void SPIIsr(UArg arg)

    {

        unsigned int intCode = 0;

     

    #ifdef _TMS320C6X

     

        IntEventClear(SYS_INT_SPI0_INT);

    #else

        IntSystemStatusClear(56);

    #endif

     

     

        intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);

        while (intCode)

        {

            if(intCode == SPI_TX_BUF_EMPTY)

            {

                tx_len--;

                //SPITransmitData1(SOC_SPI_1_REGS, *p_tx);

                SPITransmitData1(SOC_SPI_0_REGS, *p_tx);

                p_tx++;

                if (!tx_len)

                {

           

                    SPIIntDisable(SOC_SPI_0_REGS, SPI_TRANSMIT_INT);

                }

            }

     

            if(intCode == SPI_RECV_FULL)

            {

                rx_len--;

        

                *p_rx = (char)SPIDataReceive(SOC_SPI_0_REGS);

                p_rx++;

                if (!rx_len)

                {

                    flag = 0;

     

                    SPIIntDisable(SOC_SPI_0_REGS, SPI_RECV_INT);

                }

            }

     

     

            intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);

        }

    }

     

     

     

     

     

     

     

     

     

  • 你好,

       我想问一下,因为开发板TMDSLCDK6748 的SPI0接口线与其他设备接口线共用,如EPWM0,MII , LAN8710A-EZK,  如要使用SPI0,

    除了一开始要

          PSCModuleControl(SOC_PSC_0_REGS, HW_PSC_SPI0, PSC_POWERDOMAIN_ALWAYS_ON,PSC_MDCTL_NEXT_ENABLE);
       
            //This function selects the SPI0 pins for use. The SPI0 pins
             //          are multiplexed with pins of other peripherals in the
            //         System on Chip(SoC).
           SPIPinMuxSetup(0);
            //This function selects the specified Chip Select(CS) pin of
            //          SPI0 for use.
            SPI0CSPinMuxSetup(4);

    还要执行哪些步骤?

  • 你好,

       我想问一下,  我用Facedetect demo 的源程序做开发, 但我发现Facedetect demo 的帧率太低了, 即使去掉Facedetect的功能,但帧率依然太低(每秒只有6帧), 想提高帧率,不知用啥办法?