0

High speed, pin-flexible SPI writes

Pt 101822

We’re working on speeding up our LPD8806 library (for massive installations) and wanted to share our nice-and-fast ‘bitbang’ SPI code for use with Arduinos. we use this whenever we have a display that needs fast updating, but don’t want to constrain the system to using the hardware SPI port! You can check it out on GitHub


Join 5,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython in 2018 – Python on Microcontrollers is here!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/


Maker Business — The first step in making: a PCB

Wearables — Try maximum twinkling

Electronics — Behold…the power of pseudocode.

Biohacking — All Day EEG Recording Tools

Python for Microcontrollers — PyCon US 2018 Rocked!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



1 Comment

  1. You can also use the counter variable as mask. This will make a better/smaller code:

    uint8_t mask;

    for (mask=0x80; mask!=0; mask>>=1) {
    *clkportreg &= ~clkpin;
    if(c & mask) {
    *mosiportreg |= mosipin;
    } else {
    *mosiportreg &= ~mosipin;
    }
    *clkportreg |= clkpin;
    }

    *clkportreg &= ~clkpin;
    // Make sure clock ends low

Sorry, the comment form is closed at this time.