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.

Request Identifying the CC2541F256_Chip_Set problem.

Other Parts Discussed in Thread: CC2541

Request Identifying the CC2541F256_Chip_Set problem.

Within the interrupt occurs in PORT1[2], the ISR routine P1IFG_2=1, and P1IFG_3=1 Register  is set at the same time is a problem occurred.

PORT-1 [0:3] are configured as shown in the figure.

As follows: .

STEP1: the SW0 or SW1 Press -> P1IFG_0 = 1 or P1IFG_1 = 1,  Error No (Set = 1).

STEP2 : SW3 Press -> P1IFG_3 = 1, No Error( Set = 1 ).

STEP3 : SW2 Press -> P1IFG_2 = 1 and  P1IFG_3 = 1, Error simultaneous SET (Set = 1).

STEP4: STEP2 + STEP3 repeat, occurring irregularly.

The problem as described above was confirmed SmartRF05EB(Rev1.8.1.2) Board 2 SET, and My Target Board 5 SET.

all The same phenomenon occurs.

STACK : BLE-CC254x-1.3.1 COMPILER : IAR  8.11.1 OS : Windows-7.

SmartRF05EB S/N : 0X35BC, 0x35DF. CC2541EM S/N : 000418, 000419.

----------------------------------------------------------  My ISR Routine. ----------------------------------------------------------

 HAL_ISR_FUNCTION( halKeyPort1Isr, P1INT_VECTOR )
 {
   HAL_DISABLE_INTERRUPTS();
     uint8  nIFG1 = P1IFG;
     uint8   nP1 = P1;
     bool  bIntFlag = false;
     if( nIFG1 & BIT0 )
     {     
          m_KeyIntRepeat |= INT_KEY_CODE_SW1;
          bIntFlag = true;  
     }

 

     if( nIFG1 & BIT1 )
    {
         m_KeyIntRepeat |= INT_KEY_CODE_SW2;
         bIntFlag = true;
    }
    if( nIFG1 & BIT2 )  
    {
          m_KeyIntRepeat |= INT_KEY_CODE_SW3;
          bIntFlag = true;
     }

 

    if( nIFG1 & BIT3 )
    {
        m_KeyIntRepeat |= INT_KEY_CODE_SW4;
        bIntFlag = true;
     }

 

    if( bIntFlag == true )
    {
        osal_start_timerEx( Hal_TaskID, INT_KEY_REPEAT_EVENT, INT_KEY_REPEAT_VALUE );  
    }

 

    P1IFG = 0x00;
    P1IF = 0;
    HAL_ENABLE_INTERRUPTS();
 }
----------------------------------------------------------

 

  • Note that the interrupt occurs at the rising edge.

    Related questions or answers, please khjin347@gmail.com.

     

  • How and where are you initializing the pins for the interrupts?  

    Are you using the KeyFob example code for doing the initializatiom?

  •     //-------------------------------------------------------------------------------------------------

        // Port1[0:3]번 핀을 PUSH BUTTON INPUT 으로 설정.

         // Port1[4:7]번 핀을 출력 으로 설정, [4:7]=SWITCH 4:7 출력, Pin 5 에  설정.

         //-------------------------------------------------------------------------------------------------

         P1SEL = P1SEL | ~(BIT0 | BIT1 | BIT2| BIT3 | BIT4 | BIT5 | BIT6 | BIT7 );

       // PORT-1[4:7] 번 핀에 0을 설정, I/O Port로 설정.    

       P1_4 = 1;                                           // Switch 1 off.

       P1_5 = 1;                                           // Switch 2 off.

       P1_6 = 1;                                           // Switch 3 off.

       P1_7 = 1;                                           // Switch 4 off.

       P1DIR = ~(BIT0 | BIT1 | BIT2 | BIT3 ) | ( BIT4 | BIT5 | BIT6 | BIT7 );  // PORT-1[0:4] 입력, [4:7] 번 핀을 1로 설정, 출력핀 으로 설정.

        //-------------------------------------------------------------------------------------------------    

        // PORT1 의 Input Mode 선택(0 = PullUp/Down Mode, 1 = 3-State).

        //-------------------------------------------------------------------------------------------------

         // MDP1[7:2] = 0; PORT-1[2:7]번 핀을 pullup/pulldown Mode 결정(0 = PullUp/Down Mode, 1 = 3-State).

         P1INP = P1INP | ~(BIT2 | BIT3 | BIT4 | BIT5 | BIT6 | BIT7);               

        //-------------------------------------------------------------------------------------------------

         // PORT0,1,2 의 PullUp/PullDown 모드 선택(0 = PullUp, 1 = PullDown).

         //-------------------------------------------------------------------------------------------------

         // PDUP2[7] = 1; PORT2 Pin PullUp/Down 선택, 0 = PullUp, 1 = PullDown.

         // PDUP1[6] = 0; PORT1 Pin PullUp/Down 선택, 0 = PullUp, 1 = PullDown.

         // PDUP0[5] = 1; PORT0 Pin PullUp/Down 선택, 0 = PullUp, 1 = PullDown.

         // PDUP2[0:4] = 0; PORT-2[0:4]번 번핀의 Input Mode 선택(0= PullUp/Down Mode, 1 = 3-State).

         P2INP = P2INP | ~( BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | BIT5 | BIT6 | BIT7 );

        // PORT1[0:3] Interrupt Mask Bit Enable.

         // PORT1[4:7] Interrupt Mask Bit Disable.

         P1IEN = P1IEN | ( BIT0 | BIT1 | BIT2 | BIT3 ) | ~( BIT4 | BIT5 | BIT6 | BIT7 );

        //==============================================================================================

         // Interrup Edge Control Register Setup.

         //==============================================================================================

         // PADSC[7]   = 1 : 출력 모드에서 I / O 핀 드라이브 강도 제어 할 수 있습니다

         // P2ICON[3]  = 1 : PORT2[0:4], 입력 인터럽트 하강에지 구성(0=상승에지, 1= 하강에지).

         // P1ICONH[2] = 1 : PORT1[4:7], 입력 인터럽트 하강에지 구성(0=상승에지, 1= 하강에지).

         // P1ICONL[1] = 0 : PORT1[0:4], 입력 인터럽트 하강에지 구성(0=상승에지, 1= 하강에지).

         // P0ICON[0]  = 1 : PORT0[0:7], 입력 인터럽트 하강에지 구성(0=상승에지, 1= 하강에지).

         PICTL = ( PADSC | P2ICON | P1ICONH  ) | ~( P1ICONL | P0ICON );

  • It is related to the above, the C Compiler (IAR) Bug likely.

    However, Chip Bug I believe has great potential.

    In order to rule out the possibility of a Bug in my code, I have only PORT-0 ISR routine and main routinie TEST.

    In addition modify some of CC2541_43_44_45_Peripherals_Software_Examples, the test was

    All the same phenomenon occurs.

  • Hello Jin,

    I am still trying to figure out what exactly the problem is you are trying to describe.

    As a general rule, you will never use a button/switch for the input of an interrupt without Debouncing the switch.  This can be done either through hardware (best solution) or software, good solution but slow and uses up resources.  It could be what you are seeing is due to the fact that the contacts are bouncing and the final value you see in IAR is a result of this.

    Put in a debounce routine. You can take it from the hal_keys.c and see if this solves your problem.

    Thanks,

  • Interrupt flag(P1IFG_2 and p1IFG_3)  of the two is set to one switch(P1_2 input, rising-edge, 3.3V Pull-Up) input.

    Because of this,  Inside the ISR routine, Which of the two interrupt flags is the real input can not be judged.

    Not a debounce problem, I was confirmed in the oscilloscope (2Ch).

    I confirm with IAR KOREA support team.

    It allows to provide an image or video if you want to.

    And please note that the interrupt is set in the Rising-edge.

    And, in my case. the hal_key.c too much unnecessary code is not suitable for use.

  • The two parallel lines spaced 0.1mm.

    The two parallel lines DC 3.3V voltage.

    Do you know how high breakdown voltage required, in order to affect other lines.

  • Hi Jin,

    So pressing switch 2 triggers interrupts for both P0_2 and P0_3 right? Can you configure P0_3 as output "0" and check if the problem persists?

    I think Greenja meant that you could copy the debounce code only, not the entire hal_keys.c. It is probably a good idea even though you have checked the pin with a scope. Do you for example know the capacitance of the probe you used?

    Cheers,

    Fredrik

  • Hi. Fredrik.

    P0_2, P0_3 in the figure notation is wrong, I'm sorry.P1_2 to P1_3 to modify.

    Q : So pressing switch2 triggers interrupts for both P0_2 and P0_3 right?.

    A: P1_2 and P1_3 interrupt switching is normal.  

    P1_3 Switch Press -> ISR routine entry ok, P1IFG_2 = 1 : normal.  

    P1_2 Switch Press -> ISR routine entry ok, P1IFG_2 = 1 and P1IFG_3 = 1 : duplex setting = 1.

    Q: Can you configure P0_3 as output "0" and check if the problem persists?

    A : Due to the External pull-up resistor, output is expected to be the same changed to "0".

     If you have any other comments, please let us know.

     

     

  • I am not sure what you mean.

    First you write: "P1_2 and P1_3 interrupt switching is normal.",

    but then you say: "P1_2 Switch Press -> ISR routine entry ok, P1IFG_2 = 1 and P1IFG_3 = 1 : duplex setting = 1."

    Does not this mean that pressing P1_2 will set both P1_2 and P1_3 interrupt flag? Is not this your problem?

    When setting P1_3 as output low, this pin will be 0V regardless of the pull-up resistor. Please try this to rule out noise coupling from P1_2.

    /Fredrik

  • hi Fredrik.

     

    Output is set to "0"(P1[0:3]=0), the symptoms are the same.

  • Hi Ti see the following screen.

  • There is no answer?.

    Please respond.. TI.

    Chip Bug?, Is required for a definitive answer.

  • jin kwang hen said:
    Output is set to "0"(P1[0:3]=0), the symptoms are the same.

    Please configure only P1_3 as output "0":

    P1DIR |= 0x08

    P1 &= ~0x08

    /F

  • hi.Fredrik K.

    P1_3 = "0" after modifying, P1IFG_2 Flag is operating normally.

    Below is a screen capture.

    Very glad to know the cause.

     Thank you very much.