[SOLVED]Audio codec shield with Arduino Due

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jul 07, 2015 8:32 am

I am not able to get any data from the SPI. My first variable left_in was initialized to 30000 but now after SPI it gets written with 0, right_in remains the same as 30000(as to what it was initialized to when declaring it).So should I scope the MISO line? I am setting the clock like this
Code: Select all
uint32_t rc = (11111111/44100); //128 because we selected TIMER_CLOCK4 above
        //TC_SetRA(tc, channel, rc/2); //50% high, 50% low
        //TC_SetRC(tc, channel, rc);
        //TC_Start(tc, channel);
       
   TC_SetRA(TC2,TC2_CHANNEL_FOR_TCLK8,rc/2);     
   TC_SetRC(TC2, TC2_CHANNEL_FOR_TCLK8,rc);
   /* start the timer */
   TC_Start(TC2, TC2_CHANNEL_FOR_TCLK8);
   /* enable the timer-specific interrupts */
   REG_TC2_IER2 = TC_IER_CPCS | TC_IER_ETRGS;
   TC2->TC_CHANNEL[TC2_CHANNEL_FOR_TCLK8].TC_IER=TC_IER_CPCS;
   TC2->TC_CHANNEL[TC2_CHANNEL_FOR_TCLK8].TC_IDR=~TC_IER_CPCS;

And SPI like this:
Code: Select all
SPI.begin(10);
        SPI.setBitOrder(MSBFIRST);
        SPI.setClockDivider(10,84); // select to ss pin 10, 4 MHz// favourable values 11,21,84
        SPI.setDataMode(10,SPI_MODE0);
       
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jul 07, 2015 10:19 pm

I found the problem. The moment I put this function the ISR does not respond.
temp_spi[0] = SPI.transfer(10,highByte(temp),SPI_CONTINUE);

May be doing the transfer in the ISR is difficult, may be there isnt enough time for it. So how did you handle this in the maple?

Ranjan
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Tue Jul 07, 2015 10:24 pm

Here is my code but the ISR gets stuck if I include SPI.transfer function in it.
Code: Select all
include<SPI.h>
#include<Wire.h>
#define TC2_CHANNEL_FOR_TCLK8 2  /* presumed to correspond to XC2 */
#define LINVOL 23
#define RINVOL 23
#define LHPVOL 100
#define RHPVOL 100
#define ADCHPD 0
#define SIDEATT 0
#define SIDETONE 0
#define DACSEL 1
#define BYPASS 0
#define INSEL 0
#define MUTEMIC 1
#define MICBOOST 0
#define SAMPLE_RATE 44

volatile boolean l;

unsigned int temp = 0,temp1=0;
int temp_spi[4];
int m1[301],m2[301];
//TC1 ch 0
int left_out,right_out;
enum Phase
   {
      TC2_INTERNAL,
      PIOD_EXTERNAL,
      TC2_EXTERNAL,
      DONE
   };
   
  /* enum Phase
   {
      TC2_EXTERNAL,
      TC2_EXTERNAL,
      TC2_EXTERNAL,
      DONE
   };*/

Phase phase;
int pioIRQsServiced;
int tc2IRQsServiced[3];
unsigned int status;
int upflag = 0;
bool ledon,ledon1=0;
int oldmillis=0;
volatile int left_in=30000;
volatile int right_in=30000;

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

void PIOD_Handler(void)
{
   /* clear interrupt */
   status = REG_PIOD_ISR;
   pioIRQsServiced++;
}


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

