Daniel Bull

mc9s12c32 transmit or receive 12 bits on SPI

Discussion created by Daniel Bull on Nov 7, 2007
Latest reply on Nov 9, 2007 by Daniel Bull
    Some chips such as the DS1626 temperature sensor transmit something other than 8 bits or a multiple of 8 bits.  Sending 12 bits to the DS1626 is not a problem as one can send two bytes and the DS1626 will simply ignore the extra bits.  Receiving 12 bits from the DS1626 is something I cannot figure out.

   The SPI will not receive one byte and then 4 more bits, or at least I cannot figure out how to do it.  Is there some way to do this?  I can transmit and receive DS1626 data by bit-banging on PTT pins, but I'd like to use the SPI.  I've tried to use the routines from both Professor Cady's and Professor Valvano's texts, but to no avail.

Can anyone help?

Thanks,
Dan

Outcomes