[simpits-tech] Need some Serial Communications help....

Roberto Waltman fsim at rwaltman.com
Thu Mar 3 11:04:37 PST 2011


raysot at comcast.net wrote:
> So, I have the Arduino set up and spitting out a datastream (See image
> link below)
>
> I'm using a CS4122 chip:
> (http://www.datasheetcatalog.org/datasheet/on_semiconductor/CS4122-D.PDF)
>
> This link is my timing diagram.
> http://dl.dropbox.com/u/22535032/SerialData.jpg
>
> I am successful in sending data but the gauge doesn't interpret
> correctly.. (Basically it just moves to random position on every 2nd cycle
> of the CS signal.)
>
> This leads me to believe that I'm missing something... like a start/stop
> semaphore or some sort of parity bit(?)

For some reason I can not access the picture so, based only on the text:

You mention start/stop bits, etc. The pin names SI/SO can be misleading,
this is not a serial port as in RS-232 / UART based comms.  There are no
start, stop or parity bits.

This is an SPI interface. You need to prepare a 12 bits command as
described in Fig-6 in the data sheet, deliver it bit by bit to the SI pin
while supplying a clock pulse per bit to the SCLK.  You can do it using an
SPI port in the Arduino, if that is available, or by setting individual
bits high or low. ("bit-banging")

The "random position" may be due to sending too many or too few bits,
sending too many or too few clock pulses, the data or clock bits having
the wrong polarity, the data being totally wrong, (like what an UART would
produce,) the bits delivered in the wrong order, (MSB first vs LSB
first,)or any combination of the above.

See http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

--
Roberto Waltman




-- 
Roberto Waltman.



More information about the Simpits-tech mailing list