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.

DRV8312EVM serial-port example

Genius 5910 points
Other Parts Discussed in Thread: DRV8312, CONTROLSUITE

Hi,

I'm looking for a (TTL) serial-port example I can use on my DRV8312 board.

 Can I  (ab)use the isolated SPI-port for that? If so? how.

 Thanks.

  • I found  the demo: sci_echoback

    And  found that GPIO28 and GPIO29 are both on J12.  (yes, I also connected ground)

     I see the welcome text in the terminal program. But when i try to echo back. No result, high to half-level signal on scope. It seems to be that GPIO29 is active high and an output.

     I see the welcome text so RX and TX are not crossed.  I checked with the scope that my TX (pc) signal is correct.

     So is GPIO-29, the GPio29 I think it is. DIMM Module pin 93.

    Schematic and board are both revD. So why isn't it working.

  • It is not GPIO29 but GPIO28. But if I just run the demo this is the result:

    Send 'a' to the DSP.

     

    I did verify that this is GPio28 by writing a program that toggles GPIO28. and that works correct.

     So why is this not working.

     I use this demo: C:\ti\controlSUITE\device_support\f2806x\v136\F2806x_examples_ccsv5\sci_echoback

    and this is the port initialization:

    void InitSciaGpio()
    {
       EALLOW;

    /* Enable internal pull-up for the selected pins */
    // Pull-ups can be enabled or disabled disabled by the user.
    // This will enable the pullups for the specified pins.

        GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0;    // Enable pull-up for GPIO28 (SCIRXDA)
    //    GpioCtrlRegs.GPAPUD.bit.GPIO7 = 0;     // Enable pull-up for GPIO7  (SCIRXDA)

        GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0;       // Enable pull-up for GPIO29 (SCITXDA)
    //    GpioCtrlRegs.GPAPUD.bit.GPIO12 = 0;       // Enable pull-up for GPIO12 (SCITXDA)

    /* Set qualification for selected pins to asynch only */
    // Inputs are synchronized to SYSCLKOUT by default.
    // This will select asynch (no qualification) for the selected pins.

    //    GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3;  // Asynch input GPIO28 (SCIRXDA)
    //    GpioCtrlRegs.GPAQSEL1.bit.GPIO7 = 3;   // Asynch input GPIO7 (SCIRXDA)

    /* Configure SCI-A pins using GPIO regs*/
    // This specifies which of the possible GPIO pins will be SCI functional pins.

        GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1;   // Configure GPIO28 for SCIRXDA operation
    //    GpioCtrlRegs.GPAMUX1.bit.GPIO7 = 2;    // Configure GPIO7  for SCIRXDA operation

        GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1;   // Configure GPIO29 for SCITXDA operation
    //    GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 2;   // Configure GPIO12 for SCITXDA operation

        EDIS;
    }

    Which document do I need for the the I/O selection/definition?

    Hope you can help.

  • ernst van spronsen said:
    Which document do I need for the the I/O selection/definition?

    The SCI TX data seems fine. Did you monitor this data on your PC? You should be able to receive 'a' on hyperterminal.

  • The DSP TX line works fine. It is the DSP RX signal that isn't working.

    if I send a 'a' from my pc I see it the scope picture above.  If i disconnect the wire from the DSP the signal is correct.(0  - 3.3V signal)

     

  • ernst van spronsen said:

    if I send a 'a' from my pc I see it the scope picture above.  If i disconnect the wire from the DSP the signal is correct.(0  - 3.3V signal)

    So do you get any data on the Watch window or not? Esp. add SCIRx register in the Global registers to the watch window to observe the incoming data.

    Regards,

    Gautam

  • Look at the scope picture. This signal isn't correct.

    The signal doesn't make it to ground. Why? the FTDI usb-> serial converter isn't capable to sink the signal. Because it is broken(Don't think so)  or the control  source more than the FTDI can sink. But why is the controller sourcing a input signal. When I disconnect the pin. The (!!RX!!) pin is still high (without pull-up).

     I think that is strange and can't find why. Also tried it on different demo boards and they have the same problem.

    To proof: This are both serial signal. Green is controller TX(at start-up). Showing the welcome text.

    Yellow is the RX signal: floating(Not connected to PC) with 3.3k Pull-down resistor!!. So I think there is something wrong with the demo.

  • The odd thing is. When I select the GPIO28 as GPIO input. I see the same behavior.

    code:

        EALLOW;
        GpioCtrlRegs.GPAMUX2.bit.GPIO28=0;
        GpioCtrlRegs.GPADIR.bit.GPIO28=0;
        EDIS;

    (I'm not that far in the documentation. To know for sure if this is correct GPIO input initialization).

  • Very wierd! The TTL signals should not cross the 0 towards negative side. Are you sure these are the TTL signals towards & from the controller?

  • There are internal PUs on the IOs, but these are very weak, ~200uA.  You could go into GPAPUD register and disable the one on GPIO28 to be sure, but this wouldn't hold the signal high against it's own driver or a 3.3kOhm PD as you mentioned.  I just want to take that out of the equation.  Also, just to confirm J12 is removed, correct.

    I have a F28069 control stick that I use the FTDI chip for the same echo back and it works; so the only difference(other than the MCU) is the ISO chip:  Can we probe the in/out of this guy?

  • I did the measurements on the J12 pins. so yes the jumper is removed. If that is what you mean. I also did measurements on Docking-Stn USB-EMU [R3] on GPio28 and GPio29.

     I have the F28069M.

    I removed my serial-ttl (FTDI ttl-232r-3v3). for the Pull-down measurement test. So I also removed that out of the equation. So the only think I can think of: is that the F28069M or my test-software is the problem.

    -  Is it for you possible to test with the M version.

     - can you please sent me you're version of the demo.

    -  can you tell me how to configure GPio29 as input (with no pull-up) and how do I read the the pin in the debugger.

     Thanks

     

  • If i'm correct this piece of code. Sets GPIO28 as input without pull-up resistor.

        EALLOW;
        GpioCtrlRegs.GPAPUD.bit.GPIO28 = 1;
        GpioCtrlRegs.GPAPUD.bit.GPIO29 = 1;

        GpioCtrlRegs.GPAMUX2.bit.GPIO29=0;
        GpioCtrlRegs.GPADIR.bit.GPIO29=0;
        GpioCtrlRegs.GPAMUX2.bit.GPIO28=0;
        GpioCtrlRegs.GPADIR.bit.GPIO28=0;
        EDIS;

    I breakpointed direct after this code and the signal is still 3.3V. And that is odd because of my 3.3k resistor at the input. (checked with scope) 

    I changed the module for an other one,  with the same result.

  • After a week searching what I did wrong. I changed from SCI-A to SCi-B. And redid the I/O pin test and modified the example code to work with SCIB GPIO18 and GPIO19. And this worked. directly as expected

    I have the same problem with 2 of the same boards. So I think you have to check you're F28069M silicium.

    The problem:

         EALLOW;
        GpioCtrlRegs.GPAPUD.bit.GPIO28 = 1;
        GpioCtrlRegs.GPAPUD.bit.GPIO29 = 1;

        GpioCtrlRegs.GPAMUX2.bit.GPIO29=0;
        GpioCtrlRegs.GPADIR.bit.GPIO29=0;
        GpioCtrlRegs.GPAMUX2.bit.GPIO28=0;
        GpioCtrlRegs.GPADIR.bit.GPIO28=0;
        EDIS;

    Is you execute this code. You expect the signal to go low. But is doesn't . It is stays a low impended high signal.

     If you configure it as output is works fine(low and high output).

     

     

  • Is there a work around available for this problem?