View previous topic :: View next topic |
Author |
Message |
z.sh
Joined: 27 May 2013 Posts: 4
|
problem with can bus pic18f458 |
Posted: Mon May 27, 2013 4:02 am |
|
|
I'm new in CAN, and I'm writing codes for pic18f458 that made a simple can bus with two nodes.
one of the micros is in normal mode and always is sending data to the bus, and the other one is in listen only mode and should accept any data with any ID,
but at the start of the communication a bus error occurs and the data couldn't be sent,
can you help me with this problem?? |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Mon May 27, 2013 10:41 am |
|
|
show your code and compiler version at least
i'm no mind reader dude
have you looked at EX_CAN.c ?? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon May 27, 2013 1:12 pm |
|
|
Read this thread. It has a link to a CAN bus test program for two boards.
It also has links to schematics that show how to connect the 18F458 PICs
to the MCP2551 CAN bus drivers, and how to connect the termination
resistors. This thread has links to everything you need to do your test:
http://www.ccsinfo.com/forum/viewtopic.php?t=47545
All of this is for real hardware boards. It's not for Proteus. |
|
|
z.sh
Joined: 27 May 2013 Posts: 4
|
re |
Posted: Tue May 28, 2013 12:18 am |
|
|
Hi, asmboy and PCM programmer
I am using the Mikroc for writing my codes, if I write them here, can you help me? I have asked the same question in Mikroelectronika's forum but I haven't gotten any answer yet, so I had to ask here!
sorry and thanks for your help
Last edited by z.sh on Tue May 28, 2013 1:08 am; edited 1 time in total |
|
|
z.sh
Joined: 27 May 2013 Posts: 4
|
re: PCM programmer |
Posted: Tue May 28, 2013 12:32 am |
|
|
PCM programmer:
Thanks for these information they were very useful,
but I used them in my test circuit, I have written test codes for two nodes in mikroc and it worked well and 2 micro controllers can send data to each other through the CAN bus
I have this problem in listen only mode, can you show me some example codes for listen only mode?? (in any language or compiler) |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue May 28, 2013 10:27 am |
|
|
We can't support MikroC on this forum. I haven't done a Listen-Only
CAN bus project. My best advice is to Google for it. Use this search
string with Google:
Quote: | site:microchip.com/forums "Listen only" |
|
|
|
z.sh
Joined: 27 May 2013 Posts: 4
|
re: PCM programmer |
Posted: Tue May 28, 2013 11:25 pm |
|
|
I have searched a lot on google but nothing useful found!
By the way, thanks for reply.
Best Regards |
|
|
|