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 support@ccsinfo.com

PIC18FXX8 CANbus conflict

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



Joined: 07 Jan 2004
Posts: 11
Location: Philadelphia, USA

View user's profile Send private message Visit poster's website

PIC18FXX8 CANbus conflict
PostPosted: Mon Mar 15, 2004 1:35 pm     Reply with quote

I have been working with the PIC18F258, and have encountered intermittent "noise" on the CAN bus which I think is caused by the PIC.

I find out about this from my PC utility program "PCANView USB" which goes "BUSHEAVY" and "BUSOFF" occasionally. Simultaneously, the PIC TXERR and RXERR counters go crazy- count up and down indicating that there is a problem with my physical layer- the signals are not clean and messages are received with many errors.

For a while I didn't know what caused this. But now I have demonstrated that writing to other pins on portB at high frequency causes this problem. For example, executing output_low(PIN_B0) at 10Khz causes noise on the CAN bus. This happens even with FAST_IO, so I don't think it has anything to do with the TRIS registers. And it happens even when the pin's output level is not changed- it is only necessary to write the same thing over and over again, and my CANbus is disabled. At 500 Hz, there is only a little noise detected in the RXERR and TXERR counters. But at 10Khz or 20 KHz, my CAN adapter repeatedly goes BUSOFF. This happens when writing to B0, B1, B4, B5, B6, B7, but not portA or portC.

Anybody else experience the same thing, or have any ideas for what I'm doing wrong or workarounds?

Thanks

DGI.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 15, 2004 2:20 pm     Reply with quote

We're using 18F458 on two different boards, and we have
not seen this problem.
On one board, the PIC is running at +5v, so we used the SN65HVD251
driver chip.

On our other board, which runs at +3.3v, we used the SN65HVD231D
driver chip.

I would look closely at grounding, power supply decoupling, etc.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

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

PostPosted: Fri May 26, 2006 6:29 pm     Reply with quote

Folks,

Will +3.3V and +5V nodes interoperate on the same CAN bus? Are there any caveats? The bus is mechanically small and the cables are shielded.

Cheers!
sjbaxter



Joined: 26 Jan 2006
Posts: 141
Location: Cheshire, UK

View user's profile Send private message Visit poster's website

PostPosted: Sat May 27, 2006 11:39 am     Reply with quote

It doesn't matter what supply rail you use for the processor and its peripherals, the CAN bus voltage levels are determined by the tranceiver used. Which is usually between 2 and 3 volts differential between CAN_H and CAN_L.

As long as the tranceivers are of a 'common type' accross the network you will have no problems. By 'common type' I mean low speed, high speed, fault tollerant, etc. See the different specs for 82C250, 82C251, TJA1050, etc.
_________________
Regards,
Simon.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

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

PostPosted: Sat May 27, 2006 1:14 pm     Reply with quote

sjbaxter wrote:
It doesn't matter what supply rail you use for the processor and its peripherals, the CAN bus voltage levels are determined by the tranceiver used. Which is usually between 2 and 3 volts differential between CAN_H and CAN_L.


In my can node I have to use parts that require 3.3V, so I want to have only one +3.3V supply rail and power everything - including the CAN transceiver - from this rail. My node will be talking to other nodes that I have no control over, and I don't know in advance what those nodes are. As far as I understand, a CAN transceiver powered from the 3.3V bus can deliver a 3V differential output, and transceivers with different supply voltages (say, +5V) will be able to receive it.
Did I get it right?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat May 27, 2006 4:33 pm     Reply with quote

T.I. implies that their transceivers can do it.
http://focus.ti.com/docs/prod/folders/print/sn65hvd231.html
If you download the data sheet on the page above, near the end of it
they describe how it's important that +5v and +3.3v drivers be
interoperable. They show waveforms, but they don't ever actually
draw a conclusion and say "Thus, both types of drivers are interoperable".
That annoys me.

They also have a CAN bus demo kit.
http://focus.ti.com/docs/toolsw/folders/print/canbus-demo.html

The kit consists of 3 boards, as shown in this photo.
http://focus.ti.com/graphics/tool/canbus-demo_400.jpg

The block diagram shows two +3.3v drivers and one +5v driver,
all on the same bus.
http://focus.ti.com/graphics/tool/can_bus_blockdiagram_4.jpg

In the list of features, they say that one of the purposes of the
kit is to demonstrate interoperability between the two types of drivers:
Quote:

Features
Interoperability of 5-V and 3.3-V CAN bus transceivers
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