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 support@ccsinfo.com

CAN (PIC18F2480)

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







CAN (PIC18F2480)
PostPosted: Fri Jul 22, 2005 2:20 pm     Reply with quote

I am using a PIC18f2480 and a MCP2551 can transciever. I am also using MPLAB IDE 7.20 with CCS compiler. I am using the library functions titled can18xxx8.c and can18xxx8.h and calling can_init. In the beginning of the function can_init calls can_set_mode(CAN_OP_CONFIG). At the end of the function can_init calls
can_set_mode(CAN_OP_NORMAL). I checked CANSTATUS register and it says that CAN is still in configuration mode. I had verified that the functions are being called. How can I change it to NORMAL mode? I want it to be in NORMAL mode so that I can send and recieve data. Help?

Thanks,
Arlene
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 23, 2005 12:44 am     Reply with quote

The address of the CANSTAT register depends upon the mode that
the CAN module is in. For the can-18xxx8.c driver, you should be
operating the 18F2480 in CAN Mode 0. The address of the CANSTAT
register in Mode 0 is 0xF6E. Is that the address you are reading ?
Arlene
Guest







PostPosted: Mon Jul 25, 2005 12:36 pm     Reply with quote

yes that is the the address of the CANSTAT register in Mode 0 is 0xF6E. We are still having the same problem where incoming data isn't being stored in the PIC. When we probe CANRX..signal is seen but it can't be sent back to the UART. We believe that the data isn't being stored in the correct receive buffers in the PIC. any suggestions?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 25, 2005 2:58 pm     Reply with quote

I have no more suggestions. I did write something here, but it's
the same thing I said in previous threads and there's no reason to
repeat it, so I deleted it. I will let someone else reply.
Arlene
Guest







help
PostPosted: Tue Jul 26, 2005 10:44 am     Reply with quote

someone help please!
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