<?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>multitasking in ARM7</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/26332/multitasking-in-arm7</link><description> 
hello, 

 
can I do multitasking in ARM LPC2148. 
I want to display on LCD, LED and 7segment at the same time. 

 
is it possible????? 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/144833?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2010 19:25:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:69dec40f-bd89-4b72-8b9d-2b54bae2a919</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
The above code which I posted, is a [low quality] demonstration
for:&lt;br /&gt;
&lt;i&gt;A simple supervisory loop processing each module would almost
certainly be sufficient.&lt;/i&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/142583?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2010 19:17:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f7861006-3c9b-49c3-a737-223fcc56b248</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;pre&gt;
void Timer0Handler (void) __irq
{
  timer_counter++;

  if ( timer_KEYpress != 0 )
    timer_KEYpress--;
  else
    KEYS_check();

  if ( timer_GPIO8LED != 0 )
    timer_GPIO8LED--;

  if ( timer_MSPI7LED != 0 )
    timer_MSPI7LED--;

  T0IR = 1;                     /* clear interrupt flag */
  VICVectAddr = 0;              /* Acknowledge Interrupt */
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/139512?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2010 19:01:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c6f9470a-b951-4fb6-a309-541f8fde29be</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;pre&gt;
void GPIO8LED_show(void)
{
        static BYTE GPIO8LED_on = 1;
        static BYTE GPIO8LED_i = 0;

        if ( ( timer_GPIO8LED == 0 ) &amp;amp;&amp;amp; ( GPIO8LED_show_on ) )
        {
                if (GPIO8LED_on)
                {
                        IOSET1 = ~( LED8SET &amp;amp; ( 7 &amp;lt;&amp;lt; (18+GPIO8LED_i) ) );
                }
                else
                {
                        IOCLR1 = LED8SET &amp;amp; ( 7 &amp;lt;&amp;lt; (18+GPIO8LED_i) );
                        if ( GPIO8LED_i == 7 )
                                { GPIO8LED_i = 0; }
                        else
                                { GPIO8LED_i++; }
                }
                GPIO8LED_on = 1 - GPIO8LED_on;
                timer_GPIO8LED = 8;
        }
}


void MSPI_init(void)
{
        //PINSEL0 = (PINSEL0 &amp;amp; 0xFFFF00FF) | 0x00005500;    // Connect SPI
        PINSEL0 = (PINSEL0 &amp;amp; (~(0xFF &amp;lt;&amp;lt; 8))) | (0x55 &amp;lt;&amp;lt; 8) ;
        IODIR0  = HC595_CS;
    S0SPCCR = 0x52;                         // Set SPI Clock
        S0SPCR  = (0 &amp;lt;&amp;lt; 3) |                      // CPHA = 0, [del]
                          (1 &amp;lt;&amp;lt; 4) |                      // CPOL = 1, SCK [del]
                          (1 &amp;lt;&amp;lt; 5) |                      // MSTR = 1, SPI [del]
                          (0 &amp;lt;&amp;lt; 6) |                      // LSBF = 0, SPI [del]
                          (0 &amp;lt;&amp;lt; 7);                               // SPIE = 0, [del]
}


void MSPI7LED_show(void)
{
        static BYTE MSPI7LED_i = 0;
        BYTE const HEX_TAB[16] = {
        //     0     1     2     3     4     5     6     7     8     9
                0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90,
        //         A     b     C     d     E     F
                0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E };

        if ( ( timer_MSPI7LED == 0 ) &amp;amp;&amp;amp; ( MSPI7LED_show_on ) )
        {
                IOCLR0 = HC595_CS;                              // 74HC595
                SPI_SPDR = HEX_TAB[MSPI7LED_i];
                while( 0 == (SPI_SPSR &amp;amp; 0x80) );            // Wait
                IOSET0 = HC595_CS;
                if ( MSPI7LED_i == 15 )
                        { MSPI7LED_i = 0; }
                else
                        { MSPI7LED_i++; }
                timer_MSPI7LED = 95;
        }
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/136088?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2010 18:56:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bbf89829-0757-4052-9e7c-0b7048c34238</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
I wrote this at 2008.Nov.04 =&amp;gt;&lt;/p&gt;

&lt;pre&gt;
int main (void)
{
        char LFnCR[] = &amp;quot;\n\r&amp;quot;;

    init_VIC();
    UARTInit(9600);     /* baud rate setting */
        init_timer();

        enable_timer(0);

        PINSEL2 = PINSEL2 &amp;amp; (~0x08);    // for GPIO 8LED
        IODIR1  = LED8SET;              // for GPIO 8LED

        MSPI_init();

    while (1)
    {                           /* Loop forever */

                GPIO8LED_show();

                MSPI7LED_show();

                UART0rbREAD();

                if (cmd_ready)
                {
                        UART0sbWRITE( (BYTE *)cmd_string, strlen((const char *)cmd_string) );
                        UART0sbWRITE( (BYTE *)LFnCR     , 2 );
                        UART0sendKICK();
                        memset( cmd_string, 0x00, 32 );
                        cmdstr_i = 0;
                        cmd_ready = 0;
                }

                KEYS_control();

    }
        // return 0;
}


void KEYS_check(void)
{
        IOPIN0_last = IOPIN0_this;
        IOPIN0_this = IOPIN0;

        IOPIN0_stat = IOPIN0_last ^ IOPIN0_this &amp;amp; IOPIN0_last;

        if ( ( IOPIN0_stat &amp;amp; KEY1 ) == KEY1 )
                KEY1_pressed = 1;

        if ( ( IOPIN0_stat &amp;amp; KEY2 ) == KEY2 )
                KEY2_pressed = 1;

        if ( ( IOPIN0_stat &amp;amp; KEY3 ) == KEY3 )
                KEY3_pressed = 1;

        if ( ( IOPIN0_stat &amp;amp; KEY4 ) == KEY4 )
                KEY4_pressed = 1;

        if ( ( IOPIN0_stat &amp;amp; KEY5 ) == KEY5 )
                KEY5_pressed = 1;

        if ( ( IOPIN0_stat &amp;amp; KEY6 ) == KEY6 )
                KEY6_pressed = 1;

        timer_KEYpress = 2;
}


void KEYS_control(void)
{
        static BYTE GPIO8LED_pos = 1;
        static BYTE MSPI7LED_pos = 0;
        BYTE const HEX_TAB[16] = {
        //     0     1     2     3     4     5     6     7     8     9
                0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90,
        //         A     b     C     d     E     F
                0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E };

        if ( KEY1_pressed == 1 )
        {
                GPIO8LED_show_on = 1 - GPIO8LED_show_on;
                KEY1_pressed = 0;
        }

        if ( KEY4_pressed == 1 )
        {
                MSPI7LED_show_on = 1 - MSPI7LED_show_on;
                KEY4_pressed = 0;
        }

        if ( GPIO8LED_show_on == 0 )
        {
                if ( KEY2_pressed == 1 )
                {
                        if ( GPIO8LED_pos &amp;gt; 1 )
                                GPIO8LED_pos--;
                        KEY2_pressed = 0;
                }
                if ( KEY3_pressed == 1 )
                {
                        if ( GPIO8LED_pos &amp;lt; 8 )
                                GPIO8LED_pos++;
                        KEY3_pressed = 0;
                }
                IOCLR1 =    1 &amp;lt;&amp;lt; (17+GPIO8LED_pos)  ;
                IOSET1 = ~( 1 &amp;lt;&amp;lt; (17+GPIO8LED_pos) );
        }

        if ( MSPI7LED_show_on == 0 )
        {
                if ( KEY5_pressed == 1 )
                {
                        if ( MSPI7LED_pos &amp;gt; 0 )
                                MSPI7LED_pos--;
                        KEY5_pressed = 0;
                }
                if ( KEY6_pressed == 1 )
                {
                        if ( MSPI7LED_pos &amp;lt; 15 )
                                MSPI7LED_pos++;
                        KEY6_pressed = 0;
                }
                IOCLR0 = HC595_CS;
                SPI_SPDR = HEX_TAB[MSPI7LED_pos];
                while( 0 == (SPI_SPSR &amp;amp; 0x80) );
                IOSET0 = HC595_CS;
        }
}



&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/126049?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2010 03:14:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:446a9f44-8569-4305-8e1f-1e75fc86d93d</guid><dc:creator>IB Shy</dc:creator><description>&lt;p&gt;&lt;p&gt;
As Andy has already mentioned, multitasking is not necessary for
what you&amp;#39;ve described.&lt;/p&gt;

&lt;p&gt;
A simple supervisory loop processing each module would almost
certainly be sufficient.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/115624?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2010 02:26:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b9bb387d-1f65-4c13-9dcd-a40ac317b9ba</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Search keil forum for &amp;quot;RTX&amp;quot;. Also inspect your &amp;quot;Options for
target...&amp;quot;, Target page (&amp;quot;operating system&amp;quot;).&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/102105?ContentTypeID=1</link><pubDate>Sat, 20 Mar 2010 23:17:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ffc66981-2057-412d-a7b6-ca00e8095f7b</guid><dc:creator>mark bond</dc:creator><description>&lt;p&gt;&lt;p&gt;
do I need to install some operating system like real time
Linux???&lt;/p&gt;

&lt;p&gt;
I am working with LPC2148. In this project, I am displaying data
on LCDs which is continuously changing. also I want to read input
ports.&lt;/p&gt;

&lt;p&gt;
can it be done like operating system working??? one program for
checking i/p ports and second to display data on LCDs. only one is
executing for fixed time and after timeout storing its status on
stack and second is executing for fixed time..&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/102108?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2010 09:55:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1a3cc93c-75db-4258-b45f-ae3ad6254d56</guid><dc:creator>Marco Catellani</dc:creator><description>&lt;p&gt;&lt;p&gt;
Almost every microcontroller can do it.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/90312?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2010 07:25:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:80fe1525-1df3-4a0e-8191-6eefe3d3c4f9</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Of course it&amp;#39;s possible - even an 8051 can do it!&lt;/p&gt;

&lt;p&gt;
But it certainly isn&amp;#39;t &lt;i&gt;necessary&lt;/i&gt; just for what you&amp;#39;ve
described!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: multitasking in ARM7</title><link>https://community.arm.com/thread/57936?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2010 07:07:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f47c2f14-8083-4db3-8a10-d236e370d58d</guid><dc:creator>Mike Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;is it possible?????&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Yes, it is.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>