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.

Programming BQ27510-G3 with PIC33ep512mu810

Other Parts Discussed in Thread: BQ27510-G3, EV2400, BQSTUDIO

Hallo E2E Community,

I am an electronics technician in education and I need some help.

First of all I use the PIC33ep512mu810 uC. The Program is coded on MPLAB.  

I want to monitor three Batteries parallel with three BQ27510-G3.

I tried to read the device type from the BQ27510-G3 but it doesn't work.

I measured the Bus with the oscilloscope and saw all acknowledge and not acknowledge on the right place.

But I still get no Data!

So I tried some different command arrangements.

Butt still nothing works.

I think it may be a definition, "command structure"  or schematic mistake.  

That' s the schematic:

And that's my implemented code to read the Device Type:

I2C1CONbits.SEN = 1; 

while(I2C1CONbits.SEN == 1);

 

while(I2C1STATbits .TRSTAT == 1);

I2C1TRN  = 0xAA;

while(I2C1STATbits .TRSTAT == 1);   

while(I2C1STATbits .TBF == 1);

 

while(I2C1STATbits .TRSTAT == 1);

I2C1TRN  = 0x00;

while(I2C1STATbits .TRSTAT == 1);   

while(I2C1STATbits .TBF == 1);

 

while(I2C1STATbits .TRSTAT == 1);

I2C1TRN  = 0x01;

while(I2C1STATbits .TRSTAT == 1);   

while(I2C1STATbits .TBF == 1);

 

while(I2C1STATbits .TRSTAT == 1);

I2C1TRN  = 0x00;

while(I2C1STATbits .TRSTAT == 1);   

while(I2C1STATbits .TBF == 1);

 

I2C1CONbits.PEN = 1;

while(I2C1CONbits.PEN);

 

I2C1CONbits.SEN = 1; 

while(I2C1CONbits.SEN == 1);

 

while(I2C1STATbits .TRSTAT == 1);

I2C1TRN  = 0xAA;

while(I2C1STATbits .TRSTAT == 1);   

while(I2C1STATbits .TBF == 1);

 

while(I2C1STATbits .TRSTAT == 1);

I2C1TRN  = 0x00;

while(I2C1STATbits .TRSTAT == 1);   

while(I2C1STATbits .TBF == 1);

 

I2C1CONbits.RSEN = 1;

while(I2C1CONbits.RSEN == 1);

 

while(I2C1STATbits .TRSTAT == 1);

I2C1TRN  = 0xAB;

while(I2C1STATbits .TRSTAT == 1);   

while(I2C1STATbits .TBF == 1);

 

I2C1CONbits.RCEN = 1;      

while(I2C1STATbits .RBF ==0);   

I2Cread1 = I2C2RCV;       

while(I2C1CONbits.RCEN ==1);

I2C1CONbits.ACKDT=0;

 

I2C1CONbits.RCEN = 1;      

while(I2C1STATbits .RBF ==0);   

I2Cread2 = I2C2RCV;       

while(I2C1CONbits.RCEN ==1);

I2C1CONbits.ACKDT=1;

 

I2C1CONbits.PEN = 1;

while(I2C1CONbits.PEN);

I can't see the mistake. 

Thanks for help:)

  • the and gate and the diode may be causing problems. Depopulate them and see if that helps. Also are you trying to communicate with the device using bqstudio and an ev2300 or ev2400?

    Pls refer to the user guide of the device on how to configure and use the device.

    thanks
    Onyx
  • Hi Onyx

    Thanks for your replay. The diode / AND-Gate doesn't cause the problem..

    Some more details: I can read all the Standard Data Commands, but none of the Subcommands.

    We clock the I2C bus with 400kHz, use the single byte protocol with 70us delays as reccomended by SLUUA97 - 10.2014.

    Is there any locking bit I missed to unlock?? (remark: even read access does not work..)

    thanks for any help :-)

    Best, Steven