cancel
Showing results for 
Search instead for 
Did you mean: 

Can Bus, sending and receiving does not work

csminus
Associate II
Posted on June 15, 2015 at 21:25

ghhhhhhhhhhhhk

#lmgtfy #can-bus #stm32f207 #can-prescale-and-quanta
42 REPLIES 42
csminus
Associate II
Posted on June 17, 2015 at 14:20

fghfhgdhfhdhfh

Posted on June 17, 2015 at 17:21

Like I said, I've posted complete examples

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);

GPIO_PinAFConfig(GPIOD, GPIO_PinSource11, GPIO_AF_CAN1);
GPIO_PinAFConfig(GPIOD, GPIO_PinSource12, GPIO_AF_CAN1);

Not GPIOD
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
csminus
Associate II
Posted on June 18, 2015 at 11:31

sory i changed to GPIOA but still not working, could you give me a link to sime of your post with some stm32f2 example
jpeacock
Associate III
Posted on June 18, 2015 at 14:21

I'm not sure how you got the BS1, BS2 and prescale figures.  For an STM32F2 the PCLK1 clock is 120MHz/4 or 30MHz (APB1).  For CAN time quanta I use

CAN_SJW_1tq

CAN_BS1_6tq

CAN_BS2_8tq

For a 250Kbit/sec data rate I calculate the prescaler as:

clock = 120000000 / (1 + 6 + 8) = 8000000  (CAN clock ticks, sum of quanta)

prescale = clock / rate = 8000000 / 250000 = 32

Also, for now enable the ABOM and NART flags for automatic bus management and retries.

Your prescale works out to about 3.3MHz, much too fast for the CAN bus.

  Jack Peacock
csminus
Associate II
Posted on June 18, 2015 at 15:04

ok i set prescaler to 64 and i enable ABOM and NART, i have something in CAN, ESR not 0 like before. But still dont work eh

csminus
Associate II
Posted on June 18, 2015 at 15:33

I made all like in stm32f4, becouse and still not works, when i back home i will show all code

csminus
Associate II
Posted on June 18, 2015 at 15:36

kljlkjljkklj

jpeacock
Associate III
Posted on June 18, 2015 at 19:44

jpeacock
Associate III
Posted on June 18, 2015 at 19:48

Are both nodes configured the same way, and is the ESR the same for both nodes?

Have you checked the CAN transceivers on both sides to make sure a signal is present?

  Jack Peacock