AnsweredAssumed Answered

Why ADSPCM403‘s SPI0_SEL3 pin always 'high'???

Question asked by hlg on Jul 21, 2014
Latest reply on Jul 22, 2014 by John_M

Hi

     When I use ADSPCM403‘s SPI0,the SPI0_MOSI pin and SPI0_CLK is working good ,only SPI0_SEL3 pin always 'high'.Normally when SPI transfers the data it should be 'low'.

I already config the Pin function,I show my source code below,would anybody do me a favor?

 

#include <stdio.h>

#include <device1.h>

#include <system.h> 

 

void wait (Uint32 a)

{

    char i;

    while(a--)

      for(i=0;i<120;i++);

}

void main (void)

{

  SystemInit();

 

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

                                //DPM

  //Uint32 a;

  DPM->CTL       =0x00000002;               

  DPM->CCBF_DIS  =0x00000000;             

  DPM->CCBF_EN   =0x00000001;               

  DPM->SCBF_DIS  =0x00000001;

 

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

                              //CGU0

  //Uint32 a;

  CGU0->CTL       =0x00000100;                 //0x40016000        /* CGU0 Control Register */PLL=30MHZ*8*2=480MHZ

 

  CGU0->DIV       =0x41882828;                //0x40016008         /* CGU0 Clocks Divisor Register */

 

  CGU0->CLKOUTSEL =0x0000001;              //0x4001600C         /* CGU0 CLKOUT Select Register */ 

 

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

                                //GPIO

 

   GPIOC->FER|=(BIT3|BIT4|BIT5);

   GPIOC->MUX=0x00000000;

   GPIOC->FER_SET|=(BIT3|BIT4|BIT5);// for SPI0_CLK/MOSI/MISO PIN

  

   GPIOB->FER|=(BIT14);

   GPIOB->FER_SET|=(BIT14);

   GPIOB->MUX|=(BIT29);                       //for SPI0_SEL3 pin

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

                                     //SPI0

   *SPI0_CLK=    0x00000040;         //clk=sclk/1024

  

   *SPI0_TXCTL=  0x00010155;

  

   *SPI0_CTL=0x004442ae;

 

   *SPI0_CTL |= 1;

  

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

     while(1)

   {

     wait (100);

    *SPI0_TFIFO=0x1055;

     wait (100);

   }

  

  

}

Thanks in advance

Best regards,

hlg.


Outcomes