|
|
View previous topic :: View next topic |
Author |
Message |
Martinez_pt
Joined: 26 Sep 2008 Posts: 11
|
|
|
Martinez_pt
Joined: 26 Sep 2008 Posts: 11
|
|
Posted: Tue Oct 28, 2008 9:06 pm |
|
|
Ok, it works perfectly!!!
With the two files on the post above you will get the following output, that is what i understand you wanted.
OUTPUT:
Code: | Rede CAN
Rede criada e iniciada...
Enviado 1: ID=24 LEN=8 PRI=3 EXT=1 RTR=0
DADOS = 08 08 08 08 08 08 08 08
Recebido: BUFF=0 ID=25 LEN=8 OVF=0 FILT=0 RTR=0 EXT=1 INV=0
DADOS = 09 09 09 09 09 09 09 09
Enviado 1: ID=24 LEN=8 PRI=3 EXT=1 RTR=0
DADOS = 08 08 08 08 08 08 08 08
Recebido: BUFF=0 ID=25 LEN=8 OVF=0 FILT=0 RTR=0 EXT=1 INV=0
DADOS = 09 09 09 09 09 09 09 09
Enviado 1: ID=24 LEN=8 PRI=3 EXT=1 RTR=0
DADOS = 08 08 08 08 08 08 08 08
Recebido: BUFF=0 ID=25 LEN=8 OVF=0 FILT=0 RTR=0 EXT=1 INV=0
DADOS = 09 09 09 09 09 09 09 09 |
The node A with ID 24, send eight (8) through the bus to node B. Then, node B with ID 25, add "1" to the 8 and send it back through the bus to node A so we get nines (9) on serail port of PC.
One thing, i saw you had changed the pin's of RS232 RX and TX conection, have you also chaged the pin's of CAN (RX and TX)?
If you have done it, you have to take care with the port you will use because other port's unless the B may not have internal pullups that are necessary to get the state of RX MCP 2551 Pin. I read on another post that for TX pin MCP 2551 has already a pullup resistor on that pin.
Any way i advisory you to use the original pin's just to make the CAN work, after that you make your own modifications.
I hope i had managed to help you.
Best regards
Nuno
Last edited by Martinez_pt on Fri Oct 31, 2008 12:08 am; edited 1 time in total |
|
|
ambrojohn
Joined: 27 Apr 2008 Posts: 18
|
|
Posted: Wed Oct 29, 2008 3:06 am |
|
|
Martinez_pt wrote: | Ok, it works perfectly!!!
|
Yes, that is what I meant.
Quote: |
One thing, i saw you had changed the pin's of RS232 RX and TX conection,
|
Do you mean in my example code on the first page? Yes but it works perfectly.
Quote: |
have you also chaged the pin's of CAN (RX and TX)?
|
I don't think it is possible...
Actually, I picture them switched on the PIC side in the hw scheme, but my hardware it's ok (CANTX with TXD and CANRX with RXD)
Quote: |
Any way i advisory you to use the original pin's just to make the CAN work, after that you make your own modifications.
|
But I yet use the original pins for CAN communication: pin 23 and pin 24 of the PIC16F2580 (I could not do otherwise)
Regards |
|
|
shashank27187
Joined: 28 Jul 2009 Posts: 13
|
|
Posted: Thu Aug 06, 2009 2:38 am |
|
|
could you pls tell me whether i need can-18f2580.c for implementing can using pic 18f2585..
as i am using can-18f4580.c as the can driver file in my program, but i have'nt got results for the same... |
|
|
|
|
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
|