1 / 74

Controller Area Network (CAN)

Controller Area Network (CAN). Lecture 5.1. Reference. S12MSCANV2.pdf. MSCAN Block Guide V02.14. PIM_9C32 Block Diagram. CAN module. PCA82C250 / 251 CAN Transceiver. Bit time =2500ns. 0.4 Mbps. 3m. =2(15ns + 150ns) = 330ns. 4MHz. 2. 250ns. 2500/250 = 10. 330/250 = 2. 2. 10.

Download Presentation

Controller Area Network (CAN)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Controller Area Network(CAN) Lecture 5.1

  2. Reference S12MSCANV2.pdf MSCAN Block Guide V02.14

  3. PIM_9C32 Block Diagram CAN module

  4. PCA82C250 / 251 CAN Transceiver

  5. Bit time =2500ns 0.4 Mbps 3m =2(15ns + 150ns) = 330ns

  6. 4MHz 2 250ns 2500/250 = 10 330/250 = 2 2 10 7 so PROP_SEG = 3, PHASE_SEG1 = 3 and PHASE_SEG2 = 3 RJW = 3

  7. 3 20x10 = 0.015 3 2(127) = 0.0118 2 10 3 3 3 3 1.18%

  8. $141 BSET CANCTL1,#$80 ;turn on CAN

  9. $141 ;place CAN in init mode CAN_INI BSET CANCTL0,#$01 BRCLR CANCTL1,#$01,CAN_INI

  10. $140

  11. $141 ;Bus clock, listen off LDAA #$C0 STAA CANCLT1

  12. $141

  13. $140

  14. $140 ;CSWAI,WUPE,TIME,SLPRQ off BCLR CANCTL0,#$2E

  15. $140 ;CSWAI,WUPE,TIME,SLPRQ off BCLR CANCTL0,#$2E

  16. 1 3 + 3 = 6 3

  17. $142 1 0

  18. $142 1 0 0 0 0 0 0 1 MOVB #$81,CANBTR0 Prescale = 2

  19. $143

  20. $143 0 0 1 0 TSEG2 = 3 0 1 0 3 Tq clock cycles

  21. 0 0 1 0 0 1 0 1 $143 TSEG1 = 6 0 1 0 1 6 Tq clock cycles MOVB #$25,CANBTR1

  22. ID = 127 ID = 1 IDR0 = $00 IDR1 = $18 IDR2 = $00 IDR3 = $02 IDR0 = $00 IDR1 = $18 IDR2 = $00 IDR3 = $FE

  23. $150 $151 $152 $153

  24. $158 $159 $15A $15B

  25. $154 $155 $156 $157

  26. $15C $15D $15E $15F

  27. $14B MOVB #$00,CANIDAC

  28. ID = 127 $FFFF0001 $FFFF0001 $001800FE

  29. ID = 1 $FFFF0001 $FFFF0001 $00180002

  30. ;Acceptance & Mask registers MOVW #$0018,CAN0IDA0 ; ID = $0018 MOVW #$00FE,CAN0IDA2 ; ID = $00FE MOVW #$FFFF,CAN0IDM0 ; filter = $FFFF MOVW #$0001,CAN0IDM2 ; filter = $0001 MOVW #$0018,CAN0IDA4 ; ID = $0018 MOVW #$0002,CAN0IDA6 ; ID = $0002 MOVW #$FFFF,CAN0IDM4 ; filter = $FFFF MOVW #$0001,CAN0IDM6 ; filter = $0001

  31. EXIT CAN INIT MODE $140 BCLR CANCTL0,#$01

  32. $140 ;wait for sync SYNC BRCLR CANCTL0,#$10,SYNC

  33. LDAB DLR ANDB #$0F

More Related