Hello,
I am new with OMAP3530 programming, I am working on CCS3.3 and I choose to program directly the registers (without CSL, etc.)
I am trying to make a loopback (digital loopback) with the McBSP2 (where dr and dx pins are linked) I have configured the McBSP registers and I have 2 arrays, transmit[] and receive[].
In a loop, I wait for XRDY signal before writing a transmit[n] data to DXR, then I wait for RRDY signal to read data from DRR register. And DRR register never takes one of my array values; in fact DRR value is always 0.
And now my questions:
I would like to know if there is a specific way to write the McBSP DXR register.
I mean, do I need to use DMA to write and read McBSP transmit and receive registers or could I write directly into DXR register ? And how could I know if the write process has been done correctly (DXR is a write only register, I can’t print its value) ?
I have probably missed something with the McBSP loopback programming…
Thanks,
Michael
PS : Here is how I have configured the register for a digital loopback on McBSP :
The clocks are provided by the PRCM
CONTROL_DEVCONF0 &= 0xFFFFFFBF //CLKS is from the PRCM functional clock
CM_FCLKEN_PER |= BIT_00_MASK; // 96M
CM_ICLKEN_PER |= BIT_00_MASK; // L4
MCBSPLP_SPCR2_REG = 0x00000000
MCBSPLP_SPCR1_REG = 0x00000000
MCBSPLP_RCR2_REG = 0x00000001
MCBSPLP_RCR1_REG = 0x000000A0
MCBSPLP_XCR2_REG = 0x00000001
MCBSPLP_XCR1_REG = 0x000000A0
MCBSPLP_SRGR2_REG = 0x00002000
MCBSPLP_SRGR1_REG = 0x00000101
MCBSPLP_PCR_REG = 0x00000A00
MCBSPLP_THRSH2_REG = 0x00000001
MCBSPLP_THRSH1_REG = 0x00000001
MCBSPLP_IRQSTATUS_REG = 0x0000FFFF
MCBSPLP_XCCR_REG = 0x00009028
MCBSPLP_RCCR_REG = 0x00000808
Then I configure the SRG, following the flow diagram from the datasheet (page 2964) :
MCBSPLP_SPCR2_REG &= 0xFFFFFFBF // GRST = 0
MCBSPLP_PCR_REG &= 0xFFFFFF7F // SCLKME = 0
MCBSPLP_SRGR2_REG &= 0xFFFFDFFF // CLKSM = 0
MCBSPLP_SRGR2_REG &= 0xFFFF7FFF // GSYNC = 0
MCBSPLP_SRGR2_REG |= 63 // FPER = 63
MCBSPLP_SRGR1_REG = 0
MCBSPLP_SRGR1_REG |= 0x1F00 // FWID = 31
MCBSPLP_SRGR1_REG |= 7
I enable the SRG :
MCBSPLP_SPCR2_REG |= 0x40 // GRST=1
MCBSPLP_SPCR2_REG |= 0x80 // FRST=1
Finally, I enable MCBSP transmit and receive
MCBSPLP_SPCR1_REG |= 0x1 // RRST = 1
MCBSPLP_SPCR2_REG |= 0x1 // XRST = 1