| Electronics > Beginners |
| Help Troubleshooting Nixie Tube Display Project - Based on EEVBlog #952 |
| (1/2) > >> |
| alex1683:
Hello, young player here, I was inspired by Dave's video series on his Nixie tube sub-counter 2 years back and finally got around to giving it a whirl. I got some PCB's made, assembled a board, wrote up some Arduino code and it doesn't quite work :-[. Spent several hours trying to troubleshoot it last night but couldn't figure it out. Don't know where to go from here, figured this is the right place to ask. The first shift register works fine but the next three do not. Maybe there is something I don't understand about how cascading works? I'm using the same circuit as Dave with TPIC6B595's, (Pictures attached, sorry if it's ugly). Here's the relevant code: --- Code: ---void send_data(unsigned long encodedData){ for(int i=31; i>=0; i--){ digitalWrite(DIN, encodedData&(ONE<<i)); digitalWrite(DCK,HIGH); digitalWrite(DCK,LOW); } digitalWrite(RCK,HIGH); digitalWrite(RCK,LOW); return; } --- End code --- There are 4 shift registers, 8 bits each so I'm storing the word as a 32 bit unsigned int. I write the 32 bits from MSB to LSB while clocking DCK. At the end I pulse RCK. DIN is the pin connected to SERIN on the first shift register. DCK is the pin connected to shift register clock (SRCK) RCK is the pin connected to the register clock (I think it's also known as the latch?) I did some continuity testing and didn't find any problems, also checked the second chip is getting 5V power. Any ideas for what could be wrong? What I should check next? Thanks for your time, Alex |
| Andy Watson:
I'm not familiar with Arduino code but I would question whether "digitalWrite( )" is doing what you expect when it's passed an unsigned long. Also, you might want to initialise RCK and DCK to low prior to starting the loop. |
| janoc:
You may want to put some delay between the digitalWrites. Otherwise the microcontroller will generate only a very narrow pulse (defined by how much (in)efficient the library code is) and that may be very marginal for the shift registers. The chips may not be able to switch that fast - the first one could be just able to catch the pulse and the others not. |
| NivagSwerdna:
"Data transfers through the shift and storage registers on the rising edge of the shift-register clock (SRCK) and the register clock (RCK), respectively." LOW -> HIGH You should not need any delays. I would do a... (encodedData&(ONE<<i) ? 1 : 0) just to be on the safe side... or re-write as a shift. |
| alex1683:
--- Quote from: janoc on January 20, 2019, 06:04:42 pm ---You may want to put some delay between the digitalWrites. Otherwise the microcontroller will generate only a very narrow pulse (defined by how much (in)efficient the library code is) and that may be very marginal for the shift registers. The chips may not be able to switch that fast - the first one could be just able to catch the pulse and the others not. --- End quote --- All the datasheet timing specification are in nanoseconds. I originally had 50 microseconds between setting the data pin high/low and the rising edge of SRCLK, and between the last SRCLK and the RCK/latch pulse. Do you have a suggestion for a delay length? --- Quote from: NivagSwerdna on January 20, 2019, 06:13:29 pm ---"Data transfers through the shift and storage registers on the rising edge of the shift-register clock (SRCK) and the register clock (RCK), respectively." LOW -> HIGH You should not need any delays. I would do a... (encodedData&(ONE<<i) ? 1 : 0) just to be on the safe side... or re-write as a shift. --- End quote --- I'll give that a try and get back to you. |
| Navigation |
| Message Index |
| Next page |