Shop OBEX P1 Docs P2 Docs Learn Events
gcc toolchain on Ubuntu and quickstart board -- success — Parallax Forums

gcc toolchain on Ubuntu and quickstart board -- success

manitoumanitou Posts: 29
edited 2012-08-22 05:35 in Propeller 1
Built various demos on Ubuntu 12.04 with QuickStart board. Here is simple C program to read buttons and turn on touched LEDs.

// quickstart board  resistive buttons 0-7   LEDs 16-23
//   bring pad HIGH, touching button brings it LOW
#include <propeller.h>
#define BUTTONS (0xff)
#define LEDS (0xff<<16)

int main() {
    DIRA |= BUTTONS | LEDS;   // output
    OUTA |= BUTTONS;   // bring high
    while(1) {
        DIRA |= BUTTONS;   // output
        DIRA &= ~BUTTONS;  // input mode
        waitcnt(CNT + CLKFREQ/1000); // ms wait
        OUTA &=  ~LEDS; // clear LEDs
        OUTA |=  ((~( INA & BUTTONS)) << 16) & LEDS; // in,flip,shift,mask
    }
    return 0;
}


I got all of the fibo demos to work excpet xmm?? -- it loaded but nothing was printed to terminal ?? (xmmc worked)

Here are some simple "speed" tests.
How fast can I read CNT (e.g. t1=CNT; t2= CNT-t1; )
gcc 16 cycles
catalina-3.6 112 cycles (with external CNT)
spin 368 cycles
presumably PASM could do it in 4 cycles.

recursive fibonacci (fibo(26))
catalina 3.6 5342 ms
gcc cog 486 ms
gcc lmm 927 ms
arduino uno (16MHz) 32-bit int's 927 ms
maple (72MHz) 104 ms
beaglebone (720MHz) 8.2 ms
ubuntu/i3-2370M (2.4GHz) 1.2ms
MD5 (KBs == 1024 bytes/second)
spin 7 KBs catalina 84 KBs gcc 222 KBs (lmm)
arduino 48 KBs
maple 1937 KBs
beaglebone 13755 KBs
ubuntu 187958 KBs

Comments

Sign In or Register to comment.