Hi,
I am working with C6727 DSP. To do a SPI transfer, I write SPIBUF-32bits
register with an unsigned int-value. However, I am working with a word length of
8 bits, so how does it work? I mean, it is possible to write SPIBUF register
with a 'smaller' data type (char, for example)?
Sorry, Im new with embedded programming.
Thanks in advance. Best Regards,
Alvaro
_____________________________________
Data types on SPI transfers
Started by ●June 7, 2011
Reply by ●June 8, 20112011-06-08
There was a mistake, sorry. The register to write is SPIDAT0 instead of
SPIBUF.
Hi,
>
>I am working with C6727 DSP. To do a SPI transfer, I write SPIBUF-32bits register with an unsigned int-value. However, I am working with a word length of 8 bits, so how does it work? I mean, it is possible to write SPIBUF register with a 'smaller' data type (char, for example)?
>Sorry, Im new with embedded programming.
>
>Thanks in advance. Best Regards,
>Alvaro
>
>_____________________________________
_____________________________________
Hi,
>
>I am working with C6727 DSP. To do a SPI transfer, I write SPIBUF-32bits register with an unsigned int-value. However, I am working with a word length of 8 bits, so how does it work? I mean, it is possible to write SPIBUF register with a 'smaller' data type (char, for example)?
>Sorry, Im new with embedded programming.
>
>Thanks in advance. Best Regards,
>Alvaro
>
>_____________________________________
_____________________________________
Reply by ●June 20, 20112011-06-20
Alvaro-
> There was a mistake, sorry. The register to write
> is SPIDAT0 instead of SPIBUF.
>
> Hi,
>>
>>I am working with C6727 DSP. To do a SPI transfer, I write SPIBUF-32bits register with an unsigned int-value.
>> However, I am working with a word length of 8 bits, so how does it work? I mean, it is possible to write SPIBUF
>> register with a 'smaller' data type (char, for example)?
Yes write char data. The C672x SPI Ref Guide is here:
http://focus.ti.com/lit/ug/spru718b/spru718b.pdf
First you want SPIDAT1 not SPIDAT0 -- according to the Ref Guide, writes to SPIDAT0 have "no effect". Second, section
A.1.14 mentions CHARLEN and right-justified writes to SPIDAT1.
-Jeff
_____________________________________
> There was a mistake, sorry. The register to write
> is SPIDAT0 instead of SPIBUF.
>
> Hi,
>>
>>I am working with C6727 DSP. To do a SPI transfer, I write SPIBUF-32bits register with an unsigned int-value.
>> However, I am working with a word length of 8 bits, so how does it work? I mean, it is possible to write SPIBUF
>> register with a 'smaller' data type (char, for example)?
Yes write char data. The C672x SPI Ref Guide is here:
http://focus.ti.com/lit/ug/spru718b/spru718b.pdf
First you want SPIDAT1 not SPIDAT0 -- according to the Ref Guide, writes to SPIDAT0 have "no effect". Second, section
A.1.14 mentions CHARLEN and right-justified writes to SPIDAT1.
-Jeff
_____________________________________
Reply by ●June 22, 20112011-06-22
I tried before and it runs, I just ask to know how it works. Now I
understand.
Thank you very much, Jeff.
Hi,
>
>I am working with C6727 DSP. To do a SPI transfer, I write SPIBUF-32bits register with an unsigned int-value. However, I am working with a word length of 8 bits, so how does it work? I mean, it is possible to write SPIBUF register with a 'smaller' data type (char, for example)?
>Sorry, Im new with embedded programming.
>
>Thanks in advance. Best Regards,
>Alvaro
>
>_____________________________________
_____________________________________
Thank you very much, Jeff.
Hi,
>
>I am working with C6727 DSP. To do a SPI transfer, I write SPIBUF-32bits register with an unsigned int-value. However, I am working with a word length of 8 bits, so how does it work? I mean, it is possible to write SPIBUF register with a 'smaller' data type (char, for example)?
>Sorry, Im new with embedded programming.
>
>Thanks in advance. Best Regards,
>Alvaro
>
>_____________________________________
_____________________________________