STM32F04 CAN init
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-09 10:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-09 11:51 AM
CAN_InitStructure.CAN_Prescaler = 299; //This is BRP reg - can be between 1 and 1024...BRP = what is in reg + 1 (1 starts at 0)
This isn't the BRP register, the SPL subtracts ONE, you don't do it here. If you're dividing the APB clock by 300, use 300Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-10 4:58 AM
Do you have two CAN nodes? Loopback will work with one node but otherwise you need two in order for transmit to work properly. A single node will see transmit errors and stop. Look at your transmit error count.
Jack Peacock- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-10 5:49 AM
Are you using a STM32F042Fx or STM32F042Gx device? If so you need to remap PA11/12 instead of pin pair PA9/10 using the SYSCFG_CFGR1 register. Page 174 of the reference manual (RM0091).
Do you have terminators on the bus?I have some code that has the CAN module correctly working at 125Kbit/s on a STM32F042K device, but it's all in assembler.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-11 8:23 AM
