CAN problem with GPIO pin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2010-05-12 5:10 AM
CAN problem with GPIO pin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:50 AM
if another mcu sends a package, then I can not initialize CAN to these GPIO pins (
CAN_Init() returns CANINITFAILED
) ... why??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:50 AM
I am not sure which version of Firmware library you are using.
Use version V3.1.0 with old version there was already some problem in CANInit code. Just make sure you have right prescaler and other setting for right baud rate and also add speed 50Mhz for both CAN Tx and Rx pins. (GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:50 AM
add speed 50Mhz for both CAN Tx and Rx pins. (GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz)
You don't need to specify the 50MHz speed to an INPUT pin, it controls the drive current/slew rate of OUTPUT pins.
Up 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
‎2011-05-17 4:50 AM
I use Firmware lib 3.3.0
Rx pindoes not need
speed 50Mhzbaudrate is set correctly on
500kbps (PCLK1=36MHz, TQ=18, br=4)
initialization is successful if I
assign to the other pins that are not connected to the CAN bus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:50 AM
if doing so
CAN_Init (CAN1, & CAN_InitStructure); // return ОК
GPIO_PinRemapConfig (GPIO_Remap1_CAN1, ENABLE); //
place after
CAN_Init
But I have form error ...
I think that
to quit the initialization CAN controller must be synchronized with the bus, but since the pins are not remap and synchronization does not occur...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:50 AM
Problem solved!
core frequency configured not correctly , because I use quartz for 8 MHz (default is 25 MHz)
Thanks!
