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 Help!

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



Joined: 23 Jun 2005
Posts: 4

View user's profile Send private message

Can Bus Help!
PostPosted: Thu Jun 23, 2005 7:17 pm     Reply with quote

I'm trying using PIC18F458 to communication with PCAN_USB through CanBus. In LoopBack mode, transmit and receive data are both correct.
But in normal mode, they don't work.

When I just let 458 transmit datas, I measured the TXD pin, it's 5V all time. And Can_H and Can_L are always 2.5V. does it means I didn't transmit datas correctly? I suppose Can_H will be 3.5V and Can_L will be 1.5V when 458 transmit datas. Am I right?

When I just let PCAN_USB transmit datas, I noticed Can_H and Can_L are always 2.5V. So I'm totally confused. Maybe my scope is too slow.

I really appreciate any help. Thanks in advance.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 23, 2005 7:33 pm     Reply with quote

What CAN bus driver chip are you using ?

I have used MCP2551 on a 5v board, and SN65HVD631 on a 3.3v board.
Guest








PostPosted: Thu Jun 23, 2005 8:24 pm     Reply with quote

I'm using CF151.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 23, 2005 11:16 pm     Reply with quote

Look at the schematic shown at the link below. It shows two CAN bus
driver chips connected together. The CAN bus driver is the LT1796,
and it has the same pinout as your CF151 chip. So compare your
circuit to the schematic. It should be the same. You need the 120 ohm
1/2 watt resistors on each end. The schematic doesn't show the pin
number for +5v on the chips. It's pin 3.
http://www.linear.com/pc/productDetail.do?navId=H0,C1,C1007,C1127,P2298
wzmat



Joined: 23 Jun 2005
Posts: 4

View user's profile Send private message

PostPosted: Fri Jun 24, 2005 11:12 am     Reply with quote

PCM programmer,

Thanks for your generous help and instant response.

I added a 1K res between CAN_H and CAN_L because in my company they use 1K res as standard. I don't why they choose this value although most of datasheets of transceiver recommend 120~240 ohme. Because it works, I use 1k As well.

I thought the transceiver was the problem, so I replaceed it today. Now PCan can receive data form 458 only once and become dead. I have to remove PCan from USB port and plug again, PCan will receive data once and is dead again. This is such a wierd problem.

In my 458 problem, I send data evey 2second. I set the BRGCONX as your previous post Embarassed ,

Do you have any idea about this problem?

Thanks again and sorry for my poor English.
wzmat



Joined: 23 Jun 2005
Posts: 4

View user's profile Send private message

PostPosted: Fri Jun 24, 2005 12:15 pm     Reply with quote

I updated PCan's driver, and it works correctly now.
PCM Programmer, 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