Post History
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 sufficien...
#2: Post edited
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 :)
#1: Initial revision
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 :)