Search found 8 matches

Return

by QMESAR
Fri May 05, 2017 8:02 am
Jump to forum
Jump to topic

Re: Wake Up from CAN_BUS

No. I just set the timer to RXINT and set Sleep() I don't know if the macro TMR RXINT set configuration bit for wake up by activity on RX can-bus or it makes it for UART RX. As I see, I need to set REQOP2:REQOP0 = 001 and WAKIF = 1. That's it? Hi with out seeing your Flowchart and configuration set...
by Benj
Fri May 05, 2017 5:24 pm
Jump to forum
Jump to topic

Re: Wake Up from CAN_BUS

Hello, I may be wrong on this but it looks like you just need to use this C code to enable the wake from sleep and reset the interrupt flag. cr_bit(pir3, WAKIF) //Clear interrupt flag if set - re-arm interrupt st_bit(pie3, WAKIE); //Enable interrupt st_bit(intcon, PEIE); //Enable Peripheral Interrup...
by LeighM
Mon Sep 11, 2017 9:53 am
Jump to forum
Jump to topic

Re: Internal CAN-BUS

Hi, To customize the internal CAN baud rate you will need to do something like this ... // Request config mode. cancon = MX_CAN_REQOP_CONFIG; while( (canstat & MX_CAN_OP_MODE_BITS) != MX_CAN_REQOP_CONFIG ); // change the baud rate registers brgcon3 = 3; brgcon2 = 209; brgcon1 = 1; // Request nor...
by Benj
Mon Sep 18, 2017 12:59 pm
Jump to forum
Jump to topic

Re: CAN-BUS RXbuffers

Hello,

If you need to write a value to the registers manually then you can do so using a C code icon and the register name in capital letters.

e.g.

Code: Select all

RXFUL = 0;
by Benj
Tue Sep 19, 2017 10:18 am
Jump to forum
Jump to topic

Re: CAN-BUS RXbuffers

Aha in that case you first need to create a Flowcode variable to do the read into. I would suggest a variable named dummy to signify your throwing the value away. Then simply use a C code block to read the value from the register into the variable. Swapping REGNAME for the name of the register you w...
by LeighM
Thu Oct 12, 2017 11:11 am
Jump to forum
Jump to topic

Re: SPEED CAN-BUS inernal external

Hi, Not sure if this is the complete answer, but I noticed a missing check of CAN2 Buffer 1 ... can2buffer1.jpg edit: To set the rollover CAN1... // Request config mode. cancon = MX_CAN_REQOP_CONFIG; while( (canstat & MX_CAN_OP_MODE_BITS) != MX_CAN_REQOP_CONFIG ); rxb0con = 0x24; CAN2... //setup...
by LeighM
Thu Oct 12, 2017 11:51 am
Jump to forum
Jump to topic

Re: SPEED CAN-BUS inernal external

OK. I've just done an edit to my previous post, with code for setting the rollover mode, see if that helps.
btw, the code is to add the rxb0con line into the existing initialization code.

Does the problem happen in any particular direction, CAN1->CAN2, CAN2->CAN1?
by LeighM
Mon Feb 11, 2019 10:39 am
Jump to forum
Jump to topic

Re: SPEED CAN-BUS inernal external

so you need to go back to the version that masks the status with 0x04, just to get the Tx Buffer 0 status