For the SPI I have the following in my sketch:

#include <SPI.h>

In setup:

  // set up SPI
  SPI.begin();
  SPI.setFrequency(100000);
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE1);
  //set outputs for SPI
  pinMode(LEpin, OUTPUT);


Then, I have the following code that, in my case, is writing two 32 bit 
variables ( j and k ) out to the shift registers via SPI:

 //SPI transfer code 

  digitalWrite(LEpin, LOW);
  


//send K out 
  SPI.transfer((k >> 24) & 0xff);
  SPI.transfer((k >> 16) & 0xff);
  SPI.transfer((k >>  8) & 0xff);
  SPI.transfer(k & 0xff);
  
//send J out 
  SPI.transfer((j >> 24) & 0xff);
  SPI.transfer((j >> 16) & 0xff);
  SPI.transfer((j >>  8) & 0xff);
  SPI.transfer(j & 0xff);

  
  digitalWrite(LEpin, HIGH);


There may well be a 32 bit Spi transfer but I was modifying older shiftout 
based code so stuck with what I was doing previously, YMMV.


On a Wemos D1, when using SPI,  I believe that you are tied to using:

D5 for Clock
D6 for Strobe
D7 for Data

I also run the HV5622's as 12V logic levels (keeping within spec) by using 
CD40109 level shifters, it all works really well.

Please let us know how you get on.

- Richard



On Wednesday, 22 July 2020 08:38:47 UTC+1, Owen Crawford wrote:
>
> Hi Richard,
>
> You mentioned you have a working solution to digit fading?
> I am pretty much in the position with designing a Nixie clock using the 
> HV5622 chips. I have worked out most of the PCB design and got a few 
> prototypes boards made up.
> The HV5622 chips are in series and I've managed to make up some code in 
> Arduino IDE and can control individual pins/digits using ShiftOut() which 
> is inherently a bit slow with moving data to the registers.
> I made up a fade table to quickly transition back and forth between the 
> previous and next digit to give the illusion of cross-fading.
> This worked well for the most part, until I have more than 1 digit fading, 
> then the latency starts to become more noticeable and the digits star to 
> flicker in transition.
> After countless hours of reading, SPI seems to be the way to go as it's 
> way faster to shift data out, however I am still in the middle of working 
> out how to use SPI with the HV5622 registers and Arduino as I'm just 
> getting random digits appearing all over the place.
> I guess the next step after that was working out how to cross fade digits. 
> Would you be so kind with sharing what you came up with? Better than trying 
> to re-invent the wheel :)
>
> Thank you.
>
> / Owen
>
> On Sunday, 3 May 2020 at 18:06:15 UTC+10 Dekatron42 wrote:
>
>> There's another way of dimming/fading described in this thread with 
>> source code on Github -  not mine, just remembered it.
>>
>>
>> https://groups.google.com/forum/#!searchin/neonixie-l/fading$20table%7Csort:date/neonixie-l/bh7kymv2xQA/MogsmOnHAgAJ
>>
>> /Martin
>>
>

-- 
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 view this discussion on the web, visit 
https://groups.google.com/d/msgid/neonixie-l/e514d49d-6a36-4042-a5bb-fc1efdd11d11o%40googlegroups.com.

Reply via email to