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

PIC18F2480 - CAN

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







PIC18F2480 - CAN
PostPosted: Tue Jul 12, 2005 2:47 pm     Reply with quote

Hi! Im using a PIC18F2480 and I'm having trouble getting data. Data can be sent, data can be received, but the data being received is not getting stored in the register buffers. There is data coming in through CANRX but nothing is still getting stored into the receive buffers. I've tried the EX_CAN. C example code and still nothing is showing up through the RX lines of the pic. What should I do??

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jul 12, 2005 3:35 pm     Reply with quote

What device are you using to talk to your PIC board ?

The CCS driver uses Extended IDs. Is your other CAN bus
device configured to use Extended IDs ? It should be.

Also, the CCS driver can-18xxx8.c expects the PIC to be
running at 20 MHz. CCS initializes the baud rate generator
to run at 125 kbps. Your other CAN bus device must also
be set to run at 125 kbps.
Guest








PostPosted: Tue Jul 12, 2005 5:47 pm     Reply with quote

The device we are using to talk to our PIC board is called ValueCAN. We use this program called Vehicle Spy.

Yes, our other CAN bus device is configured to use Extended IDs.

Yes, our baud rates are equal.

We checked the registers 0xFA4.1, RXB0CON, RXB1CON in mode 0. What can we do?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jul 12, 2005 9:08 pm     Reply with quote

I have a few comments:

1. You're testing the ValueCAN hardware and the VehicleSpy software.
You don't really know if those things work properly or if you're using them
properly. That's because you don't have a "known-good" CAN node to
talk to. You only have the PIC board, which may not work.

The VehicleSpy software is intended to check on CAN bus
data in an automobile. Does it really allow you to send any CAN
message that you want ? Does it allow you to specify Extended IDs ?
You have an "evaluation" version. Is that version completely functional ?
Does it allow you to send CAN messages ?

The ValueCAN product is intended for "snooping" on automobiles.
They don't sell it as a learning product for a micro-controller CAN bus.
How do you really know if it works for your purpose ?

I used the Microchip MCP2510 development board and the Kvaser
CANking software when I was learning about the CAN bus. Even so,
it still took some time to figure out all the problems.

2. Next, you're testing the 18F2480 with the CCS CAN driver.
It's supposed to work, but how do we know it does for sure ? I think it
would be better if you got a 18F458 and ran it at 20 MHz with the CCS
driver.

3. On your PIC board, are you using a CAN bus driver chip with a
120 ohm terminator resistor, as shown on the following web page ?
http://www.linear.com/pc/productDetail.do?navId=H0,C1,C1007,C1127,P2298
arlene
Guest







CAN
PostPosted: Wed Jul 13, 2005 10:41 am     Reply with quote

Hi thanks for you help.
Yes the Vehicle Spy Software does allow us to send any CAN
message that we want. It also allows us to use extended ids.

Yes we have a 120 Ohm terminator resistor

We can assure that it's working for our purpose because when we probe CANRX on PIC18F2480 we can see data coming in. Right now we're checking what receieve buffers CAN data is suppose to go into. Any suggestions? I don't know if it's the PIC or the code.

Thanks
Guest








Re: CAN
PostPosted: Thu Jul 14, 2005 2:42 pm     Reply with quote

arlene wrote:
Hi thanks for you help.
We can assure that it's working for our purpose because when we probe CANRX on PIC18F2480 we can see data coming in. Right now we're checking what receieve buffers CAN data is suppose to go into. Any suggestions? I don't know if it's the PIC or the code.


Are you sure your filters aren't rejecting the message? Try setting your filters up to receive everything. Also, are you checking BOTH receive buffers?

-Ted
arlene
Guest







PIC18F2480-CAN
PostPosted: Thu Jul 14, 2005 4:42 pm     Reply with quote

hey Ted,
Thanks for your help. Yes we set up our filters to receive everything. We're having trouble distinguishing which receive buffers to check. Do you have any suggestions on which receive buffers to look into for the PIC18F2480?

Thanks.
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