Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some changes. #17

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open

Some changes. #17

wants to merge 74 commits into from

Conversation

xboxpro1
Copy link

Add more bus speed settings and change some functions. Add new functions. Bus speed settings are similar to
the Can Bus Libary from Seeed Studio for the MCP2515. See "readme.md" All speed settings are tested and working.
Use function connect() if you dont know the bus speed. If you want another speed, use the Excel sheet.

@Mike4U
Copy link

Mike4U commented Jun 30, 2016

Just want to point out some observations on the can-timing spread sheet:

  1. Where is this from, its similar to CAN_setup1 but gets different results. Maybe I didn't setup everything.
  2. At all baud rates supported in the teachop branch the spreadsheet gets different results for RJW. I haven't tried the results in my 33333 baud Single Wire setup yet.
  3. What is the significance of the red OK> in column A? I noticed it's still there when I put in the RJW values from my 33333 and all teashop's speeds. Does that mean there ok too?

@xboxpro1
Copy link
Author

xboxpro1 commented Jul 1, 2016

Hello,

  1. The Excel sheet CAN_setup1 is not for the MK20DX processor. But it is the same sheet.
    I have modified the calculations consistent with the MK20DX manual. You setup everything
    right.
  2. If you look into the manual https://www.pjrc.com/teensy/K20P64M72SF1RM.pdf Chapter 44
    CAN (FlexCAN) Page 1053 Field RJW Resync Jump Width = RJW + 1. Field PSEG2 Phase Buffer Segment 2 = (PSEG2 + 1)
    Page 1105 Figure 44-67. Segments within the bit time and page 1106 Table 44-80 CAN standard compliant bit time
    segment settings. If you have for example: Time Segment 2 = 4 --> PSEG2 = 3(page 1105 Figure 44-67)
    Time Segment 2 = 4 --> Resync Jump Width = 1 - 4 (page 1106 Table 44-80) --> RJW = Resync Jump Width - 1
    (page 1105 Figure 44-67) so valid RJW value is from 0 to 3!!!
    I have found another pdf "FlexCAN_bit_timing" page 7 STEP 5. the writer has the highest RJW value chosen.
    You are right RJW value for 0 - 3 is correct. I think this is only important for resynchronization.
  3. The red OK> marks the columm when all values are correct. PRESDIV 0 - 255, PSEG1 0 - 7, PSEG2 1 - 7,
    PROPSEG 0 - 7, RJW 0 - 3, and your desired baud rate is correct. So RJW 0 - 3 are correct.(page 1053 - 1056).
    FlexCAN bit timing.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants