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.

StarterWare PSC bug?

Trying to make use of c6748 StarterWare to speed my development. Always wanting new pro0jects done next week, eh?

1) Is there any documentation on the Driver functions?  My first task was to handle PSC for USB0. I do not see anything about PSC in the help file.

2) It seems to me that PSCModuleControl() is wrong.
2a) The 'flags' paramter is documented as "a logical OR of the commands that can be given to a module"  But the PSC MDCTL NEXT settings are literals, 0-3, not bit flags. Not sure how a flag could ever work.
2b) The first statement assigns (flags & PSC_MDCTL_NEXT) to the appropriate MDCTL register. If PSC_MDCTL_NEXT==1 this becomes (flags & 1). But in all of the StarterWare usage I could find, the value sent as the flags parameter is PSC_MDCTL_NEXT_XXXX having a value of 0-3. As in 2a, ANDing a 'flag' with a literal will not work.
2c) Maybe I am reading this wrong?

3) In sprugj7e section 8.3.2 Module State Transitions the procedure starts by waiting for the "GOSTAT[x] bit in PTSTAT to clear to 0." But this is not done in PSCModuleControl. Is this step really unnecessary?

4) The final loop waits for the programmed state to appear in the appropriate MDSTAT register.  The Module State Transistions procudeure does not include this step. Is this something new? I just downloaded rev E, is there a newer version with different steps?

  • Kurt,

    Sorry for my delay in responding.  After reviewing the code and the PSC documentation, I believe that the PSCModuleControl() function is written correctly.  I agree that the comments describe the "flags" parameter in a confusing way, but the procedure seems correct.  The reason that we do not check that GOSTAT is 0 at the beginning of the function is that we perform this check at the end before returning.  The procedure listed in the TRM is somewhat redundant because it recommends performing this check before and after each PSC action.  The important thing is that the check must be performed between successive PSC actions.  Checking the MDSTAT register is a simple sanity check to make sure that our intended setting was applied successfully.

    Generally speaking, the StarterWare API documentation is located in the compiled help file (CHM) in the docs folder of the StarterWare installation.  Most peripherals also have some higher-level documentation in the User Guide page on the TI wiki.  You can find a link to the user guide for your StarterWare installation on the StarterWare landing page.