- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-20-2012 04:48 PM
Hello!
First of all, I would like to say I am beginner in FPGA. I have made simple VGA and PCI controller on Spartan 3 FPGA so far, that's basically all my experience.
However, I would like to make CAN BUS sniffer in FPGA. I would only like to see the messages passing on the bus, no other advanced functions. I was thinking about connection CAN transceiver to the FPGA board and then to send the decoded messages to PC via UART.
Now - since I am beginner - can somebody evaulate how difficult would this project be? Could somebody share any tip?
Thanks!
Re: Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-21-2012 01:10 PM
Anyone?
Re: Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-21-2012 10:08 PM
It is not clear what question you would like answered.
You have said that you have already "made" a VGA controller and a PCI controller.
What parts of your planned design do you think will pose problems for you?
I am guessing that a small fraction of FPGA designers (and user forum correspondents) are familiar with CAN bus protocol and interfaces on a detailed level. If you can be more specific with your request, you may be more likely to receive a useful reply.
-- Bob Elkind
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369
Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Re: Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-22-2012 02:58 AM
The interface is slow by current standards, but the wide selection of protocols could make the design of a 'universal' sniffer quite time-consuming.
------------------------------------------
"If it don't work in simulation, it won't work on the board."
Re: Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-22-2012 05:58 AM
Hi!
I would like to connect CAN transciever (for example: http://www.maxim-ic.com/datasheet/index.mvp/id/429
First of all - is this even possible - am I thinking right?
Then - as far as I know, the FPGA board (mine is Spartan 3E from Digilent: http://www.digilentinc.com/Products/Detail.cfm?Nav
Next thing - since I don't have knowledge in analog electronics ... is there any analog component needed to connect CAN transciever and CAN controller to the FPGA board, or is it enought just to use wires? Can I use clock from FPGA to drive the CAN controller?
Bus speeds - since CAN is faster than UART, will I have problems following packets in real time on CAN network?
Thank you very much for your answers in advance!
Re: Building CAN BUS sniffer on Spartan FPGA
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-22-2012 09:05 AM - edited 03-22-2012 09:09 AM
Quick impressions:
1. The CAN Transceiver looks like a good enough choice.
2. I wouldn't bother with a CAN Controller, as all you want is a non-transmitting monitor/sniffer.
3. You will probably need a software element to decode the protocol, for example a MicroBlaze, using XPS/EDK/whatever. Doing it all in HDL would be possible, but probably really hard. The MB SystemBuilder will allow you add a UART. Sheet 2 of the board schematics shows a RS232 transceiver.
4. You will need to dig around for the analogue circuitry, or hope sombody else bothers to help you out. HOWEVER, it would help a lot if you were to state what sort of equipment you need to monitor.
5. What might help is: http://www.can232.com/ Or would that be cheating?
------------------------------------------
"If it don't work in simulation, it won't work on the board."
Re: Building CAN BUS sniffer on Spartan FPGA
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-22-2012 10:36 AM - edited 03-22-2012 10:53 AM
Hi!
First of all, thanks for your answers!
1) About CAN controller - Yes, I will not be transmitting any data on CAN bus, I only need to "sniff" what on CAN bus is going on ...
Does this mean I can only use CAN transciever? My biggest concern is - what kind of data is the output of the CAN transciever (on rx and tx lines)?
2) About protocol decoding. I was thinking that the hardware part would only be sending raw information (e.g. zeros and ones) over UART to the PC. I would handle protocol decoding with software (my own).
3) Yes, can232 would definately be cheating. ;) The whole point of this project is to build the sniffer on my own ... I know the "already working ones" are cheap to buy.
4) I would like to monitor CAN bus on automotive systems. Practically, I would like to connect my sniffer to OBD port on a car and record the data on the bus.
Re: Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-22-2012 04:04 PM
jcerna1 wrote:
Hello!
First of all, I would like to say I am beginner in FPGA. I have made simple VGA and PCI controller on Spartan 3 FPGA so far, that's basically all my experience.
However, I would like to make CAN BUS sniffer in FPGA. I would only like to see the messages passing on the bus, no other advanced functions. I was thinking about connection CAN transceiver to the FPGA board and then to send the decoded messages to PC via UART.
Now - since I am beginner - can somebody evaulate how difficult would this project be? Could somebody share any tip?
Thanks!
FWIW, if I had to build a CAN bus sniffer, I'd use a microcontroller with a built-in CAN bus interface.
----------------------------------------------------------------
Yes, I do this for a living.
Re: Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-23-2012 04:20 PM
Could you be more specific why? What part would FPGA play in this case?
Re: Building CAN BUS sniffer on Spartan FPGA
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-25-2012 09:11 PM
jcerna1 wrote:
Could you be more specific why? What part would FPGA play in this case?
To whom are you replying?
----------------------------------------------------------------
Yes, I do this for a living.











