<?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>topic Re: 3 wire SPI interface in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141854#M6057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;bigmac wrote:&lt;BR /&gt;In the Dallas data sheet, it would appear that fig 3 for the single byte read may have an error with only 15 clock pulse shown . . .&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;Hi, Mac:&lt;BR /&gt;That's what I thought when I first saw it, but after reading the text and examining the timing diagrams, I realized it was correct. It really is a silly protocol, using only 15 clocks. But it makes for quick and easy bit-banging.&lt;BR /&gt;&lt;BR /&gt;The series resistor is a good idea. Because of the obvious contention period, I did not check if it whether it would work with CPHA = 0.&lt;BR /&gt;&lt;BR /&gt;But I still think the best approach is to use the SPI version, DS1306.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Jul 2006 12:06:03 GMT</pubDate>
    <dc:creator>rocco</dc:creator>
    <dc:date>2006-07-11T12:06:03Z</dc:date>
    <item>
      <title>3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141847#M6050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For the QG8, can you setup a 3 wire SPI (bidirectional data) similiar to&amp;nbsp; MICROWIRE?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:01:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141847#M6050</guid>
      <dc:creator>FC</dc:creator>
      <dc:date>2006-07-04T09:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141848#M6051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi FC,&lt;/P&gt;&lt;P&gt;Microwire (TM National Semiconductor) depending on the flavour is either one of two of the four modes available to SPI (TM Motorola Semiconductor).&lt;/P&gt;&lt;P&gt;So a Microwire peripheral will always work on an SPI port but a SPI peripheral may not work on a Microwire port.&lt;/P&gt;&lt;P&gt;Most parts these days (especially from Maxim) claim to be compatible with both.&lt;/P&gt;&lt;P&gt;Regards David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 11:56:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141848#M6051</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2006-07-04T11:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141849#M6052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;Trying to setup an interface to the Maxim DS1302 RTC.&amp;nbsp; How would the bidirectional data&amp;nbsp;be handled using the 9S08QG8 SPI?&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2006 00:47:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141849#M6052</guid>
      <dc:creator>FC</dc:creator>
      <dc:date>2006-07-10T00:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141850#M6053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, FC:&lt;BR /&gt;&lt;BR /&gt;I don't think you can use the SPI to talk to the DS1302. The protocol of the DS1302 is just too different.&lt;BR /&gt;&lt;BR /&gt;The main issue that I see is with a read from the DS1302. When you issue a command to read, the eighth bit of the command is clocked in by the rising edge of the eight clock, but the first bit of the returned data is presented at the falling edge of that same clock. This means:&lt;BR /&gt;&lt;BR /&gt;1) A read would take 15 clocks, instead of the 16 clocks that the SPI would generate.&lt;BR /&gt;2) The DS1302 would drive the data line before the SPI was finished driving the line, with the potential of destroying either part.&lt;BR /&gt;3) Any byte that you did read would by spread across two SPI transfers, shifted by one bit.&lt;BR /&gt;&lt;BR /&gt;I think that the best way to communicate with the DS1302 would be to bit-bang it, like we have been doing for the I2C parts over the years.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2006 03:33:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141850#M6053</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-07-10T03:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141851#M6054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi FC,&lt;/P&gt;&lt;P&gt;I think you might be able to use mode 0,0.&lt;/P&gt;&lt;P&gt;The main problem is that you need to flip direction exactly at the last SCK edge, because this same edge would start the reply from the 1302. Maybe you could time the direction from the start of the transfer and flip it slightly early.&lt;/P&gt;&lt;P&gt;You might be able to use the SPI after some experimentation or like rocco said just bit bang it.&lt;/P&gt;&lt;P&gt;Regards David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2006 10:09:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141851#M6054</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2006-07-10T10:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141852#M6055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Also, have you looked at the DS1306?&lt;BR /&gt;&lt;BR /&gt;It is a similar part, but the non-standard 3-wire interface of the DS1302 is replaced with an SPI interface. Plug-n-play.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2006 14:13:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141852#M6055</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-07-10T14:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141853#M6056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;It would seem possible to use the SPI facility for the DS1302, provided CPHA = 0 (and CPOL = 0). In the Dallas data sheet, it would appear that fig 3 for&amp;nbsp;the single byte read may have an error with only 15 clock pulse shown - there would need to be a sixteenth clock&amp;nbsp;for the MCU master to read the LS bit of the returned byte on&amp;nbsp;its positive &amp;nbsp;edge, and this would be compatible with SPI.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;For the CPHA = 0 operation, the MS bit of the returned data needs to be valid on the positive edge of the ninth clock pulse, so the data becoming output on the negative edge of the eighth clock pulse is correct.&amp;nbsp; To avoid&amp;nbsp;the timing issues during the input-to-output transition of the data line&amp;nbsp;at the DS1302 (a conflict might be present for a very short interval) I would&amp;nbsp;suggest to&amp;nbsp;include a series resistor in the&amp;nbsp;line, say 4k7, to provide current limiting.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;For MCU operation with a single data line (MOSI becomes MOMI),&lt;BR /&gt;SPIC2_SPCO = 1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Prior to the command byte being sent,&lt;BR /&gt;SPIC2_BIDIROE = 1;&amp;nbsp; // For data output from MCU&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Prior to receiving the return data byte (by sending a dummy byte),&lt;BR /&gt;SPIC2_BIDIROE = 0;&amp;nbsp; // For data input to MCU&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2006 10:43:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141853#M6056</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-07-11T10:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141854#M6057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;bigmac wrote:&lt;BR /&gt;In the Dallas data sheet, it would appear that fig 3 for the single byte read may have an error with only 15 clock pulse shown . . .&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;Hi, Mac:&lt;BR /&gt;That's what I thought when I first saw it, but after reading the text and examining the timing diagrams, I realized it was correct. It really is a silly protocol, using only 15 clocks. But it makes for quick and easy bit-banging.&lt;BR /&gt;&lt;BR /&gt;The series resistor is a good idea. Because of the obvious contention period, I did not check if it whether it would work with CPHA = 0.&lt;BR /&gt;&lt;BR /&gt;But I still think the best approach is to use the SPI version, DS1306.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2006 12:06:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141854#M6057</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-07-11T12:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: 3 wire SPI interface</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141855#M6058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Of course unless the OP has a big box of 1302's gathering dust this is all academic.&lt;/P&gt;&lt;P&gt;You could use open-collector buffers as well!&lt;/P&gt;&lt;P&gt;I think you loose burst mode too with this 15 clocks business (or too messy if you can)&lt;/P&gt;&lt;P&gt;Another idea:&lt;/P&gt;&lt;P&gt;The OP is using QG8, it has I2C, so the DS1307 is possibly a better choice as you don't need the extra pin as with the SPI 1306.&lt;/P&gt;&lt;P&gt;Regards David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2006 12:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/3-wire-SPI-interface/m-p/141855#M6058</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2006-07-11T12:28:43Z</dc:date>
    </item>
  </channel>
</rss>

