Shop OBEX P1 Docs P2 Docs Learn Events
Speed.. Propeller vs. Arduino Micro — Parallax Forums

Speed.. Propeller vs. Arduino Micro

tj4sheetj4shee Posts: 25
edited 2015-02-21 17:46 in Propeller 1
Really hoping someone can help me understand the problem... or at least the reasoning....

I have a 0.96 " 128x96 pixel single color OLED with an SSD1306 chip... attached via I2C... I have ported the Adafruit libraries over to SimpleIDE.

Here are the 2 platforms being compared.... both running pretty much the same C code and using I2C.

Prop Prof Dev board... Prop1 with a 6.25 MHz Crystal.... running at 100 MHz with PLL16x
Freeduino with ATmega328u4 and 16 MHz crystal

the Freeduino is running MUCH faster... I have not yet gotten times on the both of them... but it is very discernible.

The way data is updated and transferred to the SSD1306 is via a complete rewrite of the screen buffer... from a char array maintained and updated by the C program.

Any one have any ideas ? I would really like to get the graphics running quicker using the propeller.

Thanks.... TJ

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-21 10:32
    The Arduino has a hardware I2C driver and the Propeller's I2C is done in software.

    While C is faster than Spin, in order to get real speed from the Propeller you need to use a PASM driver for the low level I2C communication.

    I've used the SSD1306 with an fast PASM SPI driver but I haven't adapted the driver to I2C.

    My version of the OLED code (with an even faster SPI driver than the OBEX version) is attached to the following post.

    http://forums.parallax.com/showthread.php/157136-Interesting-little-4-digit-LCD-TINY-display!?p=1290092&viewfull=1#post1290092

    There are PASM versions of I2C drivers and I think it's possible to combine PASM with C but I don't know how to do this.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-02-21 10:34
    The Arduino has dedicated I2C hardware which will be very fast. To get similar speeds out of the Propeller with I2C, I think you'll need a dedicated I2C driver cog. I have no idea how to do this in C, but I've done in it PASM for an EEPROM loader project.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-21 10:39
    A 100Mhz Prop is executing it's native instructions at 25Mhz.
    C code compiled to LMM is probaly executing it's "instructions" at a quarter of that, 6.26MHz.
    That may be comparable to the Freedino execution rate.

    Anyway, we need more info. What is the actual speed difference. And ultimately show us the code.

    Without seeing exactly what you are doing nobody can suggest any optimizations.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-02-21 17:46
    libpropeller's I2C implementation defaults to the I2C maximum frequency of 400kHz. You might try replacing whatever I2C implementation you're using on the Propeller with libpropeller's version.

    The link above is just API documentation. See here for original libpropeller source code.
Sign In or Register to comment.