CANbus


Results 1 to 24 of 24

Thread: CANbus

Threaded View

  1. #14
    Join Date
    Apr 2009
    Posts
    15

    Default

    Well, I've connected the board to a PC using a CANUSB adapter listening at 100Kbps, but does not receive anything. This is the code (18F258+MCP2510 20Mhz):

    Code:
    define OSC 20
    
    TRISB = %000001000 'portb.2 output, portb.3 input
    CANCON = $80 'configuration mode 
    'Set Data Rate based on 20Mhz to get 100 kbs:
    BRGCON1 = $04 
    BRGCON2 = $BF 
    BRGCON3 = $02 
    
    CIOCON = $10
    TXB0SIDH = $0 
    TXB0SIDL = $1 
    CANCON = $0 'normal mode 
    
    '
    ' Program
    '
    Main: 
            TXB0DLC = 8 
            TXB0D0 = 65
            TXB0D1 = 66
            TXB0D2 = 67
            TXB0D3 = 68
            TXB0D4 = 69
            TXB0D5 = 70
            TXB0D6 = 71
            TXB0D7 = 72
            TXB0CON = 8
        pause 1000
    Goto main
    End
    What's wrong?
    Last edited by zx81sp; - 21st February 2010 at 17:27.

Similar Threads

  1. canbus
    By nono2002 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 1st January 2014, 20:35
  2. Canbus
    By Tobias in forum Off Topic
    Replies: 0
    Last Post: - 22nd September 2008, 23:54
  3. Using the 18F2480 CAN CANBUS
    By bwarb in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th August 2005, 13:45
  4. CANbus
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2005, 15:43

Members who have read this thread : 0

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