View previous topic :: View next topic |
Author |
Message |
wzmat
Joined: 23 Jun 2005 Posts: 4
|
Can Bus Help! |
Posted: Thu Jun 23, 2005 7:17 pm |
|
|
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
|
|
Posted: Thu Jun 23, 2005 7:33 pm |
|
|
What CAN bus driver chip are you using ?
I have used MCP2551 on a 5v board, and SN65HVD631 on a 3.3v board. |
|
|
Guest
|
|
Posted: Thu Jun 23, 2005 8:24 pm |
|
|
I'm using CF151. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jun 23, 2005 11:16 pm |
|
|
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
|
|
Posted: Fri Jun 24, 2005 11:12 am |
|
|
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 ,
Do you have any idea about this problem?
Thanks again and sorry for my poor English. |
|
|
wzmat
Joined: 23 Jun 2005 Posts: 4
|
|
Posted: Fri Jun 24, 2005 12:15 pm |
|
|
I updated PCan's driver, and it works correctly now.
PCM Programmer, thanks again. |
|
|
|