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

Added timings support for FCLK=42MHz #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Makefile*


test.dbc
src/driver/PeakCanDriver/*
Binary file modified bin/cangaroo.zip
Binary file not shown.
53 changes: 50 additions & 3 deletions src/driver/CandleApiDriver/CandleApiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CandleApiInterface::CandleApiInterface(CandleApiDriver *driver, candle_handle ha
_settings.setBitrate(500000);
_settings.setSamplePoint(0.875);

// Timings for FCLK = 48 MHz
_timings
// sample point: 50.0%
<< CandleApiTiming(48000000, 10000, 500, 300, 6, 8)
Expand Down Expand Up @@ -63,22 +64,68 @@ CandleApiInterface::CandleApiInterface(CandleApiDriver *driver, candle_handle ha
<< CandleApiTiming(48000000, 800000, 867, 4, 11, 2)
<< CandleApiTiming(48000000, 1000000, 875, 3, 12, 2);

// Timings for FCLK = 42 MHz
_timings
// sample point: 50.0%
<< CandleApiTiming(42000000, 10000, 500, 300, 5, 7)
<< CandleApiTiming(42000000, 20000, 500, 150, 5, 7)
<< CandleApiTiming(42000000, 50000, 500, 60, 5, 7)
<< CandleApiTiming(42000000, 83333, 500, 63, 2, 4)
<< CandleApiTiming(42000000, 100000, 500, 30, 5, 7)
<< CandleApiTiming(42000000, 125000, 500, 21, 6, 8)
<< CandleApiTiming(42000000, 250000, 500, 12, 5, 7)
<< CandleApiTiming(42000000, 500000, 500, 6, 5, 7)
<< CandleApiTiming(42000000, 1000000, 500, 3, 5, 7)

// sample point: 62.5%
<< CandleApiTiming(42000000, 10000, 625, 280, 7, 6)
<< CandleApiTiming(42000000, 20000, 625, 140, 7, 6)
<< CandleApiTiming(42000000, 50000, 625, 56, 7, 6)
<< CandleApiTiming(42000000, 83333, 625, 36, 7, 5)
<< CandleApiTiming(42000000, 100000, 625, 28, 7, 6)
<< CandleApiTiming(42000000, 125000, 625, 21, 8, 6)
<< CandleApiTiming(42000000, 250000, 625, 12, 7, 5)
<< CandleApiTiming(42000000, 500000, 625, 6, 7, 5)
<< CandleApiTiming(42000000, 1000000, 625, 3, 7, 5)

// sample point: 75.0%
<< CandleApiTiming(42000000, 10000, 750, 200, 14, 5)
<< CandleApiTiming(42000000, 20000, 750, 100, 14, 5)
<< CandleApiTiming(42000000, 50000, 750, 40, 14, 5)
<< CandleApiTiming(42000000, 83333, 750, 24, 14, 5)
<< CandleApiTiming(42000000, 100000, 750, 20, 14, 5)
<< CandleApiTiming(42000000, 125000, 750, 21, 10, 4)
<< CandleApiTiming(42000000, 250000, 750, 12, 9, 3)
<< CandleApiTiming(42000000, 500000, 750, 6, 9, 3)
<< CandleApiTiming(42000000, 1000000, 750, 3, 9, 3)

// sample point: 87.5%
<< CandleApiTiming(42000000, 10000, 875, 280, 11, 2)
<< CandleApiTiming(42000000, 20000, 875, 140, 11, 2)
<< CandleApiTiming(42000000, 50000, 875, 56, 11, 2)
<< CandleApiTiming(42000000, 83333, 875, 36, 10, 2)
<< CandleApiTiming(42000000, 100000, 875, 28, 11, 2)
<< CandleApiTiming(42000000, 125000, 875, 21, 12, 2)
<< CandleApiTiming(42000000, 250000, 875, 12, 10, 2)
<< CandleApiTiming(42000000, 500000, 875, 6, 10, 2)
<< CandleApiTiming(42000000, 1000000, 875, 3, 10, 2);

// Timings for FCLK = 16 MHz
_timings
// sample point: 50.0%
<< CandleApiTiming(16000000, 10000, 520, 64, 11, 12)
<< CandleApiTiming(16000000, 10000, 520,100, 6, 8)
<< CandleApiTiming(16000000, 20000, 500, 50, 6, 8)
<< CandleApiTiming(16000000, 50000, 500, 20, 6, 8)
<< CandleApiTiming(16000000, 83333, 500, 12, 6, 8)
<< CandleApiTiming(16000000, 100000, 500, 10, 6, 8)
<< CandleApiTiming(16000000, 125000, 500, 8, 6, 8)
<< CandleApiTiming(16000000, 250000, 500, 4, 6, 8)
<< CandleApiTiming(16000000, 500000, 500, 2, 6, 8)
<< CandleApiTiming(16000000, 800000, 500, 1, 8, 10)
<< CandleApiTiming(16000000, 800000, 500, 2, 3, 5)
<< CandleApiTiming(16000000, 1000000, 500, 1, 6, 8)

// sample point: 62.5%
<< CandleApiTiming(16000000, 10000, 625, 64, 14, 9)
<< CandleApiTiming(16000000, 10000, 625,100, 8, 6)
<< CandleApiTiming(16000000, 20000, 625, 50, 8, 6)
<< CandleApiTiming(16000000, 50000, 625, 20, 8, 6)
<< CandleApiTiming(16000000, 83333, 625, 12, 8, 6)
Expand Down