ShiftOut () with dual triggered shift registers

Hi There,

Can ShiftOut () fuction be used with dual triggered (falling and rising edges) shift registers ?

thanks!

What shift register are you using?... You can certainly set the ShiftOut() to be compatable with your device if its falling or rising edge

Hi Danzelfin

Setting the clkpin HIGH or LOW is for the case where the circuit is triggered either on the rising or falling edge only, but my circuit is custom designed IC which is triggered at both edges (DDR) .

Look at the code for shiftOut(). It is straight-ahead and there for you to...

I think you need to custom design a function to go with your unusual custom designed IC.

void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
      uint8_t i;

      for (i = 0; i < 8; i++)  {
            if (bitOrder == LSBFIRST)
                  digitalWrite(dataPin, !!(val & (1 << i)));
            else      
                  digitalWrite(dataPin, !!(val & (1 << (7 - i))));
                  
            digitalWrite(clockPin, HIGH);
            digitalWrite(clockPin, LOW);            
      }
}

HTH

a7

I would try changing to:

            digitalWrite(clockPin, ! digitalRead(clockPin));

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.