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.

CCSv4, Port Connect - read

Hi,

I'm trying to simulate McBSP port using Port Connect widget. Writing data to file works fine, but i have problem with reading from file. My test application is simple, there is McBSP0 configured to invoke interrupt when recives data, read that data and write it to output file. So, i've connected input file with some data and empty output file. But when program starts nothing happens - interrupt is not invoked. So my question is, how reading from file should exactly work? Shuld I somehow force recive interrupt? I've seen video tutorial for Port Connecting on CCS wiki and there program was just started, and output file was ready immedietly after 'run' click. Unfortunately source code is not shown.   

  • Hi Michal,

              Which simulator & CCS version you are using?  About your question, whenever data is read by CPU or DMA in DRR register then the port connects read the data from file & similarly when data is written to DXR register then it's written to a file. Till you read or write to DRR/DXR register reading/writing to the file will not happen.  About the recording in the wiki, we will add the source code as well soon.

    regards,

    Mani

  • Thanks for reply Manivannan E.

    I've already found reason of problem described above - McBSP configuration was copied from working project, which was tested using DSK, however it wasn't proper for simulation. So, changing configuration to make both, transmitter and receiver, clocked internally solved problem. Now using code sequence like:

    MCBSP_read(...);  MCBSP_write(...);

     gives expected results - content of input file is copied to output file. In fact, there are some little issues with that - sometimes some  line is missed, but generally it works. I suppose that solution is not completely right, because it works when read and write is called "manually". better solution would be writing to McBSP when interrupt related with RRDY occurs. And interrupt occurs, but until writing is done, it's called again so IDE gives one after another warning that interrupt is called too early. That is of course well presented in output file, where half or less input data. My next idea wast, that input should be driven by EDMA. Again, working with DMA for output works perfectly, but when it's configured to use McBSP  as source and global Uint32 array as destination strange things happen. I've written code with transfer complete interrupt, where array filled by DMA is sent to file using MCBSP_write(), but output file contain only zeros, which are initial values of that array set before DMA transfer starts. Little modification in EDMA config - transfer of each element is triggered by timer interrupt, so I could see what happen between transitions. Every time when program was breakpointed in timer interrupt McBSP register (View->Registers->McBSP) contained next value from input file. Why then destination array remain empty?              

     PS. I am using newest CCS - 4.1.2.00027, and my  target is 6713 simulator.

  • Hi Michal,

        DXR & DRR register has to be accessed only by one master i.e either DMA or CPU for port connect to work correctly; if both access the registers simultaneously then multiple read/write from file will happen & I believe that's the reason for missing entry in the output. 

    We have few limitations on McBSP for that pls refer 3.2.2 section in http://focus.ti.com.cn/cn/lit/ug/spru600i/spru600i.pdf

    If you want to use a custom clock for TX & RX instead of internal clock, check pin connect option under section 2.1.1.

    Regards,

    Mani

  • Thank you Manivannan for all suggestions. Finally, I've made it work using EDMA - it's all about proper configuration of peripherals. Pin connect also looks interesting, so I'll read about it for sure.