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.

CCS/TMS570LS3137: Unable to read cell sample values

Part Number: TMS570LS3137
Other Parts Discussed in Thread: EM1402EVM, , HALCOGEN, TMS570LS0432

Tool/software: Code Composer Studio

Hi sir,

I am doing active cell balancing using TMS570Ls3137 controller and EM1402EVM board. I am facing problem in UART communication, I am not able to see cell sample values when i run it on system. 

I generated code from HALCOGEN and with the given BQ76pl455_example_code, i tried to debug it. but it is not working. I am attaching my HALcogen setting file, can you please check it and let me know whatever i am doing is righht or wrong?

7331.zip

  • Hello,

    1. please use 1 stop bit, 8 data bit

    sciREG->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */
    | (uint32)((uint32)1U << 24U) /* enable receive */
    | (uint32)((uint32)1U << 5U) /* internal clock (device has no clock pin) */
    | (uint32)((uint32)(1U-1U) << 4U) /* number of stop bits */
    | (uint32)((uint32)0U << 3U) /* even parity, otherwise odd */
    | (uint32)((uint32)0U << 2U) /* enable parity */
    | (uint32)((uint32)1U << 1U); /* asynchronous timing mode */

    /** - transmission length */
    sciREG->FORMAT = 8U - 1U; /* length */

    2. the baudrate should be 250kbps

    3. wake up PL455 before using SCI to read register value from PL455
  • Hi Sir,

    thanks alot for your help.

    Now, i am able to get cell sample values in bFrame.

    I was using SCI/LIN in TMS570LS3137, with that i was not able able to get bFrame values. with hardware debugging, i got to know that on transmit pin i am not getting proper response from the controller.

    then i switched to SCI and now there is a data in bFrame and response of transmit pin on scope is also proper.

    In halcogen, i selected sci in pinmux and taking NHET113_SCITX and NHET106_SCIRX for communication.

    now, i want to setup spi communication for active cell balancing.

    for that i want to know what are the settings required in HET because to observe charging and discharging activity of cell, i required GUI  to be configured .

    so , i want to emulate N2HET timer module for this. 

    please help in configuration settings in halcogen.

    thank you 

  • Hello,

    TMS570LS3137 has 2 SCI modules. On HDK, the SCI2/LIN is routed to the Micro-USB for interfacing with external device. You can use SCI to interface with PL455, and use SCI2/LIN to communicate with PC. You don't need to use the NHET emulated SCI, and don't need to remove R8 and R9.

    I don't know if the PL455 supports SPI interface. If you use SCI2, SCI or SPI, you don't need to use NHET.
  • hi sir,

    thank you for this information, Next step is parallelly GUI should display cell voltage.

    We refer TMS570LS0432 example code. Only SCI port available that was used for board to board communication and N2HET used for communication with host PC

    In TMS570LS3137, we got values through SCI in bFrame. Now SCILIN should communicate with PC via UART. Does BQ76PL455-GUI support this interface. if so how we will going to integrate SCI(250kbps) with SCI/LIN(9600) so that we can send data to host PC?

    Thank you

  • Hello,

    1. Replace "scilinREG" with "sciREG" (except for sci.c, sci.h, reg_sci.h)
    2. Modify the code in host_msg: use sci functions (sciLinREG) to replace HETUART1OutChar() function, etc
  • Hi Sir,

    I changed the API according to SCI/LIN but i am not able to see any output. so, if you have any flowchart or code snippet or any document related to sci functions used in host message.
    it would be really very helpfull.

    Thank you,
    Gargi
  • Hi Gargi,

    Are you using TI TMS570LS3137 HDK? Which SCI do you use to communicate with EM1402 EVM, SCI or SCI2 (scilin)? I suggest you use SCI for EM1402EVM, and SCI2 for PC which is built-in through the micro-USB port.
  • Hi Sir,

    yes I am using TMS570LS3137 HDK. To communicate with EM1402 EVM, I am using SCI(250K) and SCI2(9600) is used to communicate with PC.

    Now, I want to run battery GUI in parallel with the set up. 

    In TMS570LS0432 example code, to run GUI they are using host_msg.c and they made connections as follows.

    I tried modifying the code in host_msg by using sci functions (sciLinREG) to replace HETUART1OutChar() function. but, i am not able to see proper output. 

    I also tried to make second UART as emulated N2HET timer module but, for that also, connections and halcogen setting is required.

    It would be helpful, if you have any document related to that.

    Thank you

  • Hi Sir,
    I have one more confusion that , I am using the USB(SCI/LIN) for hardware debugging ,then at the same time how can I see the GUI also . Should I have to flash the code (NOT HARDWARE DEBUGGING) first and then use the same USB for GUI ?

    If yes then how to flash the code ? How to create the .hex file through CCS ?

    Please suggest me .

    Thank You,
    Gargi
  • Hello Gargi,

    You debug the code using JTAG, and the GUI sends message to MCU through SCI. Both SCI and JTAG message are carried through USB packets.

    In CCS, after compilation, the code needs to be loaded onto the flash, then execute from the flash.

    If SCI and SCI2 are used for EM1402 and GUI, you don't need to NHET emulated SCI.

    Please make sure SCIRX (pin W3) and SCITX (N2) are selected in pinmux.
  • Hi Sir,

    Thanks alot for your continuous support.

    I want to know on which pin of JTAG, the connections should be made for transmit and receive?

    what changes i have to do in host message, when i am using SCI2 to communicate with PC and run GUI?

    Thanks,

    Gargi

  • Hi Gargi,

    On LS3137 HDK, we use FPTI chip (FT2232HL) to convert SCI data and JTAG data to USB packet. The SCI message is not transmitted on JTAG.

    On page 23 of the schematics, pin16/17/18/19 of FT2232 are connected CPLD , then to TMS570LS3137 JTAG pins. The Pin 38/39 of FT2232 are connected to TMS570LS3137 SCITX and SCIRX pins.

  • Hi Sir,

    I am confused between HET and SCI/LIN to make them as UART to communicate with PC.

    1. if i will take HET then i want to ask any other debugger required to debug the code using JTAG or i can flash code first then i will be able to run gui?

    2. And if i will take SCI/LIN then will it support 250kbps to communicate with PC or not?

    3. If i will take SCI/LIN then what are the required changes ,i have to do in Notification.c and replace hetNotification to sciNotification.

    #pragma WEAK(hetNotification)
    void hetNotification(hetBASE_t *het, uint32 offset)
    {
    /* enter user code between the USER CODE BEGIN and USER CODE END. */
    /* USER CODE BEGIN (39) */
    if(offset==4)
    {
    HetUART1TxISR();
    }
    else if(offset==24)
    {
    HetUART1RxISR();
    }
    /* USER CODE END */
    }

    Thanks,

    Gargi

  • Hello Gargi,

    SCI/LIN supports 250kbps baudrate for communicating with GUI on PC. If you use SCI/LIN to replace NHET emulated UART, you need to modify the code in the host_msg.c

    replace HetUARTxx with SCI/LIN related functions
  • change:
    HetUART1TxStart(g_ui8HostTxBuf, xyz_size+3);
    to:
    sciSend(scilinREG, xyz_size+3, g_ui8HostTxBuf);

    In HalCoGen SCI2 configuration, enable RX/TX interrupt, and enable the SCI2 interrupt in VIM (channel 13, the isr is linHighLevelInterrupt)
  • Hi Sir ,

       I have the following doubt regarding Intrrupt generation of 2nd UART (SCI2 for GUI) .

    1. Should I connect the same UART data line of PL455 to both SCI and SCI2 , so that at the same time the interrupt will generate in both UART of TMS570LS3137  ?

    OR

    2. Should I connect to SCI and storing data to its register and transmitting that Cell voltage data to SCI2 by connecting the SCI and SCI2 externally ?

    OR

    3   Should I connect to SCI and storing data to its register and transmitting that Cell voltage data to SCI2 without any external connection  ?

    In present example code of TMS570BMS , In notification.c for het they are using offset (4,24)  to generate ISR , My confusion is when I am using SCI function instead of het ,how can I generate  that interrupt ?

    Thank You,

    Gargi 

  • Hi Gargi,

    In your setup, SCI2 is used to interface with PC GUI, and SCI is used to TX/RX data to/from PL455.

    You don't need HetUART1RxISR() and HetUART1TxISR() anymore. But you have to write your own sciNotification() for SCI2. Te HALCoGen generates ISR for SCI2 and SCI.

    The RXed SCI2 data is stored in g_sciTransfer_t[1U].rx_data
    The RXed SCI data is stored in g_sciTransfer_t[0U].rx_data

    The g_ui8HostRxBuf1 and g_ui8HostRxBuf0 are used to store HET SCI data, you can map g_sciTransfer_t[1U].rx_data to those buffers.
  • Hi Sir,

    Thanks a lot for your support so far.

    i have question regarding GUI is not working.

    i have mapped the g_ui8PL455Data buffer as g_sciTransfer_t[1U].tx_data=g_ui8PL455Data in acb.c.

    and with the help of logic analyzer, i am able to see the the data of SCI RX to the SCI2 TX and through schematics of TMS570LS3137, it is clear that SCI/LIN TX is connected to USB TX. 

    i dumped the code in controller and try to run GUI with that. but, GUI is unable to open COM port.

    i want to know where am i going wrong?

    what is the procedure to run GUI parallel with the demonstration?

    Regards, 

    Gargi

  • Hello Gargi,

    I was on vocation then business travel, so I am sorry for the late response. I assume you have solved your problem. Thanks
  • Hi Sir,

    its OK sir. i am struck on same thing. we ordered TMS570LS0432 Launchpad and now i am working on it. 

    the example code EM1402EVM is working fine as i checked it by putting breakpoints through hardware debugging and also i notices wave forms in logic analyzer.

    now, i am working on  TMS570BMS  example code and trying to run GUI with this.

    we made changes in launchpad by removing R8 and R9,

    connected J4-1(NHET00, emulated UART TX) to U2(FT2322HL) pin39 and

    J4-2(NHET02, emulated UART TX) to U2(FT2322HL) pin38 .like the snapshot below:

    and i am doing settings in HALCOGEN as follows:

    driver enable: RTI,GIO,SCI/LIN, SPI1 AND HET

    Interrupt enable: RTI Compare 0,1,2,3

                               giohighlevel(GIO lnt A)

                               het1highlevel(HET level 0)

    linhighlevel(LIN1 level 0)

    GIO portA: J2-3 as input(FLT_N)

    J2-8 as output(RS_EMB1428)

    J2-9 as output(GPIO1/CS_OE)

    J2-4 as input (FAULT_INT)

    J2-10 as output(GPIO0/CS_STORE)

    SCI/LIN:

    WAKEUP: SPI1CS3(use as GIO) 

    but still my GUI is not working. how can i able to run GUI? 

    please let me know. if any other settings required in configuration.

    HET driver enable is sufficient or i have to make more changes in halcogen.

    Thanks in advance