Hello, I'm having trouble to communicate with the ADS1247.
I'm trying to read the registers but is not working.
I'm managing only lines SCK, MISO and MOSI, line START I always leave on a high level and line level in CS always let down.
With the oscilloscope looked at the waveforms, and signals CLK and MOSI seem to agree, but I'm not getting the ADS1247 useful information.
I am using ARM LPC1343, and the following code in C:
i2c_buff [0] = 0x20;
i2c_buff [1] = 0x03;
i2c_buff [2] = 0xFF;
i2c_buff [3] = 0xFF;
i2c_buff [4] = 0xFF;
i2c_buff [5] = 0xFF;
lpc1xxx_ssp_send (i2c_buff, 6);
lpc1xxx_ssp_receive (i2c_buff, 4);
I load the data into a buffer and sent to the function ssp.
void lpc1xxx_ssp_send (volatile unsigned char * p, unsigned int bytes)
{
unsigned int i;
for (i = 0; i <bytes; i + +)
{
/ / Only load if not busy and the TX FIFO is not full
while ((LPC_SSP-> SR & (0x02 | 0x10))! = 0x02);
LPC_SSP-> DR = * p;
p + +;
}
}
void lpc1xxx_ssp_receive (volatile unsigned char * p, unsigned int bytes)
{
unsigned int i;
for (i = 0; i <bytes; i + +)
{
/ / Wait while the RX FIFO is empty
while (! (LPC_SSP-> SR & 0x04));
* P = LPC_SSP-> DR;
p + +;
}
}