View previous topic :: View next topic |
Author |
Message |
Youngpup
Joined: 01 Oct 2007 Posts: 11
|
Can bus Acknowledge |
Posted: Thu Sep 18, 2008 6:43 am |
|
|
Hi, Does anyone know how to set the acknowledge bit so it can be transmitted back to the sender?
Currently I am using a USB can bus device communicating with PIC18F4680. The USB can bus device is the master of the can bus network but when it sends out its message it is expecting an acknowledge bit to be sent back so it stops sending the data. This is not happening right now. My pic continues to receive the same message over and over again causing me great grief. Any thoughts.
I am using can-18xxx8.c
Thanks |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Thu Sep 18, 2008 8:05 am |
|
|
I'm not sure how you're testing for the ack bit as its generation is automatic if a listener(s) detect a valid message. If you don't have a listener on the bus, the ACK will never be set. Conversely, if you do have a listener but the ACK never happens you should check to ensure that you have the bit rate set correctly for both transmitter and receiver. The lack of an ACK might indicate that your master device isn't set to the correct bit rate for whatever h/w you're trying to communicate with. |
|
|
Youngpup
Joined: 01 Oct 2007 Posts: 11
|
|
Posted: Thu Sep 18, 2008 9:53 am |
|
|
thanks for a quick response. I needed confirmation of the ack being automatic. I my problem has to do with setting up the filters. Any thoughts. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Thu Sep 18, 2008 10:02 am |
|
|
I don't think the filters have anything to do with the generation of an ACK. I think (but I'm not sure) that any listener on the bus will ACK a valid message regardless of how the filters are set up. The filters are downstream of the reception h/w or process. |
|
|
Youngpup
Joined: 01 Oct 2007 Posts: 11
|
|
Posted: Thu Sep 18, 2008 10:08 am |
|
|
I used 2 of the USB Can bus devices and the only way for them to communicate properly was to implement filters. So I figure if I do the same with the pic it will work as well. I am only speculating but I hope that this will work. The baud rates look the same on the scope for both pic and usb device. At this point I will try anything. |
|
|
Youngpup
Joined: 01 Oct 2007 Posts: 11
|
|
Posted: Thu Sep 18, 2008 2:35 pm |
|
|
You were right. I took another look at the baud rate and found that the phase seg1&2, sjw and prescaler were not the same as the USB device. I have changed them and now it is working fine. I should have looked at it sooner. Thanks again. |
|
|
|