What I have is an input clock for two shift registers (74HC165) that are connected in series. The clock input is used to clock the data out. I have 16 dip switches setting the data that is being parallel loaded into the shift registers.
The function of the Arduino is to count the clock pulses and trigger the Load pin on both 74HC165's. This is done through a transistor as the base is controlled by the Arduino and the LD pin is connected to the collector which is held high. When the base is triggered it connects the collector to ground through the emitter.
My input clock is at a period of 4.8us. The code should trigger every 16 rising edges.
Since my code is on another machine and I had a printout I had to type in manually. if there are any compile errors this should be my copying and not the code as I can compile and run the code.
I have taken the Arduino out of the loop and it works with a slower clock and a momentary push button but sadly I can't press the button as quick as I need to for the correct clock.
what I see on the scope is that the shift register is being loaded but is not synced with the clock. The bits being outputted from the shift register are not in time with what would be the correct pulses from the clock.
For example the first clock pulse should align with the first bit and so on. as there are 16 bits and 16 clock pulses.
I feel like my UNO is not fast enough. I have looked and searched on google taking things from the Gammon Forum but still with no really advancement on what I have wrote above.
On another point what about a counter that was hardware instead of software?
A due would be my next step but I am trying to keep it within the realms of small and package-able, I will venture down the hardware route or maybe even a different chip.
I do take it from the permission grated status that the due would be viable? Just to confirm
I see, maybe you misunderstood, just so we are clear the error is on my part first. I stupidly assumed, and assuming is stupid. That by your reply
PaulS:
You have our permission to do just that.
this meant it was a good idea and would work, even though you never mentioned or even hinted at the possibility this could work. Hence the assuming part.
Now I followed with a question to clarify my assumption hence again a witty reply of
PaulS:
That wasn't what you asked. You asked for permission to try it. It may work better, or it may not. There is only one way to know.
Now I'm sorry for wording my questions incorrectly, as stated clearly in your signature. You will answer stupid questions with stupid answers. The first question is fair game. when I asked
I do take it from the permission grated status that the due would be viable? Just to confirm
This question you didn't really give a clear answer. I mean you could have said "I don't know", you could have even answered my other question
On another point what about a counter that was hardware instead of software?
but you decided just to exert your question answering dominance and refer to an error I made in assuming you answered my question.
But hey, you have over 79,000 posts. Oh damn that is me assuming stuff again.