void TC8_Handler()
{
  ledon1= !(ledon1);
    digitalWrite(13,ledon1);
  /* clear interrupt */
   status = TC_GetStatus(TC2, TC2_CHANNEL_FOR_TCLK8);
   if (status & TC_SR_CPCS)
   {
      if (phase == TC2_INTERNAL)
      {
         tc2IRQsServiced[0]++;
      }
      else
      {
         tc2IRQsServiced[1]++;
      }
   }
   if (status & TC_SR_ETRGS)
   {
      tc2IRQsServiced[2]++;
   }
    temp = random(65535);
        //temp = left_out;
        //temp1 = right_out;
        temp_spi[0] = SPI.transfer(10,highByte(temp),SPI_CONTINUE);
        temp_spi[1] = SPI.transfer(10,lowByte(temp),SPI_CONTINUE);
        temp_spi[2] = SPI.transfer(10,highByte(temp),SPI_CONTINUE);
        temp_spi[3] = SPI.transfer(10,lowByte(temp),SPI_LAST);
        left_in - (temp_spi[0]<<8)|temp_spi[1];
        right_in = (temp_spi[2]<<8)|temp_spi[3];
       
}


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

void SetupPIOD(void)
{
   int result;

   /* power on PIO ("Parallel Input/Output Controller") controller D */
   pmc_enable_periph_clk(ID_PIOD);
   /* enable interrupts for PIOD */
   NVIC_EnableIRQ(PIOD_IRQn);
   /* configure PD9 as general-purpose IO pin as opposed to the TCLK8 peripheral */
   result = PIO_Configure(PIOD, PIO_INPUT, PIO_PD9, PIO_IT_RISE_EDGE);
   printf("%d <- PIO_Configure\n", result);
   /* ensure we're interrupting on the rising edge of the external clock */
   REG_PIOD_AIMER = PIO_PD9;
   REG_PIOD_ESR = PIO_PD9;
   REG_PIOD_REHLSR = PIO_PD9;
   /* enable interrupts */
   REG_PIOD_IER = PIO_PD9;
}


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

void TakeDownPIOD(void)
{
   TC_Stop(TC2, TC2_CHANNEL_FOR_TCLK8);
   TC_SetRC(TC2, TC2_CHANNEL_FOR_TCLK8, 0);
   REG_PIOD_IDR = PIO_PD9;
   NVIC_DisableIRQ(TC8_IRQn);
   pmc_disable_periph_clk(ID_PIOD);
}


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

void SetupTC2(bool useInternalClock)
{
   int result;

   /* "The user must configure the Power Management Controller before any access to the input line information." per 34.4.2 */
   pmc_enable_periph_clk(ID_TC8);
   /* "Using the PIO Controller requires the NVIC to be programmed first." per 34.4.3 */
   NVIC_EnableIRQ(TC8_IRQn);
   result = PIO_Configure(PIOD, PIO_PERIPH_B, PIO_ABSR_P9, PIO_DEFAULT);
   //printf("%d <- PIO_Configure\n", result);
   if (useInternalClock)
   {
      TC_Configure(TC2,
                TC2_CHANNEL_FOR_TCLK8,
                TC_CMR_TCCLKS_TIMER_CLOCK4 | TC_CMR_WAVSEL_UP_RC | TC_CMR_WAVE);
   }
   else
   {
      TC_Configure(TC2,
                TC2_CHANNEL_FOR_TCLK8,
                (TC_CMR_TCCLKS_XC2 |
                 TC_CMR_EEVTEDG_RISING |
                 TC_CMR_EEVT_XC2 |
                 TC_CMR_ENETRG |
                 TC_CMR_WAVSEL_UP_RC |
                 TC_CMR_WAVE));
   }
   //5714285
   uint32_t rc = (11111111/44100); //128 because we selected TIMER_CLOCK4 above
        //TC_SetRA(tc, channel, rc/2); //50% high, 50% low
        //TC_SetRC(tc, channel, rc);
        //TC_Start(tc, channel);
       
   TC_SetRA(TC2,TC2_CHANNEL_FOR_TCLK8,rc/2);     
   TC_SetRC(TC2, TC2_CHANNEL_FOR_TCLK8,rc);
   /* start the timer */
   TC_Start(TC2, TC2_CHANNEL_FOR_TCLK8);
   /* enable the timer-specific interrupts */
   REG_TC2_IER2 = TC_IER_CPCS | TC_IER_ETRGS;
   TC2->TC_CHANNEL[TC2_CHANNEL_FOR_TCLK8].TC_IER=TC_IER_CPCS;
   TC2->TC_CHANNEL[TC2_CHANNEL_FOR_TCLK8].TC_IDR=~TC_IER_CPCS;
  // NVIC_EnableIRQ(TC8_IRQn);
}


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

void TakeDownTC2(void)
{
   TC_Stop(TC2, TC2_CHANNEL_FOR_TCLK8);
   TC_SetRC(TC2, TC2_CHANNEL_FOR_TCLK8, 0);
   REG_TC2_IDR2 = TC_IER_CPCS | TC_IER_ETRGS;
   NVIC_DisableIRQ(TC8_IRQn);
   pmc_disable_periph_clk(ID_TC8);
}

/* Clock settings (96MHz) */
 #define SYS_BOARD_OSCOUNT   (CKGR_MOR_MOSCXTST(0x8UL))
 #define SYS_BOARD_PLLAR     (CKGR_PLLAR_ONE \
                             | CKGR_PLLAR_MULA(0xfUL) \
                             | CKGR_PLLAR_PLLACOUNT(0x3fUL) \
                             | CKGR_PLLAR_DIVA(0x1UL))
 #define SYS_BOARD_MCKR      (PMC_MCKR_PRES_CLK_2 | PMC_MCKR_CSS_PLLA_CLK)
 
 /* Clock Definitions */
 #define SYS_UTMIPLL             (480000000UL)   /* UTMI PLL frequency */
 
 #define SYS_CKGR_MOR_KEY_VALUE  CKGR_MOR_KEY(0x37UL) /* Key to unlock MOR register */
 
 /* FIXME: should be generated by sock */
 uint32_t SystemCoreClock = CHIP_FREQ_MAINCK_RC_4MHZ;
 
 void SystemInit(void)
 {
     /* Set FWS according to SYS_BOARD_MCKR configuration */
     EFC0->EEFC_FMR = EEFC_FMR_FWS(4);
     EFC1->EEFC_FMR = EEFC_FMR_FWS(4);
 
     /* Initialize main oscillator */
     if (!(PMC->CKGR_MOR & CKGR_MOR_MOSCSEL)) {
         PMC->CKGR_MOR = SYS_CKGR_MOR_KEY_VALUE | SYS_BOARD_OSCOUNT |
                                 CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN;
         while (!(PMC->PMC_SR & PMC_SR_MOSCXTS)) {
         }
     }
 
     /* Switch to 3-20MHz Xtal oscillator */
     PMC->CKGR_MOR = SYS_CKGR_MOR_KEY_VALUE | SYS_BOARD_OSCOUNT |
                                CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN | CKGR_MOR_MOSCSEL;
 
     while (!(PMC->PMC_SR & PMC_SR_MOSCSELS)) {
     }
     PMC->PMC_MCKR = (PMC->PMC_MCKR & ~(uint32_t)PMC_MCKR_CSS_Msk) |
                               PMC_MCKR_CSS_MAIN_CLK;
     while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) {
     }
 
     /* Initialize PLLA */
     PMC->CKGR_PLLAR = SYS_BOARD_PLLAR;
     while (!(PMC->PMC_SR & PMC_SR_LOCKA)) {
     }
 
     /* Switch to main clock */
     PMC->PMC_MCKR = (SYS_BOARD_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK;
     while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) {
     }
 
     /* Switch to PLLA */
     PMC->PMC_MCKR = SYS_BOARD_MCKR;
     while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) {
     }
 
     SystemCoreClock = CHIP_FREQ_CPU_MAX;
 }
 
 void SystemCoreClockUpdate(void)
 {
     /* Determine clock frequency according to clock register values */
     switch (PMC->PMC_MCKR & PMC_MCKR_CSS_Msk) {
     case PMC_MCKR_CSS_SLOW_CLK: /* Slow clock */
         if (SUPC->SUPC_SR & SUPC_SR_OSCSEL) {
             SystemCoreClock = CHIP_FREQ_XTAL_32K;
         } else {
             SystemCoreClock = CHIP_FREQ_SLCK_RC;
         }
         break;
     case PMC_MCKR_CSS_MAIN_CLK: /* Main clock */
         if (PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) {
             SystemCoreClock = CHIP_FREQ_XTAL_12M;
         } else {
             SystemCoreClock = CHIP_FREQ_MAINCK_RC_4MHZ;
 
             switch (PMC->CKGR_MOR & CKGR_MOR_MOSCRCF_Msk) {
             case CKGR_MOR_MOSCRCF_4_MHz:
                 break;
             case CKGR_MOR_MOSCRCF_8_MHz:
                 SystemCoreClock *= 2U;
                 break;
             case CKGR_MOR_MOSCRCF_12_MHz:
                 SystemCoreClock *= 3U;
                 break;
             default:
                 break;
             }
         }
         break;
     case PMC_MCKR_CSS_PLLA_CLK: /* PLLA clock */
     case PMC_MCKR_CSS_UPLL_CLK: /* UPLL clock */
         if (PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) {
             SystemCoreClock = CHIP_FREQ_XTAL_12M;
         } else {
             SystemCoreClock = CHIP_FREQ_MAINCK_RC_4MHZ;
 
             switch (PMC->CKGR_MOR & CKGR_MOR_MOSCRCF_Msk) {
             case CKGR_MOR_MOSCRCF_4_MHz:
                 break;
             case CKGR_MOR_MOSCRCF_8_MHz:
                 SystemCoreClock *= 2U;
                 break;
             case CKGR_MOR_MOSCRCF_12_MHz:
                 SystemCoreClock *= 3U;
                 break;
             default:
                 break;
             }
         }
         if ((PMC->PMC_MCKR & PMC_MCKR_CSS_Msk) == PMC_MCKR_CSS_PLLA_CLK) {
             SystemCoreClock *= ((((PMC->CKGR_PLLAR) & CKGR_PLLAR_MULA_Msk) >>
                                           CKGR_PLLAR_MULA_Pos) + 1U);
             SystemCoreClock /= ((((PMC->CKGR_PLLAR) & CKGR_PLLAR_DIVA_Msk) >>
                                            CKGR_PLLAR_DIVA_Pos));
         } else {
             SystemCoreClock = SYS_UTMIPLL / 2U;
         }
         break;
     }
 
     if ((PMC->PMC_MCKR & PMC_MCKR_PRES_Msk) == PMC_MCKR_PRES_CLK_3) {
         SystemCoreClock /= 3U;
     } else {
         SystemCoreClock >>= ((PMC->PMC_MCKR & PMC_MCKR_PRES_Msk) >>
                                        PMC_MCKR_PRES_Pos);
     }
 }
 
 void TC3_Handler()
{
        TC_GetStatus(TC1, 0);

        /*temp = random(65535);
        //temp = left_out;
        //temp1 = right_out;
        temp_spi[0] = SPI.transfer(10,highByte(temp),SPI_CONTINUE);
        temp_spi[1] = SPI.transfer(10,lowByte(temp),SPI_CONTINUE);
        temp_spi[2] = SPI.transfer(10,highByte(temp),SPI_CONTINUE);
        temp_spi[3] = SPI.transfer(10,lowByte(temp),SPI_LAST);
        //left_in - (temp_spi[0]<<8)|temp_spi[1];
        //right_in = (temp_spi[2]<<8)|temp_spi[3];
        /*Serial.println("Hello");
        Serial.println(temp_spi[0]);
        Serial.println(temp_spi[1]);
        Serial.println(temp_spi[2]);
        Serial.println(temp_spi[3]);*/
}

