Well, I don't think it's problem of BASCOM version, the SPI has not changed to my knowledge in newer versions and besides that I have also tried to do it with C, yet no success.
I have more expreience in BASIC since QBASIC time, so I prefer to do it in BASCOM.
In the datasheet there is a phrase which sounds strange to me:
[quote:02dc455e16]The communications register is an 8-bit, write-only register that controls the serial data transfer between the ADE7758 and the host processor. All data transfer operations must begin with a write to the communications register.[/quote:02dc455e16]
So, this means that I have to send a byte which it's bit 7 is 1 (as datasheet describes the seven low bits contain the target register address and the 7th bit determines whether it's a write to or read command). But at the moment I am trying to read the Die version register which is a single byte, read only register addressed in data sheet as 0x7F. what confusing to me is that how I can write to chip, when I am trying to access a read only register?!
what I have tried so far is first sending 0xFF (to make the MSB of 0x7F high as to be a write command) then sending the actual address (0x7F) then sending a dummy value and read the SPDR contents. I have also tried to read and display the contents of the SPDR in between every step. It's always FF, which basically shows that the SPDR is empty and never receives anything from the ADE7758.
can somebody explain it to me what exactly that phrase in datasheet means?
↧