Help !! SPI interface

optic

New Member
Hi all,

I'm having trouble with what is described as a SPI interface, been reading the manual but lost in a world of serin hpisetup etc,

The sensor is http://www.sure-electronics.net/download/MB-SM24118_Manual.pdf

a DYPTH01 a temp and humitiy sensor, using a 28x2 i've connected the cs to pin B.7 and was thinking that making this high and low will prompt the sensor to read wake up, i've connected the sdat to C.7 but do i need the SCK pin connected ???

how can i get this data stream into say w0 for temp w1 for humidity ???


my next question will be has anyone used ade7753 with a picaxe, i've given up on the acs758 reading AC current.

Thanks inadvance,
 

nick12ab

Senior Member
Yes you need SCK connected. Unfortunately the sensor requires that the microcontroller is the slave - unbelieveable!

You'll need to bit-bang reception of the data e.g. by using:
Code:
do : loop until sckpin = 1
bit7 = sdapin
do : loop until sckpin = 1
bit6 = sdapin
...
I recommend that you use setfreq em64 and an external 16MHz crystal/resonator.
 

westaust55

Moderator
Looking at that datasheet, I see there is reference to a CRC using the polyniomial X8 + X5 + X4.

This is the same as the CRC scheme used by Dalls/Maxim for their 1-Wire devices.
If you have a look in the 1-Wire Network thread I posted long ago here: http://www.picaxeforum.co.uk/showthread.php?15306
you will find some examples of using the 8-bit CRC to verify data/serial numbers.
 
Top