2019-11-27 07:16 AM
I'm using an STM32F105R8T6 and Cube. I've searched and searched and can NOT find any actual documentation on the CAN interface. Yes, there are a couple words in the STM32F105 datasheet, and a brief mention in the Cube's getting started doc. But there should be a doc somewhere that outlines all the hardware registers and how to use them. I've searched for "CAN" title in all the technical literature at https://www.st.com/en/microcontrollers-microprocessors.html#resource, to no avail.
I'm astounded at how difficult it is to find any hardware doc. Is there any?
Note my question du jour is whether or not I can run the two CAN interfaces at different clocks, and if so, what registers are involved. Well, this is probably about timers and not the CAN itself, but I find no doc on what timers/clocks the CAN uses...
Thanks in advance for your help.
2019-11-27 08:03 AM
What you need is the reference manual: https://www.st.com/resource/en/reference_manual/cd00171190.pdf
The CAN interfaces generally use the same APB bus clock, but each have their own prescaler and bit segment configuration registers, so you can CAN on two different bus baudrates.
2019-11-27 08:12 AM
The Reference Manual covers the registers, it is not a simple peripheral and uses Third Party IP from Synopsys so may be other common driver implementations.
I found the RM and example to be adequate.
As Ben mentions the prescaler and bit quanta timing are unique to each unit. The ST implementation is 1.5x CAN, the CAN2 uses a lot of the resources of the CAN1 logic, so CAN1 must clock.
2019-11-27 08:42 AM
Thanks to both Ben and Clive. I will need to do some reading over the upcoming holiday.
Clive, when you say "so CAN1 must clock", are you contradicting Ben's statement that "you can CAN on two different bus baudrates", or are you simply adding additional info that does not contradict?
Ben, If you two mind, please see https://community.st.com/s/question/0D50X0000Bh52L2SQI/trying-to-get-can2-working also. I see that Clive has already posted.
Humor: Clive, would you rather I address you as Clive, Avi, Avogadro, 6E23, User 6.02214076×10²³ or THX1138? (It's hard to type 6.022...) I like either Avi (obtuse) or 6E23. (You already revealed "Clive" elsewhere, but maybe you don't want it promulgated.)
2019-11-27 08:56 AM
Clive is fine, the website leaks like a sieve, so much for GDPR
The User name is a response to the stupid User157... default naming. The normal name for this account is Clive Two.Zero, and the other account is Clive One (nee Clive1)
I just usually respond without naming users/people as the flow of the forum usually makes it reasonably clear whom and what I'm responding too.
Two things can be true at the same time..
The CAN1/2 are on the same APB, so derive frequency from the same source, CAN2 is like 50% of the required logic, the APB clock for CAN1 needs to be enabled for CAN2 to function properly. Each then has it's own divider chain, and bit timing settings. So CAN1 can be 500kbps and CAN2 at 125kbps on the wire, while the APB is 36 MHz for the F1 as I recall.