Minhaj Ahmed

QSPI on MCF5329

Discussion created by Minhaj Ahmed on Jun 6, 2007
Latest reply on Jun 13, 2007 by Minhaj Ahmed
Hi,
  I am having problems getting QSPI going on logicdp eval board here is my code
 
void SpiInit()
 MCF_QSPI_QMR = 0;
 MCF_QSPI_QMR |= MCF_QSPI_QMR_MSTR                      //Master mode; must be one
                               |MCF_QSPI_QMR_DOHIE                     //high-z b/w transfer          
                               |MCF_QSPI_QMR_BITS(0x08)            //8 bits transfter size
                                |MCF_QSPI_QMR_CPOL                  //CPOL: inactive spi clock state 
                                                                                            //is high
     |MCF_QSPI_QMR_BAUD(0x02);//baud rate
                                                                                           //CPHA not set (0)
                                                                                         //CPHA: data captured on leading
                                                                                          //edge.
           
 MCF_QSPI_QDLYR = 0;
                                                                                          //nothting to transfer SPE=0
                                                                                          //QCD=0 no clock delays
                                                                                         //DTL=0 no inter transfer delays
 MCF_QSPI_QIR = 0;
 MCF_QSPI_QIR |= MCF_QSPI_QIR_ABRTL
     |MCF_QSPI_QIR_WCEF                                           //write collision interrupt clear
     |MCF_QSPI_QIR_ABRT                                            //Abort interrupt clear
     |MCF_QSPI_QIR_SPIF;                                             //QSPI finished interrupt clear
                                                                                         //WCEFB: Write collision access
                                                                                         //err disabled=0
                                                                                        //ABRTB: Abort access err disabled
                                                                                          //=0
                                                                                       //Reserved=0;
                                                                                      //ABRTL: Abort lockout =1 =>QWR[SPE]
                                                                                         //=disabled.
                                                                                      //WCEFE: Write collision interrupt
                                                                                     //disabled=0
                                                                                      //ABRTE: Abort interrupt
                                                                                      //disabled=0
                                                                                    //Reserved=0
                                                                                      //SPIFE: finished interrupt
                                                                                   //disabled=0
                                                                                        //Reserved:XXXX
                                                                                        //WCEF: Write collision err flg=X
                                                                                           //1 to clr
                                                                                           //ABRT: Abort flg=X 1 to clr
                                                                                             //Reserved: X
                                                                                        //SPIF: SPI done:X 1 to clr.
 MCF_QSPI_QWR = 0;
 MCF_QSPI_QWR |= MCF_QSPI_QWR_CSIV;
                                                                                        //Halt=0
                                                                                    //WREN=0: Wrap around disabled;
                                                                                      //WRTO=X: Wrap around location
                                                                                     //CSIV=1: CS active state is low
                                                                                     //ENDQP=0=XXXX: endqueue point
                                                                                    //CPTQP==XXXX: Completed queue ptr=read
                                                                                          //only.
                                                                                       //NEWQP=XXXX: Startqueue ptr location
           
  
          
}
/**************************************************************************************************/
PutData(int sample)
{

 MCF_QSPI_QAR = 0x0020;
           //first cmd address
 MCF_QSPI_QDR = 0;
 MCF_QSPI_QDR |= MCF_QSPI_QDR_QSPI_CS0;
                                                                                         //CONT=0:CS inactive after word worth tx
                                                                                      //BITSE=0:8 bit tx can use one also as QMR[BITS]
                                                                                       //is defined appropriately
                                                                                       //DT=0:delay after tx set to default reset val.
                                                                                //DSCK=0:CS to clk delay set to 1/2 the clk period
                                                                                //QSPI_CS=E: CS number
                                                                                  //Reserved(0-7)=0
 
 MCF_QSPI_QAR = 0x0000;
                                                                                    //first tx RAM entry
 MCF_QSPI_QDR = cmd;
                                                                                          //sample data
 MCF_QSPI_QWR = 0x1F00;
                                                                                    //Halt=0
                                                                                  //WREN=0: Wrap around disabled;
                                                                                   //WRTO=X: Wrap around location
                                                                                   //CSIV=1: CS active state is low
                                                                                     //ENDQP=0=XXXX: endqueue point
                                                                                     //CPTQP==XXXX: Completed queue ptr=read
                                                                                   //only.
                                                                                     //NEWQP=XXXX: Startqueue ptr location
           
 MCF_QSPI_QDLYR |= MCF_QSPI_QDLYR_SPE;
                                                                                        //set data ready flag for tx to occur
}
 
 
What am i doing wrong....nothing happens when I put a logic analyzer on the pins.... i dont have any interrupt handler and I dont think I need any? 
 
Also is there a sample code for SSI driver?
 
Regards and thanx in advance
 


Message Edited by min on 2007-06-07 12:46 AM

Outcomes