CAN24

FirewingUser.CAN24 History

Hide minor edits - Show changes to output

Changed line 1 from:
CAN BUS library module for Firewing R2/PIC24 device based on Microchip application notes AN1249 and code examples CE227, CE228 and CE229 to be referenced.
to:
CAN BUS library module for Firewing R2 / PIC 24HJ128GP502 device based on Microchip application notes AN1249 and code examples CE227, CE228 and CE229 to be referenced.
Deleted line 15:
#option _Firewing =false
Changed lines 4-6 from:
Attach:CAN-FW1.jpg| Firewing PIC24 CAN Adapter
to:
!!Firewing PIC24 CAN Adapter

Attach:
CAN-FW1.jpg
Added line 2:
You must use a transciever with 3V levels as the MCP2562 that still requires the main voltage of 5V.
Changed line 5 from:
Library can be found here : [Attach:Wiki-FW-CAN24.zip| PIC24 CAN Library]
to:
Library can be found here : [[Attach:Wiki-FW-CAN24.zip| PIC24 CAN Library]]
Changed line 5 from:
Library can be found here : Attach:Wiki-FW-CAN24.zip| PIC24 CAN Library
to:
Library can be found here : [Attach:Wiki-FW-CAN24.zip| PIC24 CAN Library]
Changed line 5 from:
Library can be found here : Wiki-FW-CAN24.zip| PIC24 CAN Library
to:
Library can be found here : Attach:Wiki-FW-CAN24.zip| PIC24 CAN Library
Changed lines 5-7 from:
Library can be found here :Attach:file.ext | link text
to:
Library can be found here : Wiki-FW-CAN24.zip| PIC24 CAN Library

Download the compressed folder and with Firewing IDE open dragged it on editor window, will create a folder named CAN24 in your \MCU16 UserLibrary
Added lines 4-5:

Library can be found here :Attach:file.ext | link text
Changed line 48 from:
   CANSetRxAcptMask    (2,strtomask("S1?"),1,1)                 // Mask/Accept all SIDs
to:
   CANSetRxAcptMask    (2,strtomask("S1?"),1,1)   
Changed lines 3-4 from:
Attach:CAN-FW.jpg| Firewing PIC24 CAN Adapter
Attach:file.ext | link text
to:
Attach:CAN-FW1.jpg| Firewing PIC24 CAN Adapter

!!Library test program:

=firewing [=
clock = 80
#option _Firewing =false
imports "can24-lib"
imports "can24-utils"

sub OnStart() handles OnStartup
  console.setbaudrate(Baudrate.Is38400)
end sub

sub OnMessage(ID as uinteger,
              byref Data() as byte,
              Len as byte,
              Frame as byte,
              BuffN as byte) handles OnCANMessage
  console.write("** INCOMING NORMAL MESSAGE **",13,10)         
  console.write("Id    :",hex(id,8), 13,10) 
  console.write("Data  :")
  for i as byte = 0 to (len - 1)
      console.write(hex(data(i),2))
      if i<>(Len-1) then         
        console.write(",") 
      end if
  next                                 
  console.write(13,10)
  console.write("Frame  :",hex(Frame,2), 13,10) 
  console.write("BuffN  :",hex(BuffN,2), 13,10) 
end sub

sub OnRtrMessage(ID as uinteger,
                Frame as byte,
                BuffN as byte) handles OnCANRtrMessage
  console.write("** INCOMING RTR MESSAGE **",13,10)         
  console.write("Id    :",hex(id,8), 13,10) 
  console.write("Frame  :",hex(Frame,2), 13,10) 
  console.write("BuffN  :",hex(BuffN,2), 13,10) 
end sub



Sub Main()
  CANSetRxAcptMask    (2,strtomask("S1?"),1,1)                  // Mask/Accept all SIDs
  CANSetRxAcptFilter  (1,StrToCanID("S1"),1,1,2)
  CANStart()
 
  dim TestMsg(8) as byte
  TestMsg(0) = 7
  TestMsg(1) = 6
  TestMsg(2) = 5
  TestMsg(3) = 4
  TestMsg(4) = 3
  TestMsg(5) = 2
  TestMsg(6) = 1
  TestMsg(7) = 0

 
  while true         
      CANSendMsg(StrToCanID("X02"),TestMsg,8) 
      delayms(10000)
      console.write("## CAN RX DISABLED ##",13,10)
      CANStop()
      delayms(10000)
      console.write("## CAN RX ENABLED ##",13,10)
      CANStart()     
  end while

End Sub
=]
Added line 4:
Attach:file.ext | link text
Changed line 3 from:
Attach:file.ext | link text
to:
Attach:CAN-FW.jpg| Firewing PIC24 CAN Adapter
Changed lines 3-6 from:
Attach:CAN-FW.jpg| Firewing PIC24 CAN Adapter

Attach:file.ext | link text

to:
Attach:file.ext | link text
Added lines 4-5:

Attach:file.ext | link text
Changed lines 3-5 from:
Attach:| Firewing PIC24 CAN Adapter

Attach:file.ext | link text
to:
Attach:CAN-FW.jpg| Firewing PIC24 CAN Adapter
Changed lines 3-5 from:
Attach:| Firewing PIC24 CAN Adapter
to:
Attach:| Firewing PIC24 CAN Adapter

Attach:file.ext | link text
Changed line 3 from:
Attach:CAN-FW.jpg | Firewing PIC24 CAN Adapter
to:
Attach:| Firewing PIC24 CAN Adapter
Changed line 3 from:
CAN-FW.jpg | Firewing PIC24 CAN Adapter
to:
Attach:CAN-FW.jpg | Firewing PIC24 CAN Adapter
Changed line 3 from:
Attach:file.ext | link text
to:
CAN-FW.jpg | Firewing PIC24 CAN Adapter
Added lines 1-3:
CAN BUS library module for Firewing R2/PIC24 device based on Microchip application notes AN1249 and code examples CE227, CE228 and CE229 to be referenced.

Attach:file.ext | link text