Hello I'm trying to read remaining capacity information of some battery which sends some informations with J1939 protocol. For that I am using PIC18F26K83, so as I have understood before I want to send data to battery to show that I want some spesific information I need to take address. However when I try to claim address from PGN 60928, transmission never occurs. Everything looks correct but TXREQ bit never gets zeroed.Related part of the code can be seen below: PS: In hardware wise everything is fine I have 2 nodes which is enough for can bus and I put 120 ohm resistor between my Can transsiver Rx and Tx etc.
So my question is: for implementing J1939 protocol is it a necessity to claim an address even if it will not be used in the real vehicles system and are there any required steps before claiming an address? Just setting up the can bus and putting it into the normal mode and transmitting the name data to PGN 60928 would be enough?
//Address Claim
TXB0CON= 0b00000011; //Priority 0 clear TXREQ
//Sender ID in Extended Form
//PGN 60928 = 0b1110111000000000 (Address Claim)
TXB0SIDH= 0b11000111; //EID <28-1> Priority =6
TXB0SIDL= 0b01101010; //Extended Enable
TXB0EIDH= 0b00000000; //
TXB0EIDL= 0X80; //Source ID=128;
TXB0DLC = 0b00001000; //No RTR Data Length=
//Data to be sent
TXB0D0=0X80;
TXB0D1=0XFE;
TXB0D2=0XFF;
TXB0D4=0XFF;
TXB0D5=0XFF;
TXB0D6=0XFF;
TXB0D7=0XFF;
//Normal Mode
CANCON =0x00;
while(!(CANCON.B7==0 && CANCON.B6 ==0 && CANCON.B5==0)){
LATA2_BIT=1;
} // Wait for can to enter normal mode
LATA2_BIT=0;
TXB0CON = 0b00001011; //transmission request , priority 0
wait: if(TXB0CON.B3==1){
LATA2_BIT =1;
goto wait;} //Wait until Transmission is Succesfull
Filters might be a problem, set mask to 0x00 and try again