CAN header and EXT asm question


+ Reply to Thread
Results 1 to 14 of 14

Hybrid View

  1. #1


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: CAN header and EXT asm question

    Interface board with SPI controlled MCP 2515 and line driver to use with non CAN enabled PIC's
    https://www.aliexpress.com/item/1005006850683509.html

    Line driver to use with CAN enabled PIC's.
    https://www.aliexpress.com/item/1005006209071522.html

    You get the idea.. Cheap as chips..

    My YT channel has a lot of PIC CAN tinkering stuff. @retepsnikrep
    On Insightcentral.net and the CRZforum.com is tons of stuff from over the years.
    Last edited by retepsnikrep; - 5th May 2025 at 08:36.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: CAN header and EXT asm question

    Earlier CAN MITM prototypes.

    One using 16F1825 at 32mhz and one using 18F26K80 at 64mhz.

    It was possible to drive one of those serial data to RCA video gadgets as well.
    This made a nice little very cheap dash mounted text display for info and debugging.

    Name:  20517_145651.jpg
Views: 1247
Size:  809.1 KB

    Name:  20519_173310.jpg
Views: 1426
Size:  770.0 KB

  3. #3


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: CAN header and EXT asm question

    Watch out for the slew rate control bit in PICS.
    It defaults to on in the PIC18F26K80!

    This screwed me for hours as the SPI just kept falling over above 1mhz.
    Not enough drive power for the circuit capacitance etc.

    Once I found the SLRCON register and cleared it the SPI bus would run happily at 10mhz with the PIC overclocked to 80mhz.
    In the end I dropped back to 8mhz and 64mhz for the bus and pic respectively.

    IIRC 10mhz SPI is the maximum for the MCP2515 running with an 8mhz crystal.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: CAN header and EXT asm question

    Anyone got anything else to add/share please??
    I bared my feeble CAN soul, now it's your turn.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: CAN header and EXT asm question

    Very useful info that are posted in this thread, but I am afraid that CAN topic is not very popular!

    Thanks anyway for your kindness to share your experience.

    Ioannis

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: CAN header and EXT asm question

    I played with the MCP25625 (CAN controler and driver) using the SPI peripheral on the 18F57Q53 a while back (just looked, turns out it's 4 years ago now, bloody hell...).
    My intention was to make a "universal" driver for it and it looks like I did get most of the way but then lost interest it (which is what usually happens) since I didn't really had a need and/or use for it at the time.

    You could
    Code:
    #DEFINE CAN_OSCILLATOR 20
    #DEFINE CAN_BITRATE 125000
    And it would automatically set the CNF1-3 registers (to reasonable values) based on bitrate and oscillator speed. Low level read/write/modify register routines, medium level Load_Tx_Buffer & Read_Rx_Buffer routines and higher level like GetCANMessage seems to have been implemented. I need an actual project to finish it.

Similar Threads

  1. A header wizard
    By cncmachineguy in forum PBP Wish List
    Replies: 229
    Last Post: - 24th February 2011, 04:21
  2. ASM question
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th February 2011, 17:37
  3. Question about using ASM interupt with PBP
    By cncmachineguy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 4th December 2010, 18:04
  4. ASM question
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 23rd March 2010, 00:33
  5. question about how to implement ASM and ENDASM
    By karenhornby in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th March 2008, 09:21

Members who have read this thread : 20

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts