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

Need helps for CAN controller MCP2510

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



Joined: 29 Jun 2004
Posts: 1

View user's profile Send private message

Need helps for CAN controller MCP2510
PostPosted: Tue Jun 29, 2004 10:32 pm     Reply with quote

I am implementing a project in which a CAN network with mcp2510 from Microchip is used and my MCU is Atm32, Crystal 7.328. The CAN interface chip in use us 82250.
In my project, pins TX0RTS, TX1RTS, TX2RTS are setup as general inputs and they are connected to on/off switches. Pins RX0BF, RX1BF are confiured as general outputs and I connect them to two LEDs. Pin INT of mcp2510 is connected to pin PD2 of Atmeg32 (INT0) in order to invoke interrupts (e.g. complete transmit or receive from MCP2510).
In my project, I can initialize the CAN chip mcp2510 (Configuration mode, Normal mode or feedback mode) without problems and notes in Microchip MCP2510 Rev. Errata Sheets are considered.

I wrote a program to turn on/ turn off LEDs in a loop or turn on/off them according to switches connected to input pins TX0RTS, TX1RTS, TX2RTS. It worked very well.
And in that program, if I put the CAN chip in loopback mode, I can transmit messages to the CAN chip and receive them without problems (seen on a LCD). In that program, I used buffer 0 receive interrupt to get messages and display them on the LCD.
However, when I changed the mode of mcp2510 to normal mode, problems came up. When I transmited messages, I could not receive the messages and receice interrupts did not occur. Even though when I enabled transmit inteerupt of MCP2510, no complete transmit interrupt happened too.

As well known, the CAN chip mcp2510 uses SPI to interface with the MCU and I think my SPI driver is OK as I have applied it for many other projects with success. In my program, I did follows flow char diagram in MCP2510 datasheet and some other application notes on MCP2510. Checking TXREQ bit in TXBnCTRL register was done. In the interrupt routine that serves interrupt events from MCP2510 (e.g. compelete transmit interrupt, receive interrupt .. ), I cleared coresponding flag bits (as such RX0IF, TX0IF ...). For other things like crystal clock, timing bit ..., I think they are OK as I closely followed the MCP2510 datasheet, MCP2510 Rev. Errata Sheet, and the note "An In-Deep Look at the MCP2510" and the system could comunicate each other well in loopback mode.

So could any one with experience in that CAN chip give some advice to solve that problem and tell me a way to test my system. I know the Microchip CAN Kit is good but it is beyond my budget. My thinking is in the normal mode, can I use only on CAN chip to test the system.

Thank a lots and really look forward to get your replies
Douglas Richard



Joined: 08 Sep 2003
Posts: 49
Location: Concord NH

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Jul 01, 2004 4:40 am     Reply with quote

Do yourself a favor and switch to the MCP2515.
valemike
Guest







hello
PostPosted: Thu Jul 01, 2004 12:54 pm     Reply with quote

Don't use the MCP2510! use the MCP2515. The 2510 is being obsoleted i think.
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