-
Notifications
You must be signed in to change notification settings - Fork 30
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
Acan2515 bitrate problem #41
Comments
Hello,
Strange, can you post the code ?
… Le 15 mars 2023 à 15:59, Algosistaken ***@***.***> a écrit :
Hello.
I am working on mcp2515 with this library. But when i try to send can massage at 16mhz quartz frequency it reduces the bitrate with half of i try to send. If i sen at 1 mbps it sends messages at 500kbps. Also with 10 MHz quartz frequency i saw that when i try to send message with 1 MHz it sends it with 800kbps. While 8 MHz frequency is running, I can send my messages with exactly the bitrate I want. What I want is to reach 1 mbps speed. 8 mhz frequency doesn't support it either. I couldn't solve this problem, can you help me? Sorry for my bad english.
—
Reply to this email directly, view it on GitHub <#41>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEWKZVBGCDJABXQT5MFLC7DW4HKNXANCNFSM6AAAAAAV36QNSY>.
You are receiving this because you are subscribed to this thread.
|
`void setup () { void loop () { |
Sorry for miss click on close button. I use your example loopback code and changed it with normal mode and i tried to send some frames. But when i try to use this code i get 62.5 kBps bitrate in oscilloscope. Also i can read the frames with Kvaser in 62.5 kBps only. I am using arduino due. May be it can be because of Due. |
Ok, what is your microcontroller and how do you define the QUARTZ_FREQUENCY constant ?
… Le 17 mars 2023 à 21:20, Algosistaken ***@***.***> a écrit :
Sorry for miss click on close button. I use your example loopback code and changed it with normal mode and i tried to send some frames. But when i try to use this code i get 62.5 kBps bitrate in oscillator. Also i can read the frames with Kvaser in 62.5 kBps only. I am using arduino due. May be it can be because of Due.
—
Reply to this email directly, view it on GitHub <#41 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEWKZVBYRWTRMF3GKARHVTDW4TBPXANCNFSM6AAAAAAV36QNSY>.
You are receiving this because you commented.
|
I am using Arduino Due and it has Atmel SAM3X8E ARM Cortex-M3 on it. I defined exactly same in the loopback example. static const uint32_t QUARTZ_FREQUENCY = 16UL * 1000UL * 1000UL ; // 16 MHz I tried different frequencies and got different bitrates. |
Ok, the QUARTZ_FREQUENCY definition is ok.
The MCP2515 is powered under 3.3V ?
… Le 17 mars 2023 à 22:18, Algosistaken ***@***.***> a écrit :
I am using Arduino Due and it has Atmel SAM3X8E ARM Cortex-M3 on it. I defined exactly same in the loopback example.
static const uint32_t QUARTZ_FREQUENCY = 16UL * 1000UL * 1000UL ; // 16 MHz
I tried different frequencies and got different bitrates.
—
Reply to this email directly, view it on GitHub <#41 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEWKZVEETGTYDUOQGCQQAL3W4TIK3ANCNFSM6AAAAAAV36QNSY>.
You are receiving this because you commented.
|
And what is the result of the print instructions ?
… Serial.print ("Bit Rate prescaler: ") ;
Serial.println (settings.mBitRatePrescaler) ;
Serial.print ("Propagation Segment: ") ;
Serial.println (settings.mPropagationSegment) ;
Serial.print ("Phase segment 1: ") ;
Serial.println (settings.mPhaseSegment1) ;
Serial.print ("Phase segment 2: ") ;
Serial.println (settings.mPhaseSegment2) ;
Serial.print ("SJW: ") ;
Serial.println (settings.mSJW) ;
Serial.print ("Triple Sampling: ") ;
Serial.println (settings.mTripleSampling ? "yes" : "no") ;
Serial.print ("Actual bit rate: ") ;
Serial.print (settings.actualBitRate ()) ;
Serial.println (" bit/s") ;
Serial.print ("Exact bit rate ? ") ;
Serial.println (settings.exactBitRate () ? "yes" : "no") ;
Serial.print ("Sample point: ") ;
Serial.print (settings.samplePointFromBitStart ()) ;
Serial.println ("%") ;
Le 17 mars 2023 à 22:18, Algosistaken ***@***.***> a écrit :
I am using Arduino Due and it has Atmel SAM3X8E ARM Cortex-M3 on it. I defined exactly same in the loopback example.
static const uint32_t QUARTZ_FREQUENCY = 16UL * 1000UL * 1000UL ; // 16 MHz
I tried different frequencies and got different bitrates.
—
Reply to this email directly, view it on GitHub <#41 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEWKZVEETGTYDUOQGCQQAL3W4TIK3ANCNFSM6AAAAAAV36QNSY>.
You are receiving this because you commented.
|
Yes I use 3.3V. Bit Rate prescaler: 4 This results are for 125kbps but my measurements are 62.5kbps |
Ok for 3.3V power supply.
The bit settings are ok :
actual_bit_rate * (PS + PS1 + PS2 + 1) * bit_rate_prescaler * 2 = quartz_frequency
125 000 * (5 + 5 + 5 + 1) * 4 * 2 = 16 000 000
62.5kbps is just the half of 125kbps.
I think it is an hardware problem. Are you sure that the quartz frequency is 16 MHz ? Can you check the frquency at pin #8 of the MCP2515 ?
… Le 21 mars 2023 à 07:27, Algosistaken ***@***.***> a écrit :
Yes I use 3.3V.
Print results are:
Bit Rate prescaler: 4
Propagation Segment: 5
Phase Segment 1: 5
Phase Segment 2: 5
SJW:4
Triple Sampling: yes
Actual Bit Rate: 125000
Exact bit rate ? yes
Sample point: 62%
This results are for 125kbps but my measurements are 62.5kbps
—
Reply to this email directly, view it on GitHub <#41 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEWKZVAEXKQPYOPLGT6I3PTW5FC4NANCNFSM6AAAAAAV36QNSY>.
You are receiving this because you commented.
|
I don't think it is a hardware problem. I have 2 MCP2515 modules, and both of them are the same. I tried using another library with Arduino Due, but it didn't work. However, when I used an Arduino Mega, it worked. Therefore, I think the issue may be related to the Arduino Due. |
Ok, but I have no Arduino Due, I am sorry, but I can't help you.
… Le 26 mars 2023 à 10:10, Algosistaken ***@***.***> a écrit :
I don't think it is a hardware problem. I have 2 MCP2515 modules, and both of them are the same. I tried using another library with Arduino Due, but it didn't work. However, when I used an Arduino Mega, it worked. Therefore, I think the issue may be related to the Arduino Due.
—
Reply to this email directly, view it on GitHub <#41 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEWKZVBIFKC4JWO44SZOU2TW572YJANCNFSM6AAAAAAV36QNSY>.
You are receiving this because you commented.
|
Ok, thanks anyway. If I find anything i will post here. |
Hello.
I am working on mcp2515 with this library. But when i try to send can massage at 16mhz quartz frequency it reduces the bitrate with half of i try to send. If i sen at 1 mbps it sends messages at 500kbps. Also with 10 MHz quartz frequency i saw that when i try to send message with 1 MHz it sends it with 800kbps. While 8 MHz frequency is running, I can send my messages with exactly the bitrate I want. What I want is to reach 1 mbps speed. 8 mhz frequency doesn't support it either. I couldn't solve this problem, can you help me? Sorry for my bad english.
The text was updated successfully, but these errors were encountered: