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.

PGA460: How to change the mode from TCI to OWU using Energia

Part Number: PGA460
Other Parts Discussed in Thread: ENERGIA, ,

Hello, 

I just write a code in Energia trying to use IO-Pin Interface to switch mode TCI mode to OWU (because the end product is just have 12v,GND and IO pin and want to use OWU to communicate).

I was try to send the pattern 0xF0 0xF8 0xFC to switch the mode from TCI to OWU at baud-rate 19200 bps, but it is not success.

Here is the coding I tried today, would you please help to review

  • Hi Kevin,

    To switch between TCI or OWU mode, the IO pin simply needs to be toggled with the fixed times shown on Figure 34 of the PGA460 datasheet. The toggle can be done either by a GPIO toggle or a UART 0xF0F8FC transmit. If the UART pattern doesn't work, try the GPIO time toggle method instead. We are adding the IO Pin Interface Toggle Pattern as a function in the Energia library. Here is the GPIO toggle version of the IO Pin Interface Toggle Pattern function for the upcoming PGA460 Energia library revision:

    /*------------------------------------------------- ioToggle -----

    |  Function ioToggle

    |

    |  Purpose:  Send the IO Toggle Pattern to switch between

     |                                                TCI and OWU modes.

    |

    |  Parameters:

    |                                            togPin (IN) -- the GPIO pin used to send the toggle pattern

    |

    |  Returns:  none

    *-------------------------------------------------------------------*/

    void pga460::ioToggle(int togPin)

    {

      // initialize function variables

      int digWriLDelay = 2;     // intermediate micro-delay created by digitalWrite Low execution

      int digWriHDelay = 11;    // intermediate micro-delay created by digitalWrite High execution

      int ioTogPat[6] = {

        260 - digWriLDelay,

        321 - digWriHDelay,

        208 - digWriLDelay,

        364 - digWriHDelay,

        156 - digWriLDelay,

        416 - digWriHDelay

      };

     

      // temporarily configure pin as GPIO

      pinMode(togPin, OUTPUT);     // configure GPIO as output

      digitalWrite(togPin, HIGH);     // initialize idle high

     

      delay(10); // wait 10ms before issuing IO-toggle pattern

     

      // IO-toggle pattern

      digitalWrite(togPin,LOW);

      delayMicroseconds(ioTogPat[0]);

      digitalWrite(togPin,HIGH);

      delayMicroseconds(ioTogPat[1]);

      digitalWrite(togPin,LOW);

      delayMicroseconds(ioTogPat[2]);

      digitalWrite(togPin,HIGH);

      delayMicroseconds(ioTogPat[3]);

      digitalWrite(togPin,LOW);

      delayMicroseconds(ioTogPat[4]);

      digitalWrite(togPin,HIGH);

      delayMicroseconds(ioTogPat[5]);

    }

    You can include this function at the bottom of your Energia sketch for testing. All you need to do is pass in the Energia pin number of the active data transmit channel (either 4 or 15 on BOOSTXL-PGA460 depending on whether OWU or TCI is active, respectively).

    Also, your code snippet image is broken.

  • Hi  Akeem

    Thanks for your reply, I was tried your ioToggle function, it cannot success to change the mode from TCI to OWU even through pin 4 or 15.

    I was write the below code in Energia main program, would you please help to review.
    void initPGA460() {
    ussc.initBoostXLPGA460(1, 19200, 0);
    delay(100);
    ussc.ioToggle(TCI_TX);
    delay(100);
    ussc.initBoostXLPGA460(2, 115200, 0);
    delay(100);
    }

    Here is the coding I tried yesterday.

    void pga460::togOWU()
    {

    byte st = 0xF0;
    byte rd = 0xF8;
    byte nd = 0xFC;
    byte buf20[3] = {st, rd, nd};

    pinMode(COM_PD, OUTPUT); digitalWrite(COM_PD, LOW);
    pinMode(COM_SEL, OUTPUT); digitalWrite(COM_SEL, HIGH);
    Serial1.begin(19200);
    Serial1.write(buf20, sizeof(buf20));

    }

  • Hi Kevin,

    A few items to check:

    • Can you send an oscilloscope screen capture of the IO toggling with the high/low times during the ioToggle function? Please do the same for the hex command option. We first need to ensure the IO is toggling at correct times for the IO-switch pattern.
    • Is the IO pin enabled? By default it is enabled, but if the EEPROM memory was changed and burned to disable it, this could be the problem. Bit field IO_DIS must be equal to 0 for the IO transceiver to be enabled.
    • How are you confirming whether the switch from TCI to OWU is successful? The IO_IF_SELbit field is '1' when the device is in OWU mode.
      • Note, if the end product will use OWU, they may want to consider EEPROM programming the device at mass production to set IO_IF_SEL to be '1' at start-up for OWU mode. This way, they never have to worry about to IO toggle pattern in the end product.

  • Hi  Akeem, 

    Thanks for your reply again, just check with the signal using oscilloscope, the experiment setup and result is shown in attached PowerPoint, please help to review. For the result, I can change the commutation mode form OWU to TCI by sending 0xF0F8FC or time-based pattern, it can success to change the mode. But I had do the same thing to send 0xF0F8FC or time-based pattern, it cannot change the mode from TCI to OWU.

    For the end product just only have 3 cable to connect the PGA460 module and want to through OWU mode to program EEPROM. Checked with datasheet, the pga460 default communication mode is TCI, so we need to change the communication mode through IO pin.

    IO_toggle problem.pptx

  • Hi Akeem,

    For another question, I can;t read data dump through Energia OWU and GUI OWU, would you please provide the procedure & coding to read the data dump through Energia and GUI in OWU mode

  • Hi Kevin,

    Regarding the IO pattern toggle, it is important to use the timing values shown in datasheet figure 34 with +/-2 us accuracy:

    Comparing the required times to your actual times, I've highlighted the time segments of concern (violate the spec):

    1 2 3 4 5 6
    Required 260 321 208 364 156 416
    Customer sending hex string 262 262 209 318 157 ...
    Customer forcing toggle 252 299 211 331 166 ...

    The large difference in certain time segments may explain why the IO toggle pattern is not always successful in your system. Try improving the timing accuracy to see if this helps the success rate.

    Regarding the echo data dump (EDD) read through OWU: the procedure is identical to the UART mode.

    1. Send a burst listen command (CMD0-3)
    2. Wait until record length expires (up to 65ms)
    3. Read back echo data dump (CMD7)

    Ensure the dATADUMP_EN bit is set to 1 before sending the burst/listen command to ensure the EDD gets updated instead of the UMR.