cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L15 Touch Sensor and RI

amphibulator
Associate
Posted on April 29, 2015 at 10:21

I am trying to write my own driver for the touch sensor and right now, am learning how to use RI. I thought I understood what to so I tried to connect pins PA.0 and PA.1 together. And measure the resistance between them to make sure I was doing it correct. However it never seems to work, there is always pretty large resistance. Here the section of code:

RCC->APB1ENR |= RCC_APB1ENR_COMPEN;

GPIOA->MODER &= ~((0x03)<<(2*1)); //Mode mask

GPIOA->MODER |= 0x03<<(2*1); // Set as analog

GPIOA->MODER &= ~((0x03)<<(2*0)); //Mode mask

GPIOA->MODER |= 0x03<<(2*0); // Set as analog

COMP->CSR |= COMP_CSR_CMP1EN

RI->ASCR1 &= ~RI_ASCR1_CH_1;

RI->ASCR1 &= ~RI_ASCR1_CH_0;

RI->ASCR1 |= RI_ASCR1_CH_0;

RI->ASCR1 |= RI_ASCR1_CH_1;

Am I doing something blatantly wrong here?

#ri-routing-interface #stm32-discovery-touch
0 REPLIES 0