Page 1 of 1

Interfaccia Pulsante capacitivo con pic

Posted: 12/06/2022, 0:25
by Andrea10
salve ragazzi ho la seguente neccessita:
Ho acquistato su futura il seguente touch
https://futuranet.it/prodotto/interruttore-touch-capacitivo-con-led-blu/
e devo interfacciarlo direttamente con un pic 12f1822

Ho provato mettere uscita del touch (3,3V) direttamente sull'ingresso del micro ma non mi funziona

Non so se ho sbagliato il FW

Vi lascio il listato semplificato:


void main (void)


{

initHW();

if ( RA2 == TRUE ){
RA4 = 1;

__delay_ms(1000);
} else {


RA4 = 0;
__delay_ms(1000);

}

}

Mentre INITHW
void initHW()
{
OSCCON = 0b01111010;
INTCON = 0b11000000;
PIE1 = 0b00001000;

OPTION_REG = 0b00000101;
OPTION_REGbits.PSA=1; // Prescaler is assigned to WDT()


INTCONbits.GIE = 1;
INTCONbits.PEIE = 1;

TRISA4 = 0;
TRISA5 = 1; // qui collego uscita del touch
TRISA2 = 1;
LATA0=0;
LATA4=0;

// LATA5=0;

}

help me