CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Can bus Acknowledge

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Youngpup



Joined: 01 Oct 2007
Posts: 11

View user's profile Send private message

Can bus Acknowledge
PostPosted: Thu Sep 18, 2008 6:43 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 18, 2008 8:05 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 18, 2008 9:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 18, 2008 10:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 18, 2008 10:08 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 18, 2008 2:35 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group