<?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のトピックBit Banging SPI on 13192-Sard board</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136037#M4190</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello all.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am relatively new to all of this and have never interfaced with SPI.&amp;nbsp; I have an Analog Devices 360 degree inclinometer (ADIS16203) that I would like to interface with the 13192-SARD board from the Zigbee Eval Kit.&amp;nbsp; The microcontroller on the board is a MC9S08GT60.&amp;nbsp; From what I understand, the microcontroller has an SPI bus, but it is being occupied with the MC13192 radio.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The data sheet for the ADIS16203 mentions bit banging a SPI interface.&amp;nbsp; From my preliminary internet research, I need 3 output pins (CS/, DOUT, SCLK)&amp;nbsp;and 1 input pin&amp;nbsp;(DIN)&amp;nbsp;available to do this.&amp;nbsp; Fortunately there&amp;nbsp;are 13&amp;nbsp;pins available on a header (J105) that I can control in software, but am not entirely sure what to do from here.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Are there any good resources about this topic for a newbie?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for any help!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Nov 2006 05:55:09 GMT</pubDate>
    <dc:creator>adevenport</dc:creator>
    <dc:date>2006-11-10T05:55:09Z</dc:date>
    <item>
      <title>Bit Banging SPI on 13192-Sard board</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136037#M4190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello all.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am relatively new to all of this and have never interfaced with SPI.&amp;nbsp; I have an Analog Devices 360 degree inclinometer (ADIS16203) that I would like to interface with the 13192-SARD board from the Zigbee Eval Kit.&amp;nbsp; The microcontroller on the board is a MC9S08GT60.&amp;nbsp; From what I understand, the microcontroller has an SPI bus, but it is being occupied with the MC13192 radio.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The data sheet for the ADIS16203 mentions bit banging a SPI interface.&amp;nbsp; From my preliminary internet research, I need 3 output pins (CS/, DOUT, SCLK)&amp;nbsp;and 1 input pin&amp;nbsp;(DIN)&amp;nbsp;available to do this.&amp;nbsp; Fortunately there&amp;nbsp;are 13&amp;nbsp;pins available on a header (J105) that I can control in software, but am not entirely sure what to do from here.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Are there any good resources about this topic for a newbie?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for any help!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2006 05:55:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136037#M4190</guid>
      <dc:creator>adevenport</dc:creator>
      <dc:date>2006-11-10T05:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bit Banging SPI on 13192-Sard board</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136038#M4191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;if you search this board and the internet for "SOFTWARE SPI" you should find what you are looking for&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2006 21:27:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136038#M4191</guid>
      <dc:creator>mjcoury</dc:creator>
      <dc:date>2006-11-10T21:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bit Banging SPI on 13192-Sard board</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136039#M4192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;In a general sense, it is usually&amp;nbsp;possible for the SPI peripheral to be shared between multiple external devices, provided no one device requires continuous&amp;nbsp;data transfer&amp;nbsp;- an unusual requirement.&amp;nbsp; However, for the board you are using, since external access to the SPI pins is not provided, I agree it will probably be easier to bit-bang using pins to which external access is provided.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;In general, the SPI code will have to be specifically tailored to suit the particular&amp;nbsp;external device.&amp;nbsp; For the ADIS16203, I would make the following observations -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="2"&gt;The external device is the slave, and the MCU the master, and the SCLK signal will originate from the MCU.&amp;nbsp; This is the more typical arrangement.&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;The requirement of CPOL = 1 means that the SCLK signal will idle at the high state.&amp;nbsp; The external device will change the&amp;nbsp;state at its Dout (or MISO)&amp;nbsp;pin after the negative edge of the clock, and read the state at its Din (or MOSI)&amp;nbsp;pin at the positive edge of the clock.&amp;nbsp; For compatibility, the MOSI output from the MCU should update its output after generating the negative clock edge, and read the returned data at MISO after generating the positive clock edge.&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;The requirement of CPHA = 1 means that the MS bit of the data at MOSI will be presented after the first negative clock edge, and that the bit state prior to this edge is not relevant.&amp;nbsp; I would suggest that you examine the transmission format waveforms for the hardware SPI peripheral, because this is what you are attempting to emulate.&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Since the&amp;nbsp;inclinometer device requires a data length of 16 bits, it would probably be more efficient for your SPI code to also handle 16 bits at a time. (A hardware SPI would actually handle only 8 bits at a time).&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;The inclinometer is capable of receiving the next command word while it simultaneously&amp;nbsp;provides output of the response to the previous command word.&amp;nbsp; If you wish to take advantage of this, your bit bang code would&amp;nbsp;need to be&amp;nbsp;a single routine that simultaneously caters for both data output and data input.&amp;nbsp; I would normally do this anyway, but the code examples you may&amp;nbsp;observe in application notes, etc. may not.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Will you be programming in assembler or C?&amp;nbsp; The shift operations required are more complex and convoluted to program in C because there is not direct access to the carry flag of the MCU - well, that's my opinion - perhaps others will disagree.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Nov 2006 20:04:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136039#M4192</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-11-12T20:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Bit Banging SPI on 13192-Sard board</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136040#M4193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;I have attached my attempt to write a software SPI combined send and receive function in C.&amp;nbsp; Each transaction is for a 16 bit word, and should be compatible with a slave device that requires CPOL = 1 and CPHA = 1.&amp;nbsp; I have not shown the necessary I/O initialisation code.&amp;nbsp; This code will be significantly slower than a similar function written in assembly code.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 17:33:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136040#M4193</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-11-14T17:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Bit Banging SPI on 13192-Sard board</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136041#M4194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;hello all,&lt;/DIV&gt;&lt;DIV&gt;I want to use ADIS16203 in a control board and i have a question,&lt;/DIV&gt;&lt;DIV&gt;can i use atmega128(8 bit microcontroller of avr family) to spi interface with this sensor?&lt;/DIV&gt;&lt;DIV&gt;regards&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2007 15:13:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Bit-Banging-SPI-on-13192-Sard-board/m-p/136041#M4194</guid>
      <dc:creator>moradi</dc:creator>
      <dc:date>2007-06-13T15:13:08Z</dc:date>
    </item>
  </channel>
</rss>

