Salut,

toujours dans le soucie de maîtriser ce micro, et après avoir réussi à comprendre certaines notions comme le temps pour pouvoir faire des tempos avec les timers, l'utilisation d'i/O en mode pull-up (CN15,CN16,CN19,CN12) pour activer des entrées

// Configuration input pullup CN
#define CONFIG (CN_ON)
#define INTERRUPT (CHANGE_INT_ON | CHANGE_INT_PRI_2)
#define PINS (CN15_ENABLE |CN16_ENABLE|CN19_ENABLE|CN12_ ENABLE)
#define PULLUPS (CN15_PULLUP_ENABLE|CN16_PULLU P_ENABLE|CN19_PULLUP_ENABLE|CN 12_PULLUP_ENABLE)
J'ai mis en place tant bien que mal des interruptions qui vont bien pour faire fonctionner tout ça, j'éprouve encore quelques difficultés sur les notions d'interruption et de priorités, notamment en ce qui concerne mon compilateur au niveau des i/O qui ne sont pas configurable en pull-up.

/****************************** ****************************** *********
*
* PIC32MX
*
****************************** ****************************** *********
*
* FileName: main.c
*
* Dependencies: plib.h
*
* Processor: PIC32MX
*
* Complier: MPLAB C32
* MPLAB IDE
*
* Company:
*
* auteur:
*
****************************** ****************************** *********/
#include <plib.h>

#include "fonction.h"
#define extern
#include "definition.h"
#undef extern



#if defined (__32MX360F512L__) || (__32MX460F512L__) || (__32MX795F512L__) || (__32MX430F064L__)

// clock X20 , clock /2 , clock/? ,Validation du wathdog
#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = ON
// Mode oscillateur int, pas de PLL, FPB/1
#pragma config POSCMOD = OFF, FNOSC = FRC, FPBDIV = DIV_1

#endif






void init_port(void)
{
// Clear PORT bits so there are no unexpected flashes when setting
// them to output in the next step
mPORTDClearBits(BIT_2 |BIT_1 | BIT_0);
mPORTDClearBits(BIT_6 |BIT_7 | BIT_13);
mPORTBClearBits(BIT_8|BIT_9 |BIT_10 | BIT_11|BIT_13|BIT_14 |BIT_15);
mPORTAClearBits(BIT_1);

// PORT as input analogique
PORTSetPinsAnalogIn(IOPORT_B, BIT_3 | BIT_2| BIT_1| BIT_0);

// PORT as output digital
mPORTDSetPinsDigitalOut(BIT_2 |BIT_1 | BIT_0);
mPORTBSetPinsDigitalOut(BIT_8| BIT_9 |BIT_10 | BIT_11);

// PORT as input digital
mPORTDSetPinsDigitalIn(BIT_6|B IT_7 |BIT_13);
mPORTBSetPinsDigitalIn(BIT_13| BIT_14 |BIT_15);
mPORTASetPinsDigitalIn(BIT_1);



}

void init_timer1(void)
{
// Configure Timer 1 using PBCLK as input, 1:256 prescaler
// Period matches the Timer 1 frequency, so the interrupt handler
// will trigger every one second...

//OpenTimer1(T1_ON | T1_SOURCE_INT | T1_PS_1_1, PERIOD);
T1CONbits.ON=1; //enable clock timer1
T1CONbits.TCS=0; //internal clock
//T1CONbits.TCKPS=0; //Prescalaire 1:1
T1CONbits.TCKPS=1; //Prescalaire 1:8
//T1CONbits.TCKPS=2; //Prescalaire 1:64
//T1CONbits.TCKPS=3; //Prescalaire 1:256
WriteTimer1(COMPTAGE);
INTClearFlag(INT_T1);


ConfigIntTimer1(T1_INT_ON | T1_INT_PRIOR_2);


}



/****************************** ****************************** ****************************** ****
*
* Interruption
*
*
****************************** ****************************** ****************************** *****/

// Configure the Timer 1 interrupt handler
void __ISR(_TIMER_1_VECTOR, ipl2) Timer1Handler(void)
{

// Clear the interrupt flag
INTClearFlag(INT_T1);
ms++;

//PORTBbits.RB8=~PORTBbits.RB8;
WriteTimer1(COMPTAGE);

}



