This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL2-570LC43: gioNotification(), bit = 0x00000000

Part Number: LAUNCHXL2-570LC43
Other Parts Discussed in Thread: HALCOGEN

Tool/software:

Hello.

Apologies as I am new to microcontrollers.

I am trying to enable interrupts on gioPORTB pin0 on my LAUNCHXL2-570LC43 dev board. I am expecting a an interrupt from a LoRa module that I am interfacing with. This is my gioNotification() code:

// DIO0 interrupt callback
void gioNotification(gioPORT_t *port, uint32 bit) {


     printf("Interrupt triggered:\n");
     printf(" Port address: 0x%08X\n", (unsigned int)port);
     printf(" Bitmask: 0x%08X\n", bit);

     if (port == DIO0_PORT && bit == (1U << DIO0_PIN)) { //Check that you are receiving an interrupt on the right port and pin
     txDone = true;
     printf("Interrupt received: TxDone\n");
      }


     gioREG->FLG = (1U<<DIO0_PIN);

}

This is my console output:

The fact that there is a print out tells me that the mcu is recognizing the input, and I have observed it on the scope as well. 
What could be causing the bitmask to be 0x00000000? I believe I should expect it to be 0x00000001, but I am a bit unsure how the bitmask could be all 0s. What could this indicate?

This is my HALCoGen setup:




  • Hi Chan,

    That is not bit mask value that is bit number. I mean it gives you the direct bit number. For example if you enable PA0 interrupt your bit number will become 0 only, similarly for PA2 it will become 2.

    For example, you can verify below code here i enabled 4 GIO interrupts PB2, PA0, PA6 and PA7. And you can see how i can be able to distinguish them in handler code.

    And also note that if we use PB2 and PA2 at the same time then bit value will be same (i.e. 2) for both, in those cases we can distinguish them using port address like as i shown in above picture.

    --

    Thanks & regards,
    Jagadish.