Thank you for your helping.
But, I've still some problems. I've used this code :
#include "mbed.h"
Serial pc(USBTX, USBRX);
SPI can(NC, p6, p7);
DigitalOut cs(p9);
int main() {
can.format(16, 0);
can.frequency(1000000);
pc.printf("Starting ADC interaction\n");
while(1){
cs=0;
wait_us(16);
cs=1;
wait_us(2);
}
}
And I get this, on the oscilloscope, yellow signal is cs and blue signal is data :
As you can see, the time where the cs is at 1 varies between 2 and 3 us. I don't understand why ?
And, there are nothing in data and in clock.
So, I've tried this code, in using the SPIHalfDuplex function :
#include "mbed.h"
Serial pc(USBTX, USBRX);
SPIHalfDuplex can(NC, p6, p7);
DigitalOut cs(p9);
int main() {
can.format(16, 0);
can.frequency(1000000);
pc.printf("Starting ADC interaction\n");
while(1){
cs=0;
int respone = can.write(0xAA);
pc.printf("Reponse : %u", respone);
wait_us(16);
cs=1;
wait_us(2);
}
}
And I get this on the oscilloscope (cs, data) :
On my PC, I get : "Reponse : 4294967295". But this value doesn't change if I vary the voltage to be converted. And I don't understand why the value is 2^32 - 1.
Also, the clock is still not visible.
Thank you for your help.
Hello,
Above all I would like to apologize for the quality of my English, I'm french.
I'm a beginner and I am currently about to try a analog-to-digital converter with my mbed. It's the MAX11110, you can find technical documentation here :
http://datasheets.maxim-ic.com/en/ds/MAX11102-MAX11117.pdf
It consists of 6 pins that I connected this way in mbed :
The CS pin is from what I understood to activation of the conversion request. When one wants to have a measure passed this pin to 0, the conversion occurs and is reset to 1.
To view on oscilloscope the data bus DOUT, I made this little program. Alas, I see nothing in DOUT and I can't visualize the clock, I have a similar signal on the clock and CS. It's weird.
Thank you for your help !
Rémy