<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>sbit ptr? (best method for port and bit identification)</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14464/sbit-ptr-best-method-for-port-and-bit-identification</link><description> Dear all, 
 
My board will have several inputs connected to P0-P3. The PC will instruct the microcontroller using RS232, to monitor some of the inputs. 
 
The communication between the PC and the 8051 will be somewhat like below: 
 
 
PC-&amp;gt;8051: 
 count</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: sbit ptr? (best method for port and bit identification)</title><link>https://community.arm.com/thread/94856?ContentTypeID=1</link><pubDate>Mon, 22 Oct 2001 20:25:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2b6400b0-8510-4889-b16c-1a3d6f64b082</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;Ahhh.  If you pass the Port information to a program that is already compiled and linked then you must do something like the switch statement.&lt;br /&gt;
&lt;br /&gt;
I seem to recall that someone did something similar but either they use von Neuman RAM and wrote the instruction to XDATA (and executed it from CODE) or created an assembly switch that was really efficient.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sbit ptr? (best method for port and bit identification)</title><link>https://community.arm.com/thread/53910?ContentTypeID=1</link><pubDate>Sun, 21 Oct 2001 13:36:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:780ef4c9-6387-4635-8940-bac4355e9d51</guid><dc:creator>Bahri Okuroglu</dc:creator><description>&lt;p&gt;Jon,&lt;br /&gt;
&lt;br /&gt;
Thanks for the reply. Your link gives a method for libraries which needs access to extarnal SFRs. &lt;br /&gt;
&lt;br /&gt;
As another document says, the structure I described if impossible to do. See below:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;C51: GENERAL PURPOSE SFR INTERFACE&amp;quot; (&lt;a href="http://www.keil.com/support/docs/185.htm"&gt;http://www.keil.com/support/docs/185.htm&lt;/a&gt;)&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sbit ptr? (best method for port and bit identification)</title><link>https://community.arm.com/thread/37959?ContentTypeID=1</link><pubDate>Fri, 19 Oct 2001 17:25:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c59a5a7a-2da6-4708-a523-ce884d5c2703</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;Take a look at the following knowledgebase article.  It allows you to access a generic SFR or SBIT whose value is not known at compile time.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.keil.com/support/docs/98.htm"&gt;http://www.keil.com/support/docs/98.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sbit ptr? (best method for port and bit identification)</title><link>https://community.arm.com/thread/94862?ContentTypeID=1</link><pubDate>Fri, 19 Oct 2001 05:12:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f36626aa-e171-498d-b536-81dc1a44d800</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;I&amp;#39;m not familiar with the 8051 instruction set since I&amp;#39;m working with C166. But assuming that there is no difference between them in this regard it&amp;#39;s impossible to define an array of bits or a pointer to a bit (simply because there are no CPU instructions to support this).&lt;br /&gt;
If I tryed to implement the same thing with C166 and was concerned about speed, I would build port-scanning code somewhere in RAM (on the fly, during program execution) and pass control there. Thus I would be able to do whatever testing I wanted at maximum speed.&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sbit ptr? (best method for port and bit identification)</title><link>https://community.arm.com/thread/53909?ContentTypeID=1</link><pubDate>Fri, 19 Oct 2001 04:24:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a6f672cf-2e80-4648-ab5c-6417b7dd5a13</guid><dc:creator>Bahri Okuroglu</dc:creator><description>&lt;p&gt;Mike, &lt;br /&gt;
&lt;br /&gt;
You&amp;#39;re right, this is the way I use in some programs. But this time, CPU&amp;#39;s main job will be scanning the given ports and your solutions takes too much realtime from the system. &lt;br /&gt;
&lt;br /&gt;
If there exist a simpler method, sampling rate of the inputs will increase automatically.&lt;br /&gt;
&lt;br /&gt;
Besides these, is it possible to define a sfr/sbit array?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sbit ptr? (best method for port and bit identification)</title><link>https://community.arm.com/thread/37958?ContentTypeID=1</link><pubDate>Fri, 19 Oct 2001 04:10:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:811db6c5-5996-41ed-a674-3a61945984a1</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;(Empty)&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>