Shift register 74HC595D pin 7(QH) not working?


It might be a problem with the code, so I’m unsure if this thread is placed wrongly in the hardware section. But the issue we’ve got might as well be related to our poor understanding of the shift register we’re working with (74HC595D).

We’re using the ShiftRegister class from the jane examples on a slight modification og the Jane board, and have also tried with a simple breakout version of the setup. It seems we can’t figure out how to turn on pin 7(QH).
The code below should turn every pin on and off from 1-8, but the last pin remain low. What could be the problem here? Is there some pin 7 specific conditions we’ve missed?

See circuit below. Thanks!

`class ShiftRegister {

spi             = null;     // SPI interface for shift register
sr_output_en_l  = null;     // output enable for shift register
channelStates   = 0x00;     // Byte to store current state of sprinkler channels

constructor(_spi, _sr_output_en_l) {
    this.spi            = _spi;
    this.sr_output_en_l = _sr_output_en_l;

function setChannel(channel, state) {
    if ((channel < 0) || channel > 8) return;
    if (state) {
        this.channelStates = this.channelStates | (0x01 << channel);
    } else {
        this.channelStates = this.channelStates & ~(0x01 << channel);
    // dispable the output and write the data out to the shift register
    // enable the output

function stopAllChannels() {
    this.channelStates = 0x00;
    // dispable the output and write the data out to the shift register
    // enable the output


spi_ifc <- hardware.spi257;
sr_output_en_l_pin <- hardware.pin2;

spi_ifc.configure(SIMPLEX_TX | MSB_FIRST | CLOCK_IDLE_HIGH, 4000);

local state = 0;

function test_pins() {

state = 1-state;

for(local i = 1; i <= 8; i++) {
    server.log(i + " state: " + state);
    valve.setChannel(i, state);

imp.wakeup(3, test_pins);



Looks like the same topic is being discussed over here.