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.

LAUNCHXL_F28027 + BOOSTXL-DRV8301 use SCIA

Other Parts Discussed in Thread: BOOSTXL-DRV8301, CONTROLSUITE, MOTORWARE, DRV8301

Hi All

I'm trying the instaspin_foc proj_lab05a and add the scia on gpio28-29.

I remove the BOOSTXL-DRV8301, and put the code below in the proj_lab05a.c.

The gMotorVars.Flag_enableSys is always false so it will run the while loop forever.

------------------------------------------------------------------------------

while(!(gMotorVars.Flag_enableSys))
{
  SCI_Status = SCI_getRxFifoStatus(halHandle->sciAHandle);

  if(SCI_Status != SCI_FifoStatus_Empty)
  {
    ReceivedChar = SCI_getDataBlocking(halHandle->sciAHandle);
  }

  if(ReceivedChar != 0x00 ){
      SCI_putDataBlocking(halHandle->sciAHandle, 0x05);
      ReceivedChar = 0x00;
  }
}

------------------------------------------------------------------------------

The first question :

I can just get the first time the sica putdataBlocking, then the program stuck in the SCI_getDataBlocking.

Is any possible this error caused by TripZone setting for the FAULTn and OCTWn?

The second question :

SCI_putDataBlocking(halHandle->sciAHandle, 0x05);

It should be 0x05, but I got the 0xFF, 

here is my BaudRate setting :

SCI_setBaudRate(obj->sciAHandle, (SCI_BaudRate_e)194);

If my laptop take the 38400 BaudRate, I can get the 0x05.

If my laptop take the 9600 BaudRate, I can get 0xFF, so It's very weird.

Any one knows the answer?

Hank

  • Hi Hank,

    When you state "It should be 0x05, but I got the 0xFF, " this sounds like you are not receiving any data since the SCI is of NRZ format (non-return to zero). When there is no data it will receive all 1's.

    Step 1 to make sure you can configure the SCI in loopback mode (100% internal connections). Once this works then connect the SCI to the outside world.

    ControlSUITE has excellent examples for SCI in loopback mode (C:\TI\controlSUITE\device_support\f2802x\v230\f2802x_examples_drivers\scia_loopback).

    Jeff
  • Hi Jeff

    I can run the "Example_F2802xSci_Echoback" and "Example_F2802xScia_FFDLB" on my LAUNCHXL_F28027.

    But the problem is occur when I integer the setting of Example_F2802xSci_Echoback into the proj_lab05a.

    So the problem still the same.
  • So you cannot get the SCI code from Example_F2802xSci_Echoback to run in proj_lab05a?

    Example_F2802xSci_Echoback does not use an ISR for communications, the entire SCI code is run in the background software. Do you receive any data or is it still 0xFF?
  • Hi Jeff

    I can't receive any data from my laptop, the ReceivedChar is always 0xFF.

    Hank
  • Hank,

    Please also reference the following link where others have gotten the SCI running with MotorWare: e2e.ti.com/.../1168654

    Jeff
  • Hi Jeff

    Is any possible that the FAULTn and OCTWn setting in the proj_lab05a effect the gpio 28-29?

    Hank
  • Hi Hank,

    FAULTn and OCTWn are associated with GPIO13-14 in hal.c in proj_lab05a for trip zone functions and enabled in the function HAL_setupFaults():

    // OCTWn
    GPIO_setMode(obj->gpioHandle,GPIO_Number_13,GPIO_13_Mode_TZ2_NOT);

    // FAULTn
    GPIO_setMode(obj->gpioHandle,GPIO_Number_14,GPIO_14_Mode_TZ3_NOT);

    From the DRV8301 datasheet (SLOS719) it describes both signals as fault outputs:

    • /OCTW =  Over current or/and over temperature warning indicator. This output is open drain with external pull-up resistor required. Programmable output mode via SPI registers.
    • /FAULT = Fault report indicator. This output is open drain with external pull-up resistor required.

    GPIO 28 & 29 have the SCIA RX and TX peripheral functions mapped to these pins.

    So your question is, could the trip functions of the 28027 cause an issue with the peripheral functions of the SCIA on GPIO 28 & 29?

    The TRIP pins are designed to provide a hardware path to disable the associated PWM outputs based on system condition, such as an over-current or over-voltage.  In addition to the HW path the PWMs it does have the option to generate an interrupt and an ISR could possibly impact GPIO 28 & 29.  

    But I see no direct HW relationship between GPIO 13 & 14 or TZ2 & TZ3 to the SCIA functions on GPIO 28 & 29.

    Step 1 really should be to get the SCI running in loopback mode.  I will create an SCI and SPI example after the holiday break.  It will be included in MotorWare release 16.

    Jeff

  • Hi Jeff

    I found why I can't receive the correct data.
    The LSPCLK in proj_5a is dived by 1, not 4.
    So after I modify the LSPCLK setting, my code works!

    So sorry bother you so much time.