Hello All, I m using MCBSTR9 keil board and i want to test my CAN port, though in loopback mode, i've checked it. But i want to communicate between PC and CAN. I dont have any other CAN controller to set up a small network. Will it be possible to communicate between PC and CAN without any other CAN controller. Is their any way to simulate CAN....What are the basic things that i need to form a CAN network. I am thankful to one who can help me out...
Thank you for your inputs.... One more thing. Forget the hardware, Can i implement a demo application in C language which can give an overview that how CAN protocol works...Is their any source code available...I mean i'll not use CAN controller and port but i simply want to show in my application that this is how CAN works.... If you have any idea of source code availability, please share it with me.... Thanx....
You may check in the datasheet what loopback or self test modes the specific CAN controller in the STR9 has.
If you can get the CAN controller to accept its own messages, then you can write a full CAN implementation and demonstrate.
If not, then it doesn't give much - you may be better off to just produce some overhead diagrams describing how CAN works. Alas, very boring.
There are a lot of sample CAN code available. I can't looked at any STR9 code, since I am using NXP chips, but there really must be a lot of code to be found by a quick google. Have you checked the example code you get with the Keil tools?
Hi !!! Yes i did, i make some changes in it and it is working fine in loopback+silent mode. But the issue rite now is that i have to implement CAN protocol in an application. I just have to present the whole idea in coded form. This code will have nothing to do with the hardware or registers of CAN controller. Though i can implement the whole protocol, but it'll take lots of time, bcoz i hav to do it from scratch. That's why i am looking for a sample program. Though i know that nobody would have done it, because its not so useful. What i want to do is like explaining CAN protocol using demo application code so as to prove that i have idea of CAN communication.
Its like i'll form 4 nodes and each having 32 message objects. I'll try to make communication between these 4 nodes using the CAN packet format and the way CAN protocol works, its just like a demonstration of CAN protocol communication......... Though i may have confused you a lot :-) But still i am expecting that you may have got my point.... I think i will have to write code from scratch only.. But still if you have some idea or knowledge to make the way easier, then i'd be thankful.....
If you want to demonstrate, without the hardware, you can use normal networking and broadcast messages with similar contents.
Then you can have a graphical front-end that either picks up the IDs that it likes and extracts relevant info to show. Or the front-end could have input fields where you specify variable values and send repeat times and other computers (or other programs on the same machine) will then display the transmitted value.
Ask your teacher in what form he wants you to show your CAN knowledge, or ask him for a second board, so that you can connect
PC1 [rs232] <-> [rs232] BOARD1 [can] <-> [can] BOARD2 [rs232] <-> PC2
and have two PC commuicate using CAN.