<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">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 color="#e32400" class=""><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 color="#e32400" class=""><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></body></html>