void startTimer(Tc *tc, uint32_t channel, IRQn_Type irq, uint32_t frequency) {
        pmc_set_writeprotect(false);
        pmc_enable_periph_clk((uint32_t)irq);
        TC_Configure(tc, channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
        uint32_t rc = VARIANT_MCK/128/frequency; //128 because we selected TIMER_CLOCK4 above
        TC_SetRA(tc, channel, rc/2); //50% high, 50% low
        TC_SetRC(tc, channel, rc);
        TC_Start(tc, channel);
        tc->TC_CHANNEL[channel].TC_IER=TC_IER_CPCS;
        tc->TC_CHANNEL[channel].TC_IDR=~TC_IER_CPCS;
        NVIC_EnableIRQ(irq);
}

 void AudioCodec_init() {
        randomSeed(analogRead(0));
        SPI.begin(10);
        SPI.setBitOrder(MSBFIRST);
        SPI.setClockDivider(10,84); // select to ss pin 10, 4 MHz// favourable values 11,21,84
        SPI.setDataMode(10,SPI_MODE0);
       
        // setup i2c pins and configure codec
        // the new Wire library has trouble with 0x00, so (uint8_t) is added
        // To change the Wire interface speed, go to:
        // <path_from_arduino>\hardware\arduino\sam\libraries\Wire\Wire.h
        // and change the parameters TWI_CLOCK, RECV_TIMEOUT and XMIT_TIMEOUT
        // to the desire frequency.
        int temp_wire1;
        int temp_wire2;
       
        Wire.begin();
        Wire.beginTransmission(0x1a);
        Wire.write(0x0c); // power reduction register
        Wire.write((uint8_t)0x00); // turn everything on
        temp_wire1 = Wire.endTransmission();
       
        Wire.beginTransmission(0x1a);
        Wire.write(0x0e); // digital data format
        Wire.write(0x03); // 16b SPI mode
        temp_wire2 = Wire.endTransmission();
       
        Serial.println(temp_wire1);
        Serial.println(temp_wire2);
       
        Wire.beginTransmission(0x1a);
        Wire.write((uint8_t)0x00); // left in setup register
        Wire.write((uint8_t)LINVOL);
        Wire.endTransmission();
       
        Wire.beginTransmission(0x1a);
        Wire.write(0x02); // right in setup register
        Wire.write((uint8_t)RINVOL);
        Wire.endTransmission();
       
        Wire.beginTransmission(0x1a);
        Wire.write(0x04); // left headphone out register
        Wire.write((uint8_t)LHPVOL);
        Wire.endTransmission();
       
        Wire.beginTransmission(0x1a);
        Wire.write(0x06); // right headphone out register
        Wire.write((uint8_t)RHPVOL);
        Wire.endTransmission();
       
        Wire.beginTransmission(0x1a);
        Wire.write(0x0a); // digital audio path configuration
        Wire.write((uint8_t)ADCHPD);
        Wire.endTransmission();
       
        Wire.beginTransmission(0x1a);
        Wire.write(0x08); // analog audio pathway configuration
        Wire.write((uint8_t)((SIDEATT << 6)|(SIDETONE << 5)|(DACSEL << 4)|(BYPASS << 3)|(INSEL << 2)|(MUTEMIC << 1)|(MICBOOST << 0)));
        Wire.endTransmission();
       
        Wire.beginTransmission(0x1a);
        Wire.write(0x10); // clock configuration
        #if SAMPLE_RATE == 88
          Wire.write(0xbc);
        #elif SAMPLE_RATE == 44
          Wire.write(0xa0);
        #elif SAMPLE_RATE == 22
          Wire.write(0xe0);
        #elif SAMPLE_RATE == 8
          Wire.write(0xac);
        #elif SAMPLE_RATE == 2
          Wire.write(0xce);
        #endif
        Wire.endTransmission();
     
        Wire.beginTransmission(0x1a);
        Wire.write(0x12); // codec enable
        Wire.write(0x01);
        Wire.endTransmission();
       
}
/****************************************************************/

void setup(void)
{
   pinMode(12,OUTPUT);
   pinMode(13,OUTPUT);
   //SPI.begin();
   SystemInit();
   SystemCoreClockUpdate();
  // AudioCodec_init();
   //startTimer(TC1, 0, TC3_IRQn, 44100);
   Serial3.begin(6000000);
   Serial3.println("Ranjan test");
   Serial3.println("start with TC2 internal\n");
   SetupTC2(false);
}


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

void loop(void)
{
 
   Serial2.println("Rnnjan in loop");
       
  phase=TC2_EXTERNAL;
  //Serial.println(phase);
   switch (phase)
   {
      case TC2_INTERNAL:
         if (tc2IRQsServiced[0] > 250000)
         {
            phase = PIOD_EXTERNAL;
            TakeDownTC2();
            printf("PASSED\nswitch to PIOD\n");
            SetupPIOD();
         }
         break;
      case PIOD_EXTERNAL:
         if (pioIRQsServiced > 20)
         {
            phase = TC2_EXTERNAL;
            TakeDownTC2();
            printf("PASSED\nswitch to TC2 external\n");
            SetupTC2(false);
         }
         break;
      case TC2_EXTERNAL:
      SetupTC2(false);
         if (tc2IRQsServiced[1] > 20)
         {
            printf("PASSED!!!\n");
            for ( ; ; );
         }
         break;
      default:
         break;
   }
   //delay(1000);
   Serial3.println(left_in);
   Serial3.println(right_in);
  // printf("PIO IRQs: %d, CPCS internal IRQs: %d, CPCS external IRQs: %d, ETRGS external IRQs: %d, status: %08x, CV2: %d\n", pioIRQsServiced, tc2IRQsServiced[0], tc2IRQsServiced[1], tc2IRQsServiced[2], status, REG_TC2_CV2);
 
}
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Wed Jul 08, 2015 3:59 am

I did one thing. Instead of putting the SPI.transfer( ) calls in the ISR I put in the main loop and when the Due encounters it the main loop it just hangs.So what is going wrong with the SPI here?(I have posted my code).
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Wed Jul 08, 2015 4:27 am

I did this
Code: Select all
void loop( )
{
  Serial3.println("Hello");
  temp = SPI.transfer(10,highByte(temp)); 
  Serial3.println(temp);
  //delay(10);
}


Instead of the ISR_handler I put SPI.transfer in the main but the variable temp still reads 0. So obviously the SPI is not working.How shall I handle this?
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Wed Jul 08, 2015 4:48 am

Theoretically if I just put the SPI.transfer calls in the main loop after setting the codec into DSP mode via I2C ,I should be able to read the values over SPI. I understand that the clock for SPI transfer is from the codec to Due which handles an interrupt and in the interrupt the SPI calls should be there but even without that if just keep polling SPI continuously in the loop we should still be able to read the left_in and right_in over SPI. But I am not able to pass the SPI data or read it.
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Wed Jul 08, 2015 5:02 am

IMG_20150708_172439.jpg
IMG_20150708_172439.jpg (87.01 KiB) Viewed 7312 times

The above graph is SS pin wave. The wave width is 20 us. The frequency is 19Khz. So why am I not able to read SPI data. The graph above is for SPI calls not synced with CLKOUT from the codec in the ISR.
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby guest » Wed Jul 08, 2015 9:28 am

the spi transfer needs to happen at the exact same time, every time. it can not be off, even by a single (codec) clock cycle, or it wont work. this is why it needs to be in the interrupt, so the timing is perfect. the SS pin needs to have a width of 1 SPI clock, and it needs to happen at the first SPI clock. it also needs to be at 44.1KHz. please have a look at the datasheet for the codec, as it has a picture of exactly what this should look like.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Audio codec shield with Arduino Due

Postby youthreewire » Wed Jul 08, 2015 7:56 pm

But if I put the SPI.transfer function in the ISR. The ISR gets stuck and the micro-controller does not respond. What should be the speed of SPI (i.e frequency)?
youthreewire
 
Posts: 117
Joined: Tue Jun 09, 2015 8:06 pm

Re: Audio codec shield with Arduino Due

Postby guest » Wed Jul 08, 2015 10:05 pm

SPI should be set to something relatively fast. it doesnt matter exactly what it is. between 4MHz and 8MHz should be fine. look at it on the scope, and make sure its finishing its transfer before the next interrupt should occur.
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

PreviousNext

Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 1 guest


cron