Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

IRQ

Posted by jvogel65 on October 2, 2017

I have the NXP TWR-K22F120M board that I am working with to see how FreeRTOS works. I would like to setup Sw1 and SW3 they are both on PORTC. How would I write code to have an interrupt triggered if either one of these switches is pressed. I have looked at code which has SW2 wake up on interrupt but when trying to duplicate the code for SW1 I recieve an error that PORTC is being redefined.


IRQ

Posted by rtel on October 2, 2017

I don't think this is a FreeRTOS question, but a hardware question. Do Freescale provide drivers for the inputs? Or even board level drivers? It would be unusual for drivers that do things like set pins as inputs, and set them up to generate interrupts, etc., not to be provided.


IRQ

Posted by jvogel65 on October 3, 2017

I believe that this is a freeRTOS question becauase I would like to configure RTOS to interrupt the application when either Switch 1 or 3 is pressed. Both of these switches are on PORTC and I am not sure how to configure PORTC interrupt to use both of these items and how I know which switch was pressed causing the interrupt.


IRQ

Posted by hs2sf on October 3, 2017

As you said you have to configure PORTC hardware that the switches generate PORTC interrupts as desired (edge vs. level triggered, etc.). Then in the associated ISR you have to implement (and add to your exception vector table) you need to handle PORTC_ISFR register accordingly to detect (and clear) the individual PORTC pin interrupt(s). FreeRTOS related stuff/code might start inside your ISR e.g. concerning signalling a FreeRTOS task about the switches pressed etc. So it's not really a FreeRTOS question ;)


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS