Posted: 01:47pm 13 Jan 2021 |
Copy link to clipboard |
Print this post |
|
Hi, I finally found some time to take care of my sensor problem.
I have now connected my logicanalyzer and can now see what I am really sending and how my sensor is reacting.
Mode 0 is the correct mode - only here I get a pulse on the EOC line (end-of-conversion indicator) when I send the correct start sequence!
Unfortunately, I still get "house numbers" as a response from the sensor!
But I have found that sending ONLY works with "SPI write"!?
With this code
SPI write 1, &HAA SPI write 1, 0 SPI write 1, 0 I can see this response on my analyzer:MOSI: 0xAA MISO: 0x40 MOSI: 0x00 MISO: 0xD9 MOSI: 0x00 MISO: 0x40
But with this code,
Data %(1)=SPI(&HAA) Data %(2)=SPI(0) Data %(3)=SPI(0) I'm actually sending this:MOSI: 0xF0 MISO: 0x40 MOSI: 0x00 MISO: 0xD9 MOSI: 0x00 MISO: 0x43 ...and my sensor doesn't response! So I send hF0 instead of hAA with this command!!! Maybe an error in "variable = SPI(data)" anyway? Or what am I doing wrong?
Frank |