AnsweredAssumed Answered

SPI on BF548

Question asked by SLA on Jun 15, 2011
Latest reply on Jun 16, 2011 by Nabeel

Hi,

I just did following and still missing SCLK signal, Could you please advice waht I did wrong.

 

#include <cdefbf548.h>

EX_INTERRUPT_HANDLER(spi_isr);

void Init_Interrupt(void);

void Init_SPI(void);

void main(void)

{

    Init_SPI();

    Init_Interrupt();

    while(1)

    {
    }
}


EX_INTERRUPT_HANDLER(spi_isr)

{

    *pSPI1_TDBR=0x1010;

}


void Init_Interrupt(void){

     register_handler(ik_ivg7, spi_isr);

    *pSIC_IMASK0 = 0x10000000;

}


void Init_SPI(void){

    *pSPI1_CTL     &=  (~SPE);  

     *pSPI1_FLG     |=  (FLS1|FLG1);

    *pSPI1_BAUD = 6;

    *pSPI1_CTL   =   MSTR | SIZE | CPOL | TDBR_CORE;

    asm("ssync;");

    *pSPI1_CTL     |=  SPE;                    // enable SPI

    asm("ssync;");

}

Regards

Slawek

Outcomes