AnsweredAssumed Answered

spi problem bf 548

Question asked by sachin@eilabs.co.in on Oct 8, 2012
Latest reply on Oct 17, 2012 by sachin@eilabs.co.in

Dear all ,

 

Iam trying to transfer the data from a master to slave and receive the data from salve  , i gone through the below code , i tried to make it for the slave receive but iam not able to do it , please help me to get this .

 

#include <cdefbf548.h>

EX_INTERRUPT_HANDLER(spi_isr);

void Init_Interrupt(void);

void Init_SPI(void);

   

void main(void)

{

*pPORTG_FER =Px8 | Px9 | Px10|Px11;

*pPORTG_MUX = 0x00;

ssync();

Init_SPI();

Init_Interrupt();

*pSPI1_TDBR=0x1010;

while(1)

     {

     }

}

 

 

EX_INTERRUPT_HANDLER(spi_isr)

{

*pSPI1_TDBR=0x1010;

asm("ssync;");

}

 

void Init_Interrupt(void){

register_handler(ik_ivg10, spi_isr);

*pSIC_IMASK1 = 0x80;

}

  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;");

 

 

if i want to configure the receive part from the spi how do i do that .

 

Thanks and regards

Sachin patil

Outcomes