AnsweredAssumed Answered

BF592 problem with SPI0 interrupt

Question asked by martinpgough on Oct 26, 2011
Latest reply on Oct 26, 2011 by frankT

Below is the code I am using to set things up and the interrupt routine itself, but the interrupt never happens! Can you help me see what I have screwed up please?

 

 

// main code

ADI_SYSCTRL_VALUES sys_cntrl_struct;

// ClkIn = 25MHz
   
sys_cntrl_struct.uwPllCtl = 0x1800;     // VCO = 12*ClkIn = 300MHz
sys_cntrl_struct.uwPllDiv = 0x0004;     // SClk = VCO/4 = 75MHz
sys_cntrl_struct.uwVrCtl = 0x70D0;

bfrom_SysControl( SYSCTRL_WRITE | SYSCTRL_PLLCTL | SYSCTRL_VRCTL | SYSCTRL_INTVOLTAGE, &sys_cntrl_struct, NULL);
   
ssync();

*pPLL_DIV = sys_cntrl_struct.uwPllDiv;     // considering Anomaly No-05000440
   
ssync();

*pPORTFIO_DIR = 0x0000;
*pPORTGIO_DIR = 0x0001;

*pPORTF_MUX = 0x0000;        // Configure pin for SPI0SSEL1
*pPORTG_MUX = 0x0001;        // Configure pin for SPI0SSEL1

*pPORTF_FER = PF13 | PF14 | PF15;     // Enable SPI0 pins
*pPORTG_FER = PG0;         // Enable SPI0 pins


*pSPI0_BAUD = SPI_0_BAUD;      // set the required baud rate
*pSPI0_FLG = 0x0202;      // set up flags for manual slave select
*pSPI0_CTL = (MSTR | CPHA | TIMODE(1)); // master, manual tx

*pSIC_IMASK0|=0x00000020;         // enable SPI_0 interrupt
register_handler(ik_ivg7, ISR_SPI0);      // redirect interrupt

Bytes_Sent = 0;
*pSPI0_CTL |= SPE;        // enable spi
*pSPI0_FLG = 0x0002;//FLG1;       // select slave device
*pSPI0_TDBR = SPI_0_Byte;      // put byte in send buffer

 

// i have not included any more of the main stuff as until it interrupts...

 

// end of main code


EX_INTERRUPT_HANDLER(ISR_SPI0)
{

Bytes_Sent++;       // count the number of bytes sent
SPI_Send = 1;       // initiate send

ssync();
}

Outcomes