• Resolved

CCS/EM1402EVM: UART and SPI communication

Part Number: EM1402EVM

Tool/software: Code Composer Studio

I'm working on EM1402EVM ACB Module, for now I'm able to read battery voltage and temperature from AUX ports, with GUI software.

I now use original software EM1402EVM Example Code  with CCS 8.1.0 (without GUI software). Program don't show any errors on the compiling,

and code is sucessufuly loaded into TMS570 launch board (only connected throu J7 with EM1402). After debug and start, program runs without any

errors, but after that there isn't any active ballancing of the batteries (there isn't any current flow (>100mA) in baterries loop (J3) or in 12V loop (J1),

also there isn't any SPI communication between PL455A and EMB1428's, there is only constant UART data sending from TMS570 toward EM1402 and short

response on start from PL455A (Tx) on UART (PulseView data in attachement). Both LED's are ON. Is it maybe EM1402 board deffective or I missed 

something (is it EMB1428 controled by PL455A through SPI with software mentioned above) ?

Tnx

DEBUG__MANUAL_START_1MHz.7z

  • Hi Mcupwr,

    Would you be able to provide the cell balancing timing values you are using, and which cells you have enabled balancing for?

    Thanks!
    Vince
  • In reply to Vince Toledo:

    Hi Vince,
    I didn't change anything in EM1402EVM Example Code. I use 16 standard 3.6V Li-Ion cell's. (I'm noticed that there isn't also 12V on 12V and 12VF rails. Should be there also 12V for powering EMB1499 when is 5V3 active?) Should I change something in this code?
    Tnx

    P.S.

    Gate Q46 (drive from GPIO5 U1) always have 2.5V on it. When I connect ground on the gate of Q46 (RS_EMB1428), then 12V line start to work, but again without balancing.

  • In reply to Mcupwr:

    Hi Mcupwr,

    Just to clarify before continuing, do you have a 12V battery connected to the other side of the transformer as shown in this image:

    Thanks!

    Vince

  • In reply to Vince Toledo:

    Hi Vince,

    Yes, 12.5V battery is on J1 connector, T1 have 12V on pins 1 and 3, Q4 drain is on 12V (armed) without PWM on gate.
    On pin 11 (U3) is 4.5V, which holds Q3 gate on high and on the low pin 8 (EN, U2).

    Tnx

  • In reply to Mcupwr:

    Hi Mcupwr,

    Considering there is no SPI protocol being sent between the PL455 and EMB1428, I would first verify that the SPI communications of the PL455 are working properly. To do so, please attempt to use the functions from the emb1428.c file (in the "source" folder of the example code) to send basic SPI commands (these functions will need to be called in "sys_main.c" which is also in the "source" folder). Use a scope or logic analyzer to see if there are any SPI interface communications. You will need to modify the example code to make it simpler for debugging purposes.

    If you do not see any SPI communications, then please let me know. If you do, please provide the SPI waveforms so I can help to continue debugging.

    Thanks,
    Vince
  • In reply to Vince Toledo:

    Hi Vince,

    Thank you for your reply. No, there isn't any kind of SPI (on GPIO2,3 and 4 at Pl455A) protocol between the PL455 and EMB1428, and also there isn't 12V on EMB1428 because Q46 is on HIGH level from GPIO5 (PL455A), only 5,3V. I'm looked this example of code ( EM1402EVM Example Code ) and in it is only mentioned PORTA 0, 1 and 7, but not PORTA5 which is important for enabling 12V thru Q46 (maybe I'm in wrong). Is this code good?
    Maybe I use wrong code, I was tried it on two boards, same thing, there is only UART communication (TMS570 (R8 removed)<>PL455A) on start and later only silent from PL455A (on its TX line, see PulseView (Sigrok) data in attachement). PL455A don't send neither one byte of data over SPI lines toward EMB1428.

    P.S.

    Should be there connected MOSI, MISO and SCLK on EM1402 board (J2 connector) with SPI1SIMO,SOMI and SPI1CLK on TMS570 borad SPI outputs, or there is no need for that?

    Tnx in advance.

  • In reply to Mcupwr:

    Hi Mcupwr,

    I'd like to make sure the PL455 is able to output SPI, and so before trying to enable any of the FETs, please modify the sys_main.c file to just send SPI commands. Don't try to enable or disable any FETs yet, and make sure to comment out lines of code doing that in the meantime, so we can isolate if this is an SPI issue.

    As for your second question, you do not need to use external SPI communications to control the EM1402, but it is an option (you would need to write your own code to do so.

    Summary:
    -Go to sys_main.c
    -Remove everything in the "do-while" loop (near line 359) except for some emb1428.c function, like "EMB_Vset(1,2)"
    -Run the code and monitor the communications between the PL455 and emb1428

    Regards,
    Vince
  • In reply to Vince Toledo:

    Hi Vince,

    I was tried what you are suggested (with "EMB_Vset(1,2)" every 100ms) , but there isn't any kind of SPI (on GPIO2,3 and 4 at Pl455A) protocol between the PL455 and EMB1428 on the scope or on the logic analyzer. PL455A don't send any SPI commands (on GPIO2,3 and 4.), SPI is dead.

    P.S.

    Is the address of EM1402 block (i use only one in single mode) which is sended by "EMB_Vset(1,2)" routine  from TMS570 (01) correct?  It sends 91:01:79:08:5F:6A, etc. and always with address 01, shouldn't it be 00, maybe because of that there isn't any bit-banging (response) on the SPI.  

    EM1402 respond only on the 00 address (see logic data).

    Regards,

    4353.SPI_test1.rar

  • In reply to Mcupwr:

    Conclusion,

    This TI code don't work. I tried it with CCS v.5.5.0, 6.0 and the last 8. SPI Bit-banging don't work, just don't

    spend your time (like me) on it. You need to make your own code.

    Regards