Shouldn't you take OE low immediately after taking it high? The data sheet 
states that it is a pulse rather than it existing as a state for a long period 
of time. Taking it high copies the state from the shift registers to the latch. 
Taking it low latches the data. 

> On May 16, 2017, at 8:06 AM, SWISSNIXIE - Jonathan F. <[email protected]> 
> wrote:
> 
> Glad you made it work! :) 
> 
> Here is my version for the HV5122/HV5222 - note this has no "POL", but since 
> POL is static as BL, it is not a problem of code.
> 
> My code takes care of 2 chips, and uses standart hardware pins, i had to get 
> rid of "digitalWrite()" since its to slow.
> 
> 
> //*********************************************
> #define thePort PORTD //define Hardware port where Shift-Registers are 
> connected
> #define DATA PD5 //define Dataline
> #define OE 6 //define latch pin
> #define CLK PD7 //define clockline
> 
> void setOutputs(unsigned long val_one, unsigned long val_two) { //Function to 
> shift out 2 x 32bit fast enough to prevent flicker!
> 
> // ------------WARNING!--------------------
> // This functions operates directly on ports, not via digitalWrite()
> // because digitalWrite() would be to slow, and display would flicker
> // if different pins are used, you maybe hav to change the variable "thePort"
> // to the matching I/O port letter of the controller!
> 
> digitalWrite(OE, LOW); //Disable Outputs to prevent flicker
> 
> //Send first 32-bit variable value
> 
> for (int i = 0; i < 32; i++) {
> thePort &= ~_BV(DATA); //Data LOW
> if ( bitRead(val_one, i) == 1) {
> thePort |= _BV(DATA); //Data HIGH
> }
> thePort |= _BV(CLK); //CLK HIGH
> thePort &= ~_BV(CLK); //CLK LOW
> }
> 
> //Send second 32-bit variable value
> for (int i = 0; i < 32; i++) {
> thePort &= ~_BV(DATA); //Data LOW
> if ( bitRead(val_two, i) == 1) {
> thePort |= _BV(DATA); //Data HIGH
> }
> thePort |= _BV(CLK); //CLK HIGH
> thePort &= ~_BV(CLK); //CLK LOW
> }
> digitalWrite(OE, HIGH); //Enable Outputs
> 
> }
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "neonixie-l" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/neonixie-l/S1oX30hLrmw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/neonixie-l/e642c57a-8043-482c-bd64-1cddd8388ee5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"neonixie-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/neonixie-l/B0EBB8F8-1CD8-4BB1-A14B-993DCF52C84B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to