Gray-Code Counter, N-Signal with Due Need Help Please?!?

We are two electronic students and got a little bit of a problem by programming a Adruino Due.
We are hoping to get some help in this forum, but probably it's the best to explain what we trying to do first.

Actually the task ist pritty simple, we are trying to simulize a two bit Gray-Code as an decoder signal.
That includes channel A and B (Pin 36 & 38) as the Gray-Code and the n-channel for refference one cycle.
To modalized the Gray-Code signal was very simple but now we got mayor problems to create the n-canal singal.
We are handeling with very high frequency up to 1.3 MHz and so we thought it is a good idear to use the hardwarecounter from the microprocessor and that's the point where we get stuck, because we need to handle with the 32-bit hardwaretimers and they are very complicated to set up.
As well as the manual is difficult to understand...

The counter we need has simply to count 25.000 steps of our Gray-Code output signal and than we need to get a tiny pulse on the n-channel.

We have to say we are not very experienced in programming microprozessors and that's why we need and hopefully get your help.

I think you need to explain your problem in a lot more detail.

  • What is the source of the signal you are working with? Give a Web link reference to it.
  • Exactly what information do you want to extract?
  • Why do you want to use a microprocessor? What else do you want to do with the information?

Hi thank you for your response,

We don't have a source, we have to simulate this signal what you can see in the picture. Usually you can get this signal from a incremental rotary encoder. We need to simulate this signal.

We got the Adruino Due working to generate chanal A and B. (like in the image) But now we neet to generate the N-signal (the last signal in the image). We don't have to get any information out of it. We need to get this signal out on 3 pins.

We want to use the 32 Bit Counter to count one of the (A Or B) outputs so we can get a short impuls on the N-chanal. (the n-chanel gets normaly one impus every full cycle)

Our problem is that we don't understand how the 32Bit counter works. If you can explain how we can setup a counter who counts 2500 pulses and then give us impuls on a output would help a lot.

Why do we want to use a microprocessor? We simply don't have a choice. We have to use the equipment we have.

We hope the problem becomes a little bit more clear and we hope we find someone who can help us.

Thank you.

The point is of course, that the "N" signal is A and B. Whatever code you use to generate A and B, then N just becomes A & B.

In hardware, you just use an AND gate. As it happens, NAND gates are more readily available such as the 74HC00, so you simply feed your two inputs into one gate, and the output of that into both inputs of a second gate so the output of that becomes a "NOT-NAND" or "AND" gate.

Again, if you want more assistance, you have to explain what you are actually doing in detail.