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
Posted: Sat Jul 23, 2005 12:44 am
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
Posted: Mon Jul 25, 2005 12:36 pm
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
Posted: Mon Jul 25, 2005 2:58 pm
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.
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