MCF5249 Help configure QSPI for transfer.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCF5249 Help configure QSPI for transfer.

1,364 次查看
MikeTheRed
Contributor I
Hello,
 
I'm trying to set up the QSPI to do a transfer of 8 16-bit words.  When I run the code it looks like the transfer performs but I cannot see the signals using an ossillosocpe.  I think it's a hardware problem, my hardware engieere says it's software.  Could someone look over my code and see if anything wrong jumps out at them?  I'm not using QSPI_CS2 and 2, I'm using GPIO21 and 22.  I can verify those are being switched. 
 
Thanks.
 
short Batt1;
 
 SetGPIOOutput (OUTPUT_QSPI_CS2, ACTIVE);
 SetGPIOOutput (OUTPUT_QSPI_CS3, ACTIVE);
 //Set up QSPI (set QSPI bit in PLLREG)
 _REG_PLLCONTROL |= BIT(11);
 _REG_QMR = 0x8102;
 _REG_QDLYR = 0x0202;
 _REG_QIR = 0xD00F;
 _REG_QAR = QSPI_CMD_RAM;
 //Fill Command RAM, 6 16 bit transfers
 _REG_QDR = 0x6000;
 _REG_QDR = 0x6000;
 _REG_QDR = 0x6000;
 _REG_QDR = 0x6000;
 _REG_QDR = 0x6000;
 _REG_QDR = 0x6000;
 _REG_QDR = 0x6000;
 _REG_QDR = 0x6000;
 //Fill Transmit Ram
 _REG_QAR = QSPI_TxD_RAM;
 
 _REG_QDR = 0x0880;
 _REG_QDR = 0xBB00;
 
 _REG_QDR = 0x0820;
 _REG_QDR = 0x0800;
 
 _REG_QDR = 0x0A00;
 _REG_QDR = 0x8776;
 
 _REG_QDR = 0x80A0;
 _REG_QDR = 0x0000;
 //Set up Transfer
 _REG_QWR = 0x0700; //0000 0101 0000 0000
 //Begin the Transfer
 _REG_QDLYR |= 0x8000;
 //Wait for finish
 while ( !(_REG_QIR & BIT(0) ) );
 
_REG_QAR = QSPI_RxD_RAM;
Batt1 = _REG_QDR;
 //Turn off GPIO21 and 22 for QSPI CS 2 and 3
 SetGPIOOutput (OUTPUT_QSPI_CS2, INACTIVE);
 SetGPIOOutput (OUTPUT_QSPI_CS3, INACTIVE);
 
 
Thanks for any comments.
 
Mike
标签 (1)
0 项奖励
回复
2 回复数

500 次查看
stzari
Contributor III
Hi,

the first thing to check (since it's not included in your sourcecode) is whether you enabled the primary functions for the QSPI pins. Those are GPIOs for many Coldfire CPUs after reset.

HTH
  Stamatis
0 项奖励
回复

500 次查看
MikeTheRed
Contributor I
Thank you for your response.
 
You are correct that the bits being set to the primary function is not listed in my code, but they are set correctly elsewhere in my code.  I also verified them using the debugger.  For teh 5249 the primary function is selected when the control bit is a zero, and that is what they are set to.
 
Mike
0 项奖励
回复