Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Review Suggested Edit

You can't approve or reject suggested edits because you haven't yet earned the Edit Posts ability.

Approved.
This suggested edit was approved and applied to the post almost 4 years ago by 2kind‭.

0 / 255
CAN Bus - Internal Oscillator
Every time I needed CAN, I had just put external crystal and didn't think about it after that. It worked fine.

I am wondering however whether the precisions of MCU internal oscillator is sufficient for up to 1Mbit/s and could I perhaps prove that on paper.


# Internal Clock Specification
![Datasheet snippet Crystal](https://electrical.codidact.com/uploads/vaAxb45pdR8B9EusTUXaPRsr)

# PLL Specification
![PLL](https://electrical.codidact.com/uploads/22knKPFVRQW7jFS6D7NENicq)

The desired frequency at the PLL's output should be 48 MHz. 

I've read the above-given data that the internal clock before going to the PLL could be anywhere between 7.848 and 8.184 MHz. I would ignore the PLL's jitter because it's in the ps range and it shouldn't matter much.

Firstly, am I correct in assuming that the PLL's output should then be anywhere between 47.088 and 49.104 MHz?

CAN Peripheral inside of the MCU is being connected directly to the 48MHz clocked bus and derives the output baud rate based on the value of the PRESCALER register.

If we assume a perfect prescaler then the clock supplying the CAN should be in the range of 981kHz to 1023kHz. Let's say that we want to cover max. frequency of 1MBit/s on the bus, which is 1000ns(in other words, the minimum time between 2 consecutive bits). Due to the error of the internal MCU clock, my period should be anywhere between 977ns and 1019ns which given the eye diagram of the CAN that I've seen shouldn't be a problem.

Is my logic right? Basically every resource I've found online claims "You have CAN! Better by external crystal!"

The calculation above actually has quite a decent margin of error if valid.

What's the catch? Is everyone being paranoid, have I missed something or the manufacturing process of the MCU is not that reliable so I would end up having 70% of devices working and 30% not for a "mysterious" reason :)

Suggested almost 4 years ago by Lundin‭