CAN bus receive problem

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 8-bit PIC MCUs.
Post Reply
Author
Message
GunkutA
Posts: 44
Joined: 16 Jan 2019 11:56

CAN bus receive problem

#1 Post by GunkutA » 31 Jan 2019 11:45

Hello I am using PIC 18F26K83 and I am trying to communicate with a device that keep sending Data with Can Bus. I can transmit data to this device and I get ACK/NACK since TXREQ bit gets zero after I set it to 1 for transmission. So I assume my Baudrate resgisters are also fine. However, I have a problem with receiving side. RXFull never gets 1 It is always zero. First I thought the reason is because of the mask and filters but I set mask and filters as :
//Mask =0 ,receive ALL
RXM0SIDH = 0x00;
RXM0SIDL = 0x00; //0x00;
RXM0EIDH = 0x00;
RXM0EIDL = 0x00;

//Filters
RXF0SIDH = 0x07;
RXF0SIDL = 0x88;
RXF0EIDH = 0x00;
RXF0EIDL = 0x00;
So as it can be seen my mask is 0. Which is supposed to let all messages to be loaded to my receive buffer. So I'm stuck at this stage.
Another thing worth to mention that: I am supposed to get messages with extended ID so when I set RXM register to 11 RXFULL gets 1. RXM =11 means receives all messages even if it is with errors. But when I set it to RXM = 10 (which is only let extended ID messages) RXFULL never gets 1. So I am receiving messages with error. Any ideas related to that? or solutions maybe. Thank you before hand.

GunkutA
Posts: 44
Joined: 16 Jan 2019 11:56

Re: CAN bus receive problem

#2 Post by GunkutA » 31 Jan 2019 15:09

Okay guys so the problem was in the RXb0CON.B0 bit, its for selecting the filter that will be used and I set it and made it Filter 1 (althought I did not set any Filter 1) . When I clear that bit now everything working perfect!!!! Finally...

Post Reply

Return to “PIC PRO Compilers”