This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem of Configuration McBSP0 pins as GPIO on 6474EVM

I want to config Mcbsp0 in I/O mode on the 6474EVM board.
Now the registers of Mcbsp0 as follows:
1.PCR=0X00003F00
 Setting PCR.13 (XIOEN) equal to '1'
 Setting PCR.12 (RIOEN) equal to '1'
 Setting PCR.11 (FSXM) equal to '1'
 Setting PCR.10 (FSRM) equal to '1'
  Setting PCR.9 (CLKXM) equal to '1'
 Setting PCR.8 (CLKRM) equal to '1'
 
 2.SPCR=0X02001000
  XRST=RRST=0;
 
  I think the Mcbsp0 pins should work as GPIO after reading ch 10 of the McBSP Guide
 
  I use the code to test

     outData = 1;       
     CSL_mcbspIoWrite(hMcbsp, CSL_MCBSP_IO_CLKX, outData);            
     outData = 0;          
       CSL_mcbspIoWrite(hMcbsp, CSL_MCBSP_IO_CLKX, outData);


  It looks CLKX  works as gpio when I watch PCR.1
  when I use this code to test FSX, DX ,these pins do not change,for PCR.3,PCR.5 do not change.

 

        When I use the code
      inMask = CSL_MCBSP_IO_CLKX;
           
      inData = CSL_mcbspIoRead(hMcbsp, inMask);
      
       if ((inData & CSL_MCBSP_IO_CLKX) != 0)
           clkx_data = 1;
       else
          clkx_data = 0;

CCS can not debug in the if and else.

I aslo try this way:

*(unsigned char*) McBSP0_PCR_Address |= ((1 << 13) | (1 << 12) | (1 << 11) | (1 << 10 ) | (1 << 8));


*(unsigned char*) McBSP0_PCR_Address |= ((1 << 3) | (1 << 2) | (1 << 0)) ;

The PCR value does not change.

could you help me solve the problem,thank you very much.

  • Could anyone help me solve my problem?

    Thank you!

     

  • Hi Dan,

    It has been a while since your posting.  Were you able to get this GPIO problem resolved?  If so, how?

    Have you tried writing directly to the MCBSP addresses instead of using the CSL?

    SPCR: 018C0008

    PCR: 018C0024

    You have these pins configured for outputs, yet you say that PCR does not change when writing to it. It is not clear to me from the manual (chapter 10 of sprug17) that these PCR bits are readable when pins are in output mode.  It does explicitly say that the PCR bits are read only when the pins are in inputmode, but there is no matching output mode disclaimer.

    These are 32b register addresses, so the cast seems like it should be to *(uint32) rather than uchar*

    *(uint32) McBSP0_PCR_Address |= ((1 << 13) | (1 << 12) | (1 << 11) | (1 << 10 ) | (1 << 8));

    --Joel