CAN with PIC Microcontroller - MCP2515 module

Status
Not open for further replies.

desgin

Full Member level 1
Joined
Apr 7, 2017
Messages
96
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
813
Hello All,

I working on CAN Project where my requirement is to give demo of CAN Protocol.
I done lots of research but no result at end :-(
I am using PIC Microcontroller for Master and Slave.

I want the system like; If i give input from Master - My slave should give me Output.
Here i am using Finger print for the authentication.
I am using MCP2515 module which has inbuilt CAN.
But i don't know how system will work ? and how i should start my coding ? Please help me out.
I am so much in worried.

Thanks in advance.
desgin
 

The MCP2515 uses an SPI interface to talk with the MCU.
I am a bit confused as to what you are actually trying to achieve here. Is it something like:
Code:
Master MCU <--> MCP2515 <--> (CAN protocol) <--> MCP2515 <--> Slave MCU
If so then where does the fingerprint reference come in? If the fingerprint device uses CAN then that would (presumably) replace the MCP2515 and the slave MCU i the above outline and still achieve a demo of how to write a program that talks to a CAN device.
Susan
 
Reactions: desgin

    desgin

    Points: 2
    Helpful Answer Positive Rating

Thanks for the reply.
Its actually,
[ Input of Finger Print (Module) ] --> Master MCU <--> MCP2515_1 <--> TJA1050_1 ( H & L ) <--> TJA1050_2 (H & L ) <--> MCP2515_2 <--> Slave MCU --> [ Output of Finger Print ]

I hope now you understand, what exactly i want in my project.
Thanks in Advance

Thank You
Desgin
 

Hi,

I recommend to go step by step:

Start with the hardware: TJA1050 -- cables -- TJA1050
* first you need the knowledge about how to build the hardware. Which cables to choose, what connections are mandatory...And so on.
* then build your test circuit for this.
* use a logic signal input and a scope to check the output signal. In both directions.
Check timing, signal levels

Klaus
 
Reactions: desgin

    desgin

    Points: 2
    Helpful Answer Positive Rating
Microchip seems to offer ready-to-use MCP2515 software support only for PIC32 family. Some porting required.
 
Reactions: desgin

    desgin

    Points: 2
    Helpful Answer Positive Rating

Ya that's fine.
I Checked SPI Protocol, it worked perfectly between 2 PIC Microcontroller because MCU_1 and MCU_2 both has to be connected with MCP2515.
MCP2515 works on SPI.

SO now my query is how can i start work with MCU_1 and (MCP2515 - TJA1050) CAN Module ?
How can i see the data on this module and so on ?

Thank you
Desgin

- - - Updated - - -

Microchip seems to offer ready-to-use MCP2515 software support only for PIC32 family. Some porting required.

So you mean to say MCP2515 with TJA1050 Module will no work with PIC18 Series of MCU ?

Thanks in advance
Desgin
 

Hi,

Ya that's fine.
I Checked SPI Protocol, it worked perfectly between 2 PIC Microcontroller because MCU_1 and MCU_2 both has to be connected with MCP2515.
MCP2515 works on SPI.
This was not my recommendation.

SO now my query is how can i start work with MCU_1 and (MCP2515 - TJA1050) CAN Module ?
How can i see the data on this module and so on ?
Divide it in clear steps.
first verify proper SPI connection. Try to read some known values from the MPC2515.
If it doesn't work like expected, then
* show your code
* describe what you want to achieve
* describe what you expect
* describe what you get instead
* show scope pictures with the 4 SPI signals

Klaus
 
Reactions: desgin

    desgin

    Points: 2
    Helpful Answer Positive Rating
The first point is about understanding the MCP2515 register model, required basic setup, flow for message transmission and reception.

You can either write the PIC18 code from scratch, or try to modify existing sources, e.g. the PIC32 examples.
 
Reactions: desgin

    desgin

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…