• I recently picked up an older network switch, 26 port, from the town dump. Like most quality network switches, it had an array of LEDs to show the status of every port. 2 LEDs per port, plus a few other status LEDs - close to 64 LEDs.

    Well, that's cute, but what use is it... How do they control all those LEDs anyway?

    Oh - with 74HC595's, like anyone else would...

    I know how to use those! A bit of prodding around with an ohm meter got me the pinout, and I wired it up to an external power supply and an Espruino Pico

    ST_CP -> B8 (GPIO)
    SH_CP -> A5 (SCK)
    DS -> A7 (MOSI)
    MR -> A8 (GPIO)
    Gnd -> Espruino Ground, external supply ground
    Vcc -> Ext. supply +3.3v

    Powered it up off an external supply, and a little experimentation with SPI and:

    
    >SPI1.setup({mosi:A7,sck:A5});
    =undefined
    >digitalWrite([A8,B8],0);
    =undefined
    >digitalWrite(A8,1);
    =undefined
    >digitalPulse(B8,1,5);
    =undefined
    >function WriteLEDs(x){SPI1.send(x); digitalPulse(B8,1,5);}
    =function (x) { ... }
    >WriteLEDs([255-8-64,255-66,255-18,255-8-64,255-66,255-18,255-16-64-1,255-4]);
    
    

    Whole thing took only a few minutes once I had figured out the pinout

About

Avatar for DrAzzy @DrAzzy started