Skip to main content
Visitor II
June 17, 2024
Question

MCP2515 in Interrupt mode using STM32WL

  • June 17, 2024
  • 2 replies
  • 7031 views

Hi all,

I'm using MCP2515 for a CAN application in the NUCLEO STM32WL board. I've managed to get it to work in pulling mode, however, I want to use interrupt mode. 

For what I looked, I just have to enable the MCP interrupt pin in EXTI mode in cubeMX, but the MCP interrupt pin that I set (PA0) is already set as the BUT1 pin (on board button). I didn't change the configurations, only set in the callback to activate if occurs the rising edge of BUT1_Pin (tried with falling edge too).

It didn't work, but I don't know if I have to configure something more, or the fact that the pin is shared with the button changes something and it could be the problem.

Any insights will be helpfull.

    This topic has been closed for replies.

    2 replies

    Graduate II
    June 17, 2024

    And how is the Button wired? Pull-up to VCC, button pressed to GND ?

    Not sure the MCP2515 uses an open-collector output, or can be configured from a driver, level or pulse sense. Sure the Data Sheet would elucidate.

    Use EXTI0

    Use a scope and confirm behaviour and expectations

    FPicc.1Author
    Visitor II
    June 17, 2024

    Here's the schematic of BUT1 pin. I'm not sure if the PA0 bypasses this connection, or if would only work if the button is pressed

    FPicc1_0-1718642006634.png

     

    Graduate II
    June 17, 2024

    Ok, so NUCLEO-WL55JC(1) board

    You could remove the solder-bridge (SB16) or link, or move to PC13 (SB15) if nothing else conflicts, and use the EXTI15_9

    That would free PA0 for your own, personal use, on the MORPHO connection/headers

    Graduate II
    June 27, 2024

    Ad per datasheet the int pin can be configured for different purposes.  Are you using any breakout,  then check the jumpers.  I  guess it needs pullups 

    FPicc.1Author
    Visitor II
    June 27, 2024

    Also don't know, here's the schematic on the board (consider PA0 as PB14 (CAN_INT_Pin))

    FPicc1_0-1719455665702.png

     

    Graduate II
    June 27, 2024

    So either enable pullups for the stm32 pin or connect pullups.  Datasheet is your best friend for the register programming.  Good luck