<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>8-bit Microcontrollers中的主题 HCS08: SPI transfers with less than 8 bits</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SPI-transfers-with-less-than-8-bits/m-p/262418#M20029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a situation where I need to shift 20 bits of data to a device. (Actually 17 bits - but the shift register in the device in question is 20 bits long, so I an always pad.)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way in which I can get the SPI peripheral in an HCS08 part to transfer only half a byte? So, transfer one byte, another byte, then half a byte, to end up with 20 bits.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't see any indication in the datasheet that this is possible, and am assuming I'll have to bit-bang the interface, but thought I'd ask just in case there's some kind of magic that will allow me to use the native hardware.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Feb 2013 21:42:36 GMT</pubDate>
    <dc:creator>Smiffytech</dc:creator>
    <dc:date>2013-02-18T21:42:36Z</dc:date>
    <item>
      <title>HCS08: SPI transfers with less than 8 bits</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SPI-transfers-with-less-than-8-bits/m-p/262418#M20029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a situation where I need to shift 20 bits of data to a device. (Actually 17 bits - but the shift register in the device in question is 20 bits long, so I an always pad.)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way in which I can get the SPI peripheral in an HCS08 part to transfer only half a byte? So, transfer one byte, another byte, then half a byte, to end up with 20 bits.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't see any indication in the datasheet that this is possible, and am assuming I'll have to bit-bang the interface, but thought I'd ask just in case there's some kind of magic that will allow me to use the native hardware.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 21:42:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SPI-transfers-with-less-than-8-bits/m-p/262418#M20029</guid>
      <dc:creator>Smiffytech</dc:creator>
      <dc:date>2013-02-18T21:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08: SPI transfers with less than 8 bits</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SPI-transfers-with-less-than-8-bits/m-p/262419#M20030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SPI operation always generates eight clock pulses as each byte is sent - there is no way to vary this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, assuming the slave device incorporates a simple shift register of length 20 bits, the sending more than 20 clock pulses will overflow the register, but this is potentially not a problem.&amp;nbsp; Align the 20 data bits so that these are &lt;SPAN style="text-decoration: underline;"&gt;not&lt;/SPAN&gt; the ones that overflow.&amp;nbsp; For the usual operation of MSB sent first, the 20 bits would be right-aligned.&amp;nbsp; The upper nybble of the first byte sent would be the overflow bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The assumption is that the data is strobed into the slave peripheral when the SS signal is raised.&amp;nbsp; If the data is automatically strobed when a count of 20 bits is reached, a different approach would be required.&amp;nbsp; In this case, the data would need to be left-aligned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Knowledge of the slave peripheral you are using might permit a more definitive answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 04:50:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SPI-transfers-with-less-than-8-bits/m-p/262419#M20030</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2013-02-19T04:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08: SPI transfers with less than 8 bits</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SPI-transfers-with-less-than-8-bits/m-p/262420#M20031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, that solves the problem :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The part (a MAX6921 vacuum fluorescent display (VFD) driver) is designed to be cascaded, and only sets its outputs once a Latch Enable pin is pulsed - so sending unwanted bits FIRST will indeed do the job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my only problem is the error I made in the circuit board design, so I have to work around it in software.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 05:46:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08-SPI-transfers-with-less-than-8-bits/m-p/262420#M20031</guid>
      <dc:creator>Smiffytech</dc:creator>
      <dc:date>2013-02-19T05:46:11Z</dc:date>
    </item>
  </channel>
</rss>

