Please solve the problem regarding CAN on MC9S12DP256

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Please solve the problem regarding CAN on MC9S12DP256

3,129 Views
saurav99
Contributor I
Hai Sir,
            I am facing a problem in CAN on MC9S12DP256.what my exact problem is that i am getting transmission timed out error when i am trying to transfer data form one DP256 board to another DP256 board .what might be cause for it the problem might be because of jumper settings or what can you please suggest me.I am trying to transfer data form one board to another in that i am able to store data in the tranmit buffer and i wanted to tranmit it and when i wanted to transmit it is showing tranmission timed out error and at the reciever side it is showing receiver buffer empty so the data has not come other side what might be the problem because code wise eevry thing correct i suppose any jumper settings problem in DP256 board or what might cause this problem please sugest me.waiting for help.
 
#define OSCCLK_FREQ_KHZ           16000      // Oscillator fequency in kHz
#define BUSCLK_FREQ_KHZ             8000       // Bus fequency in kHz
 
I am using this as my clock frequencies can you please suggest what might be the problem
 
thanks in advance,
 
bye
saurav99
 
Labels (1)
0 Kudos
Reply
7 Replies

1,149 Views
Lundin
Senior Contributor IV
Are you getting any CAN traffic on the bus? Is it terminated in both ends?
0 Kudos
Reply

1,148 Views
saurav99
Contributor I
hai sir,
           Thank you for your reply .I am not getting any CAN traffic on the bus.I terminated on both ends by 120 ohm resistance while connecting CAN transceivers. is it problem with jumper settings or what or else any other porblem can you suggest.Its some thing strange because code wise no problem almost but its not getting executed what might be the problem [I suppose problem might be with jumper settings or what please suggest ]
 
waiting for your reply.
 
thanks in advance,
 
Bye,
saurav99
0 Kudos
Reply

1,149 Views
Lundin
Senior Contributor IV
If it would be jumper settings, you would at least detect some traffic comming out from the CPU, to the tranceiver. If you aren't getting that, something is probably wrong in the program.

Did you disable "loopback mode" in MSCAN?
Did you set the MODRR register correctly?

Did you init the MSCAN like this?
- Set CANE (write-once register).
- Put MSCAN in init/sleep mode.
- Set CLKSRC, filters etc.
- Leave init/sleep mode.
- Wait for SLPAK and INITAK.

The above order shouldn't be critical in a peer-to-peer app, but it is the way Freescale recommends.
0 Kudos
Reply

1,149 Views
saurav99
Contributor I
Hai sir,
           Thank you for your reply I have done all those things correctly but then also it is getting the error timed out i am able to see the data in CAN transmit buffer and able to perform loop back test also correctly but when it comes to CAN reception in another board it is showing receiver buffer empty on the other side and transmission timed out in this side so what might be problem.
 
thanks in advance,
 
Bye,
saurav99.
0 Kudos
Reply

1,149 Views
Lundin
Senior Contributor IV
Have you put an oscilloscope probe on the tranceiver pins? Either the CAN traffic is leaving the MCU = tranceiver problem, or it isn't = software/MCU problem. In case of the latter, please post code.
0 Kudos
Reply

1,149 Views
saurav99
Contributor I
Hai sir,
            Thank you for yur oreply its great of you and great help from you can you once tell me the jumper settings for the DP256 board for CAN to work so that i will make a last attempt on this today, if not tomorrow i will get back to you with my problem in detailed with other things also so pelase say the jumper settings for the baord for CAN to work .
 
Thanking you sir,
 
Bye,
saurav99
0 Kudos
Reply

1,149 Views
Lundin
Senior Contributor IV
If you look at the schematic you received with the board, there are no jumpers related to the CAN bus, assuming we are talking about the "barracuda-board" MCS12DP256EBV released by Motorola.

Buy yourself an oscilloscope before you start developing any kind of digital electronics.
0 Kudos
Reply