<?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>External memory in SPC3</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/18125/external-memory-in-spc3</link><description> Dear all, 
 
The Siemens Profibus Controller (SPC3), connected to a T89C51RD2 via P0 (multiplexed) and P2, has in its first few addresses registers/latches which I have to set in order to start using it. I believe the SPC to be wired to begin at 0x8000</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: External memory in SPC3</title><link>https://community.arm.com/thread/111151?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2004 11:24:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d8dc9e22-df0a-45da-97b8-779fa6a069b7</guid><dc:creator>ping ooi</dc:creator><description>&lt;p&gt;Hi Andrew,&lt;br /&gt;
&lt;br /&gt;
Below is the relevant part of the generated assembler code. Pls excuse and correct my bad programming. But in particular, I would like to find out why it didnt work. Thanks and much appreciated.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
;   for(aaa=0x0000; aaa&amp;lt;=0xFFFF; aaa++){ //addresses 0000h to FFFFh
			; SOURCE LINE # 32
	CLR  	A
	MOV  	aaa?040,A
	MOV  	aaa?040+01H,A
?C0003:
;   bbb = ((XBYTE[aaa] &amp;gt;&amp;gt; 4) &amp;amp; 0x0F)+0x30; //higher 4 bits into ASCII 0-9
			; SOURCE LINE # 32
	MOV  	DPL,aaa?040+01H
	MOV  	DPH,aaa?040
	MOVX 	A,@DPTR
	SWAP 	A
	ANL  	A,#0FH
	ADD  	A,#030H
	MOV  	bbb?041,A
;   if((bbb &amp;amp; 0x0F)&amp;gt;=0xA){ //ASCII A-F
			; SOURCE LINE # 33
	ANL  	A,#0FH
	CLR  	C
	SUBB 	A,#0AH
	JC   	?C0006
;   bbb += 0x7;
			; SOURCE LINE # 34
	MOV  	A,#07H
	ADD  	A,bbb?041
	MOV  	bbb?041,A
;   }
			; SOURCE LINE # 35
?C0006:
;   putchar(bbb);   //outputs higher 4 bits in ASCII to hyperterminal
			; SOURCE LINE # 36
	MOV  	R7,bbb?041
	ACALL	_putchar
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External memory in SPC3</title><link>https://community.arm.com/thread/96688?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2004 17:31:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0d1fdb39-1d98-44c0-b9fb-0c811c0bfde8</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;rather that XBYTE, couldn&amp;#39;t you define some meaningfully-named variables using &lt;b&gt;_at_&lt;/b&gt;?&lt;br /&gt;
&lt;br /&gt;
In either case, what does the generated assembler look like?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External memory in SPC3</title><link>https://community.arm.com/thread/72840?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2004 17:17:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:85b05b15-1c33-48c9-91ad-31722bd672a7</guid><dc:creator>ping ooi</dc:creator><description>&lt;p&gt;Jay,&lt;br /&gt;
&lt;br /&gt;
Yes, I understand how ALE is supposed to work. That&amp;#39;s what is meant by multiplexing, right? I&amp;#39;m assuming that there&amp;#39;s an address latch built into the SPC3, as it has an input-only ALE pin.The hardware description from Siemens unfortunately does not elaborate much on this.&lt;br /&gt;
To my best understanding, this is how I think it should work: During the command putchar(XBYTE[0x0004]), P0 emits &amp;#39;04&amp;#39;, P2 emits &amp;#39;00&amp;#39; ALE pulse latches the address, strobe RD, content from address 0x0004 in SPC3 is read and passed onto the UART.&lt;br /&gt;
&lt;br /&gt;
my actual code is of course not as simple as putchar(XBYTE[0x0004]), as I have to take into consideration that the output in hyperterminal is in ASCII.&lt;br /&gt;
&lt;br /&gt;
The main point is, the output I&amp;#39;m seeing on my hyperterminal is the address and not the content at this address. Why is that so? What did I miss out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External memory in SPC3</title><link>https://community.arm.com/thread/43074?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2004 13:36:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:17c7c85f-5d9a-4e13-a9cc-99cd31412664</guid><dc:creator>Jay Daniel</dc:creator><description>&lt;p&gt;Ping,&lt;br /&gt;
&lt;br /&gt;
   Are you accounting for the multiplexed nature of the 8051 architecture bus?  In other words, do you have an address latch?  AD0-AD7 first emit the address, then toggle ALE (address latch enable) to have your address latch hold it.  Then they emit the data and strobe WR for writes.  Does this not match what you&amp;#39;re seeing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>