Add interrupt to MISO input of SPI SCB

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
stem_1497646
Level 1
Level 1

I would like to add an interrupt to a MISO input on a SPI SCB.  The external IC pulls down the MISO when data is ready, and I want to generate an interrupt when this happens.  Is it possible to configure a pin to connect both to an interrupt and a SPI SCB MISO line?  When I try to do this in the schematic editor (TopDesign), I get the error "Pin guidance unavailable: Invalid connection for output spi_miso connected to interrupt." 

I am using PSoC6 module CYBLE-416045-02.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi stem_1497646​,

Yes, this is possible. You can't directly connect a pin to the interrupt. Do the following:

1.  In SPI configurator, navigate to Pins tab and enable "Show SPI terminals".

pastedImage_1.png

2. Connect the digital input pin to MISO terminal. In the MISO pin configurator,

a) Set drive mode as resistive pull up in general tab.

b) Set Interrupt type as Falling Edge in Input tab

3. Drag and drop a Global signal component (interrupt component is already connected to it). In the Global Signal configurator, choose Global Signal name as Port Interrupt x (PICU), according to the port of the chosen MISO pin.

pastedImage_2.png

4. Your schematic looks something like below:

pastedImage_3.png

5. Configure the interrupt in firmware and enable the interrupt

    Cy_SysInt_Init(&MISOInt_cfg,MISO_InterruptHandler);

    NVIC_EnableIRQ((IRQn_Type) MISOInt_cfg.intrSrc);

6. Write the interrupt handler:

void MISO_InterruptHandler()

{

    if(Cy_GPIO_GetInterruptStatusMasked(MISO_PORT,MISO_NUM))

    {

        /*Data is available*/

        dataReady = 1;

        /*Clear the interrupt*/

        Cy_GPIO_ClearInterrupt(MISO_PORT,MISO_NUM);

        NVIC_ClearPendingIRQ((IRQn_Type) MISOInt_cfg.intrSrc);

    }

}

7. I've attached a sample project showcasing the same.

Please let us know if you need further help.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi stem_1497646​,

Yes, this is possible. You can't directly connect a pin to the interrupt. Do the following:

1.  In SPI configurator, navigate to Pins tab and enable "Show SPI terminals".

pastedImage_1.png

2. Connect the digital input pin to MISO terminal. In the MISO pin configurator,

a) Set drive mode as resistive pull up in general tab.

b) Set Interrupt type as Falling Edge in Input tab

3. Drag and drop a Global signal component (interrupt component is already connected to it). In the Global Signal configurator, choose Global Signal name as Port Interrupt x (PICU), according to the port of the chosen MISO pin.

pastedImage_2.png

4. Your schematic looks something like below:

pastedImage_3.png

5. Configure the interrupt in firmware and enable the interrupt

    Cy_SysInt_Init(&MISOInt_cfg,MISO_InterruptHandler);

    NVIC_EnableIRQ((IRQn_Type) MISOInt_cfg.intrSrc);

6. Write the interrupt handler:

void MISO_InterruptHandler()

{

    if(Cy_GPIO_GetInterruptStatusMasked(MISO_PORT,MISO_NUM))

    {

        /*Data is available*/

        dataReady = 1;

        /*Clear the interrupt*/

        Cy_GPIO_ClearInterrupt(MISO_PORT,MISO_NUM);

        NVIC_ClearPendingIRQ((IRQn_Type) MISOInt_cfg.intrSrc);

    }

}

7. I've attached a sample project showcasing the same.

Please let us know if you need further help.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes