<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Geir,<br>
<br>
do you set the data length (TXB0DLC)?<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">Am 11.01.2016 um 22:50 schrieb Geir
Øyvind Vælidalo:<br>
</div>
<blockquote
cite="mid:29436953-8D4D-40E7-A0DA-AA7EEF3BE79F@validalo.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
Hi guys!
<div class=""><br class="">
</div>
<div class="">I’m trying to send a can-messages. I copied the code
from the Twizy-code, but it seems to fail for me.</div>
<div class="">This is the code for sending: </div>
<div class=""><span class="Apple-tab-span" style="font-weight:
700; white-space: pre;"> </span><span style="font-weight:
700;" class="">while (TXB0CONbits.TXREQ) {}; </span><span
class="Apple-tab-span" style="font-weight: 700; white-space:
pre;"> </span><span style="color: rgb(227, 36, 0);
font-weight: 700;" class=""><</span><b style="color:
rgb(227, 36, 0);" class="">—</b><span style="color: rgb(227,
36, 0); font-weight: 700;" class=""> This one is ok</span></div>
<div class=""><span style="font-weight: 700;" class=""><span
class="Apple-tab-span" style="white-space:pre"> </span></span><b
class="">TXB0CON = 0; TXB0SIDL = (ks_send_can.id & 0x07)
<< 5; </b></div>
<div class=""><b class=""><span class="Apple-tab-span"
style="white-space:pre"> </span>TXB0SIDH = (ks_send_can.id
>> 3); </b></div>
<div class=""><b class=""><span class="Apple-tab-span"
style="white-space:pre"> </span>TXB0D0 =
ks_send_can.byte[0]; </b></div>
<div class=""><b class=""><span class="Apple-tab-span"
style="white-space:pre"> </span>TXB0D1 =
ks_send_can.byte[1];</b></div>
<div class=""><b class=""><span class="Apple-tab-span"
style="white-space:pre"> </span>...</b></div>
<div class="page" title="Page 24">
<div class="layoutArea">
<div class="column"> <span class="Apple-tab-span"
style="white-space:pre"> </span><b class="">TXB0CON =
0b00001000;</b> //Mark the message for sending
<div class=""><span class="Apple-tab-span"
style="font-weight: 700; white-space: pre;"> </span><font
class="" color="#e32400"><span style="font-weight: 700;"
class="">while (TXB0CONbits.TXREQ) {}; </span><span
class="Apple-tab-span" style="font-weight: 700;
white-space: pre;"> </span><span style="font-weight:
700;" class=""><</span><b class="">—</b><span
style="font-weight: 700;" class=""> H</span><span
style="font-weight: 700;" class="">ere it hangs</span></font></div>
<div class=""><font class="" color="#e32400"><span
style="font-weight: 700;" class=""><br class="">
</span></font></div>
<p class="">TXREQ seems like it never gets cleared :-\ I
have CAN Write enabled, so that is not the problem.</p>
<p class="">Any ideas? </p>
<div class="">Best regards,</div>
<div class="">Geir</div>
<p class=""><br class="">
</p>
<p class=""> </p>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</body>
</html>