- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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".
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
4. Your schematic looks something like below:
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
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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".
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
4. Your schematic looks something like below:
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
Bragadeesh