// Configure l'interruption des entrées pullup
void __ISR(_CHANGE_NOTICE_VECTOR, ipl3) ChangeNotice_Handler(void)
{

mCNClearIntFlag();


if (mPORTDReadBits(BIT_6)==0) sw=1;
if (mPORTDReadBits(BIT_7)==0) sw=2;
if (mPORTDReadBits(BIT_13)==0) sw=3;
if (mPORTBReadBits(BIT_15)==0) sw=0;


}


void __ISR(_EXTERNAL_0_VECTOR,ipl4) INT1Handler()
{

INTClearFlag(INT_INT0);
if (mPORTBReadBits(BIT_13)==1) sw=3;
if (mPORTBReadBits(BIT_14)==1) sw=3;
if (mPORTAReadBits(BIT_1)==1) sw=3;
}

//****************************** ****************************** ****************************** *******


void init_variable(void)
{

ms=0;
sw=0;


}




void clignotement(void)
{


switch(sw)
{

case 0 : while (ms>=ONE_SECOND)
{
// Toggle LEDs on the Explorer-16
mPORTDToggleBits(BIT_2 | BIT_1 | BIT_0);
mPORTBToggleBits(BIT_8|BIT_9 |BIT_10 | BIT_11);
ms=0;
}
//goto SELECT;
break;

case 1 : while(ms>=DEMI_SECOND)
{
// Toggle LEDs on the Explorer-16
mPORTDToggleBits(BIT_2 | BIT_1 | BIT_0);
mPORTBToggleBits(BIT_8|BIT_9 |BIT_10 | BIT_11);
ms=0;
}
//goto SELECT;
break;
case 2 : while(ms>=CENTMS_SECOND)
{
// Toggle LEDs on the Explorer-16
mPORTDToggleBits(BIT_2 | BIT_1 | BIT_0);
mPORTBToggleBits(BIT_8|BIT_9 |BIT_10 | BIT_11);
ms=0;
}
//goto SELECT;
break;
case 3 : while(ms>=CINQMS_SECOND)
{
// Toggle LEDs on the Explorer-16
mPORTDToggleBits(BIT_2 | BIT_1 | BIT_0);
mPORTBToggleBits(BIT_8|BIT_9 |BIT_10 | BIT_11);
ms=0;
}
//goto SELECT;
break;



//SELECT:ClearWDT();
ClearWDT();
}

}


void bp(void)
{



if (mPORTBReadBits(BIT_13)==1) sw=3;
if (mPORTBReadBits(BIT_14)==1) sw=3;
if (mPORTAReadBits(BIT_1)==1) sw=3;

ClearWDT();
}





int main(void)
{

// Configure the device for maximum performance but do not change the PBDIV
// Given the options, this function will change the flash wait states, RAM
// wait state and enable prefetch cache but will not change the PBDIV.
// The PBDIV value is already set via the pragma FPBDIV option above.
//SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);



//Initialize the DB_UTILS IO channel
//DBINIT();//ClrWdt();

// Enable change notice, enable discrete pins and weak pullups
mCNOpen(CONFIG, PINS, PULLUPS);
EnableINT0;
// Clear change notice interrupt flag
ConfigIntCN(INTERRUPT);
ConfigINT0(EXT_INT_ENABLE|RISI NG_EDGE_INT|EXT_INT_PRI_3 );

//Enable multi-vector interrupts
INTConfigureSystem(INT_SYSTEM_ CONFIG_MULT_VECTOR);
INTEnableInterrupts();
// enable device multi-vector interrupts
INTEnableSystemMultiVectoredIn t();//ClrWdt();


init_timer1();
init_port();
init_variable();//ClrWdt();



while (1)
{
ClearWDT();
bp();
clignotement();
ClearWDT();
}


return 0;
}
j'ai donc d'autres entrées que j'active par un plus vcc et rien ne ce passe pour l'instant, j'ai galéré toutes la journée pour les activées mais je ne comprend pas ce qui ne va pas.
En fait je souhaite activer les entrées RB13, RB14, RA1 via des interrupteurs mais ça ne répond pas.

J'ai cru comprendre, que pour cela, il faut d'activer toutes les interruptions pour prendre en compte les entrées RB13, RB14, RA1 en esuite réactivé les interruptions ?

Auriez vous une suggestion qui me feront avancer
Merci