<?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>serial communication&amp;amp;uVision2</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/13705/serial-communication-uvision2</link><description> I want to simulate a serial input from the keyboard PC. I have used the serial input window and when i press a key, uVision simulate a serial input, but.., how can i enter a several characters together?. 
The problem is tha it can&amp;#39;t be delays between</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: serial communication&amp;uVision2</title><link>https://community.arm.com/thread/36998?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2000 04:47:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2482bc58-1ce4-4188-a33c-f2b85c87646b</guid><dc:creator>William Hazelwood</dc:creator><description>&lt;p&gt;I assume you want to simulate a serial message as you may receive from another computer at a given baudrate.  If so, then try using a signal function.  There is an example of this on page 93 in the &amp;quot;dScope for Windows Users Guide&amp;quot; but it is not as clear as it could be.&lt;br /&gt;
&lt;br /&gt;
First, consider if you need to simulate the actual timing of the characters coming in.  Remember, characters will arrive at a different rate for different baudrates.  If you want to simulate this timing, you need to set STIME=1 and then you need to instruct the signal function how long to delay between each character using the twatch command.  If you&amp;#39;re not concerned about this timing, set STIME=0 and don&amp;#39;t worry about the twatch statements in the example below.&lt;br /&gt;
&lt;br /&gt;
The formula for calculating the arrival time of characters at various baudrates is (XTAL / clocks per machine cycle) / (BAUDRATE / bits transmitted per character).  Clocks per machine cycle is normally 12 although the Dallas chips can be set up to operate at 4 clocks per machine cycle.  Bits transmitted per character is 10 for asynchronous mode -- one start bit, eight data bits, and one stop bit.&lt;br /&gt;
&lt;br /&gt;
The following example will set up a pushbutton in a toolbox window named &amp;quot;Send Message&amp;quot;.  When pressed, it will send the message.  In this example, the message is a Modbus &amp;quot;Read Status&amp;quot; command but you can change this example to send any message you wish.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
STIME=1					/* Simulate serial timing */
XTAL = 11059200				/* Specify clock frequency */

define button &amp;quot;Send Message&amp;quot;,&amp;quot;send ()&amp;quot;	/* Set up pushbutton */

DEFINE INT baud				/* Define baudrate */
baud = 28800				/* change as needed */

signal void send (void)  {

     SIN = 0x11;			/* Send first character */
     twatch ((xtal/12)/(baud/10));	/* Delay for one character time */

     SIN = 0x02;			/* Send second character */
     twatch ((xtal/12)/(baud/10));	/* Delay for one character time */

     SIN = 0x00;			/* and so on */
     twatch ((xtal/12)/(baud/10));

     SIN = 0x00;	
     twatch ((xtal/12)/(baud/10));

     SIN = 0x00;
     twatch ((xtal/12)/(baud/10));

     SIN = 0x20;	
     twatch ((xtal/12)/(baud/10));

     SIN = 0x7B;
     twatch ((xtal/12)/(baud/10));

     SIN = 0x42;
     twatch ((xtal/12)/(baud/10));
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>