• Resolved

Concerto (DSP -> SCI-A) Comm Issue: bytes submitted to the peripheral are not what is sent out the port


I am getting strange output from the serial port of the DSP.

Here is the code used to submit the desired bytes to the SCI peripheral;

// toggle the control program valves
#pragma CODE_SECTION(ToggleValves, "ramfuncs")
void ToggleValves(unsigned long count)
    unsigned char idx, state = 0, check = 0x86;

    if ((count % 2) == 0)
        state = 0xff;
        check = 0x0e;

    while (SciaRegs.SCIFFTX.bit.TXFFST == 16) ;
    SciaRegs.SCITXBUF = 0x76;
    while (SciaRegs.SCIFFTX.bit.TXFFST > 11) ;
    for (idx = 0; idx < 5; idx++) SciaRegs.SCITXBUF = 0xff;
    while (SciaRegs.SCIFFTX.bit.TXFFST > 10) ;
    for (idx = 0; idx < 5; idx++) SciaRegs.SCITXBUF = state;
    SciaRegs.SCITXBUF = check;

NOTE: I put the checks against the TXFFST reg as a troubleshooting step when I saw the strange output. This was an attempt to prevent submitting to many bytes to the fifo the output didn't change with the addition of these lines.

Here is the output;

What am I doing wrong?

Thanks and God Bless!!!

PS. The listener app is sound.