Hello, sory for my english, i speak spanish.
I'm triying to communicate to and ADS7843 ( http://www.ti.com/lit/ds/symlink/ads7843.pdf ) with SSI module.
I can start the SSI module, but i always read the same number 0x80.
I write a number and then write 2 frames with 0x00 so i can read. ( 1 frame write , 2 read, 8bit each one )
And i think my problem is SSI2Fss return High between frames, datasheet of ADS7843 dont show this pin going high between frames.
Every driver i see on internet is using an SSI made in software ( i tried and worked ) but i want to do it with the SSI module.
Here is my code:
void InitTouch(void) {
// Configuracion del SSI para comunicarse con el touch
SysCtlPeripheralEnable(SSI_ENA);
SysCtlPeripheralEnable(SSI_PORT_SYSCTL);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);
GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_1 | GPIO_PIN_3| GPIO_PIN_2);
GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_0);
GPIOPinWrite(GPIO_PORTD_BASE, T_PIN_CS, 0xFF);
// Configuramos los multiplex para el SSI
GPIOPinConfigure(PIN_RX_MUX); //RX
GPIOPinConfigure(PIN_TX_MUX); //TX
GPIOPinConfigure(PIN_FSS_MUX); // Frame: CS
GPIOPinConfigure(PIN_CLK_MUX); // Clock
// Asignamos esos pines al SSI
GPIOPinTypeSSI(PORT_BASE, PORT_PINS);
SSIConfigSetExpClk(SSI_BASE, CLKSPEED, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 50000, 8);
SSIEnable(SSI_BASE);
}
uint32_t TouchWriteAndRead(uint16_t Data) {
uint32_t valor[2];
SSIDataPut(SSI_BASE,Data);
SSIDataPut(SSI_BASE,0x00);
SSIDataPut(SSI_BASE,0x00);
SSIDataGet(SSI_BASE,&valor[0]);
SSIDataGet(SSI_BASE,&valor[1]);
UARTprintf("Valor 0: %x , Valor 1: %x \n",valor[0],valor[1]);
valor[0] = (valor[0] & 0xFF) << 4 ;
valor[1] = (valor[1] & 0xF0) >> 4 ;
return (valor[0] | valor[1]);
}
It's possible ?