Sign in

username:

password:



Not a member?

Search c55x



Search tips

Subscribe to c55x



c55x by Keywords

AIC23 | C5509 | CCS | CSL | EMIF | EVM | GEL | GPIO | HPI | Interfacing | JTAG | McBSP | OMAP | Omap15 | OMAP59 | RTDX | SDRAM | TMS320VC5509 | USB | XDS5

Ads

Discussion Groups

Discussion Groups | TMS320C55x | RE: Code execution sequence

Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).

  

Post a new Thread

RE: Code execution sequence - liwe...@gmail.com - Mar 8 18:22:00 2006



I believe I have got the answer with your and TI tech support's help. The problem of
MCBSP_write16() is that it only sent data to DXR, and a long way from XSR to DX is left
unsupervised by the code. If one want to write one UINT16 by McBsp and then close the McBsp. I
believe the following is the best way to do it.

    while (!MCBSP_xrdy(hMcbsp1));
    MCBSP_write16(hMcbsp1, 0x3579);  // 0x3579, data intended to write, goes to XSR
    while (!MCBSP_xrdy(hMcbsp1));
    MCBSP_write16(hMcbsp1, 0x1111);  // 0x1111, dummy data, to DXR; 0x3579 goes to XSR
    while (!MCBSP_xrdy(hMcbsp1)); // dummy data goes to XSR, and 0x3579 is shipped out by DX
    MCBSP_close(hMcbsp1); 

Thanks to Jeff and Dileepan.
	


(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )

Re: RE: Code execution sequence - Jeff Brower - Mar 12 19:46:00 2006

Li Wei-

> I believe I have got the answer with your and TI tech support's help. The
> problem of MCBSP_write16() is that it only sent data to DXR, and a long
> way from XSR to DX is left unsupervised by the code. If one want to write
> one UINT16 by McBsp and then close the McBsp. I believe the following is
> the best way to do it.
>
>     while (!MCBSP_xrdy(hMcbsp1));
>     MCBSP_write16(hMcbsp1, 0x3579);  // 0x3579, data intended to write,
> goes to XSR
>     while (!MCBSP_xrdy(hMcbsp1));
>     MCBSP_write16(hMcbsp1, 0x1111);  // 0x1111, dummy data, to DXR;
> 0x3579 goes to XSR
>     while (!MCBSP_xrdy(hMcbsp1)); // dummy data goes to XSR, and 0x3579
> is shipped out by DX
>     MCBSP_close(hMcbsp1);

Yes this looks very reasonable.  My one comment would be to add some
time-out (escape) to the while loop in case the serial link breaks (other
end disconnects).  From a high-level system perspective, at the time of
"closing" the McBSP port, anything could be happening.

-Jeff
	


(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )