# how to transfer 24-bit data through 8-bit spi

**URL:** <https://forums.digi.com/t/how-to-transfer-24-bit-data-through-8-bit-spi/21070>\
**Category:** Plug N' Play\
**Tags:** data, spi, msp430f5529\
**Created:** [January 28, 2020, 8:32am UTC](https://forums.digi.com/t/how-to-transfer-24-bit-data-through-8-bit-spi/21070 "2020-01-28T08:32:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vamshi97](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vamshi97](https://forums.digi.com/u/vamshi97)\
**Post date:** [January 28, 2020, 8:32am UTC](https://forums.digi.com/t/how-to-transfer-24-bit-data-through-8-bit-spi/21070/1 "2020-01-28T08:32:24Z")

</div>

Hello everyone.I am working on a project to develop frequency synthesizer(LMX2595). In this I need to program the frequency synthesizer IC by SPI protocol. For this I have selected MSP430F5529 micro controller to program the synthesizer IC (LMX2595). I am facing difficuty in developing code for the micro controller. I need to operate the micro controller in master mode and transfer data to the slave device (LMX2595 synthesizer IC). Generally I have 24-bit data to be transferred of about 79 registers, But the available SPI in micro controller (MSP430F5529) is 8-bit. The 24-bit data format is 1-bit R/W, 7-bit Address, 16-bit data. I took the sample example code and modified but, I am facing error with respect to the write function. Generally I have split the 24-bit data into 3 Bytes, later by running for loop I have transferred the 24-bit data. I really don’t have much time, Any help with respect to programming point of view will be greatly appreciated.

Thanks in advance
