<?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: Indexed adressing in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134585#M3734</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;If further data needs to be added to the buffer, before all the previous data has been sent, the buffer would need to be of the "circular" type (or FIFO), with a "head" pointer and a "tail" pointer to keep track of the position of data entering and leaving the buffer.&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 am not sure if this is part of your requirement.&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;A further thought - since your data is already present in flash, I would guess that you don't really need the RAM buffer at all.&amp;nbsp; You would only need to set up a pointer to the&amp;nbsp;data table in flash, read one byte at a time to be sent to the peripheral, and then increment the pointer.&amp;nbsp;&amp;nbsp;The first byte of&amp;nbsp;each data table&amp;nbsp;could contain the number of bytes to be sent, or alternatively the presence of a special byte value&amp;nbsp;could indicate when the end of data is reached.&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 used this&amp;nbsp;approach&amp;nbsp;when sending "canned" message data to a SPI.&amp;nbsp; Each message was terminated by a null.&amp;nbsp; I also provided an additional table containing the start address for each message, so that an individual &amp;nbsp;message could then be referenced by an index number.&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Oct 2006 01:30:28 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2006-10-28T01:30:28Z</dc:date>
    <item>
      <title>Indexed adressing</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134583#M3732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have to read from different tables anywhere in the 16-Bit range and store the data in the SEND-BUFFER (max. 67 Bytes) in the 16-Bit-range of the RAM. The data from the buffer will be sent in a slow speed to an periph.device, only a few Bytes per mainloop. Therefor I cant store the data on stack?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is the simplest way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Has somebody a sample?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Truk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2006 22:44:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134583#M3732</guid>
      <dc:creator>Truk</dc:creator>
      <dc:date>2006-10-27T22:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Indexed adressing</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134584#M3733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Attached (untested, just typed it&amp;nbsp;in,&amp;nbsp;but looks correct).&amp;nbsp; At least, you get the idea.&amp;nbsp; Call the routine by preloading HX with the source address.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;(Oops! Trying again!)&lt;/DIV&gt;&lt;P&gt;Message Edited by tonyp on &lt;SPAN class="date_text"&gt;2006-10-27&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;07:16 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2006 23:10:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134584#M3733</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2006-10-27T23:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Indexed adressing</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134585#M3734</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;If further data needs to be added to the buffer, before all the previous data has been sent, the buffer would need to be of the "circular" type (or FIFO), with a "head" pointer and a "tail" pointer to keep track of the position of data entering and leaving the buffer.&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 am not sure if this is part of your requirement.&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;A further thought - since your data is already present in flash, I would guess that you don't really need the RAM buffer at all.&amp;nbsp; You would only need to set up a pointer to the&amp;nbsp;data table in flash, read one byte at a time to be sent to the peripheral, and then increment the pointer.&amp;nbsp;&amp;nbsp;The first byte of&amp;nbsp;each data table&amp;nbsp;could contain the number of bytes to be sent, or alternatively the presence of a special byte value&amp;nbsp;could indicate when the end of data is reached.&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 used this&amp;nbsp;approach&amp;nbsp;when sending "canned" message data to a SPI.&amp;nbsp; Each message was terminated by a null.&amp;nbsp; I also provided an additional table containing the start address for each message, so that an individual &amp;nbsp;message could then be referenced by an index number.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Oct 2006 01:30:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134585#M3734</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-28T01:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Indexed adressing</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134586#M3735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Many thanks tonyp&amp;nbsp;for help! It works.&lt;/DIV&gt;&lt;DIV&gt;regards&lt;/DIV&gt;&lt;DIV&gt;Truk&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Oct 2006 01:44:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134586#M3735</guid>
      <dc:creator>Truk</dc:creator>
      <dc:date>2006-10-28T01:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Indexed adressing</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134587#M3736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Mac, thank you for your idea too. In my situation it is more complicated, because the data to be sent are from different tables. There&amp;nbsp;are also variables included from the RAM (between code from tables). So it seems better for me, to put all data together before sending. The peripheral is an intelligent LCD (&lt;A href="http://www.lcd-module.de/deu/dip/edip.htm" rel="nofollow" target="_blank"&gt;http://www.lcd-module.de/deu/dip/edip.htm&lt;/A&gt;) with a very slow SPI-Bus. So the data takes until 15 RTC-Loops to be sent. Therefore I have also a sendpointer and a end of string variable.&lt;/DIV&gt;&lt;DIV&gt;(I hope you can understand my bad English)&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Truk&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Oct 2006 02:13:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134587#M3736</guid>
      <dc:creator>Truk</dc:creator>
      <dc:date>2006-10-28T02:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Indexed adressing</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134588#M3737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Truk,&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;It all depends on whether you have&amp;nbsp;sufficient RAM available&amp;nbsp;for a 67 byte buffer.&amp;nbsp; You might find you can considerably reduce the size of the buffer if it&amp;nbsp;has to store the "variable" component of the data only, and not also the "fixed" component.&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;With the indexed message approach, as previously outlined, one of the messages can easily be allocated to the location of a RAM buffer, rather than a data table in flash.&amp;nbsp; You might also need to maintain a queue of the sequence of messages to be sent, but this is relatively easy to do if each message (or message component) is identified by means of a single byte index value.&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>Mon, 30 Oct 2006 00:57:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Indexed-adressing/m-p/134588#M3737</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-30T00:57:34Z</dc:date>
    </item>
  </channel>
</rss>

