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

CAN simulator ?

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







CAN simulator ?
PostPosted: Sun Mar 12, 2006 10:47 am     Reply with quote

Hi !
Is there outhere maybe some software simulator for CAN or LIN bus, where i can test my code ? I know that there are some tools like CANanalyzer or CANking but non of them can load , let's say, HEX file and make some simulation....

Is there some tool for such task ?
sjbaxter



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

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

PostPosted: Sun Mar 12, 2006 4:47 pm     Reply with quote

What do you mean by 'simulation' ? Is this a network simulation or just something that will send a known number of messages with 'dummy' data.

If is the first case, then you need some big software package and hardware like Vectors CANoe (big £££$$$'s). If you just want to see messages from your PIC and send messages to test your PICs message handling and processing then CANking (free) hooked upto the Microchip CAN development board will do this.

You can setup CANKing to 'play' history files, which are pre defined collection of messages.

I started using CANKing but ended up making my own PIC/FTDI based CAN-USB interface and windows application to extend this functionality. Unfortunatly, this is forming the basis of a future commercial product, so I can't give you much help on going down this route (in the way of code), but it is not beyond the intermediate/advanced programmer. If you need any help on programming and configuring PICs to use CAN, just ask and I'll try and help.
_________________
Regards,
Simon.
Jartinez
Guest







CAN problem
PostPosted: Tue Nov 21, 2006 4:42 am     Reply with quote

Hi,

I have a CAN project based on PIC18F248 and MCP2551 transceiver. I am programming it with CCS compiler. I have tested the CAN_EX.c example, but it doesn“t works fine (it is supposed that it has to send a CAN message each two seconds but sometimes it sends every 4 seconds).
And, with the oscilloscope, I can see a CAN high level of only 2 volts.

Could you tell me what kind of PIC and transceiver did you use?.

Thank you in advance.

Kind regards
sjbaxter



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

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

PostPosted: Tue Nov 21, 2006 5:53 am     Reply with quote

I use a Philips PCA82C250 transceiver in all my projects but in general it shouldn't matter what transceiver you use. If you are having problems with messages being sent or recieved at the wrong intervals, I suggest you put the CAN controller (PIC) into LOOPBACK mode and get your code working first.

There are examples on the forum and in the datasheet which explain how to do this.

In LOOPBACK mode you can take the hardware out of the equation and prove that the code does what it is supposed to do. Once that is working, put the controller in NORMAL mode and add another node to the network that can receive and acknowlege the messages you send (Ideally this should be something that you can use for debugging (ie. CAN to USB interface or CAN dev board that can display messages on a PC).

If, when in NORMAL mode, things stop working, then you can work on those problems individually. They are usually either:

1) Nodes are running at different bit rates.
2) Network terminatuion is incorrect.
3) TX line from PIC to transceiver has no pull-up and is floating causing random transmissions on the bus.

All the above are easy to check. For more info, you'll find plenty of threads on the forum explaining how to fix all of these potential problems.
_________________
Regards,
Simon.
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