<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I've met a problem to which I need some help.</div><div><br></div><div>I need to request some parameters from one ECU, and try to transmit on the can-bus from the OVMS-module.</div><div>Whatever I do, the sys_features[FEATURE_CANWRITE] is always "0" and the transmission will never take place.</div><div><br></div><div>I have tried to set the sys_features[FEATURE_CANWRITE] to "1", but as explained in the dev-doc, the TXB0CONbits.TXREQ will never go true and the module will reboot.</div><div><br></div><div>The receiver of the request (RX-part) works fine, I've tested that by transmitting manually with PCANView.</div><div>I have tried to put the TX-statements in the poll1, ticker1 and currently; in an idle poll (as in vehicle.teslaroadster.c) which has a hook in </div><div>vehicle_fn_idlepoll = &vehicle_thinkcity_idlepoll;</div><div><br></div><div>I've debugged a bit and found that:</div><div><div>FEATURE_CANWRITE = 15</div><div>sys_features[FEATURE_CANWRITE] = 0 </div><div>right before the if-test begin.</div></div><div><br></div><div>I would be happy if anyone have some helpful hints :-)</div><div><br></div><div><br></div><div><div><i>BOOL vehicle_thinkcity_idlepoll(void)</i></div><div><i>{</i></div><div><i> if (sys_features[FEATURE_CANWRITE]>0)</i></div><div><i> {</i></div><div><i> while (TXB0CONbits.TXREQ) {} // Loop until TX is done</i></div><div><i> TXB0CON = 0;</i></div><div><i> TXB0SIDL = 0b01100000; // msg 753 03 22 49 67</i></div><div><i> TXB0SIDH = 0b11101010;</i></div><div><i> TXB0D0 = 0x03;</i></div><div><i> TXB0D1 = 0x22;</i></div><div><i> TXB0D2 = 0x49;</i></div><div><i> TXB0D3 = 0x67;</i></div><div><i> TXB0DLC = 0b0000100; // data length (4)</i></div><div><i> TXB0CON = 0b00001000; // mark for transmission</i></div><div><i> }</i></div><div><i>return FALSE;</i></div><div><i>}</i></div></div><div><br></div><div><br></div><div>Best regards</div><div>Håkon</div></body></html>