Squarewave creation
Hello,
I know how to produce squarewaves with the counters, but I need to produce two squarewaves that are out of phase. I have looked through the OBEX, manuals, and the counter note (AN001). I cannot seem to figure out how to create two squarewaves that are out of phase without some hardware.
Any help would be great.
Thank you,
Curtis
I know how to produce squarewaves with the counters, but I need to produce two squarewaves that are out of phase. I have looked through the OBEX, manuals, and the counter note (AN001). I cannot seem to figure out how to create two squarewaves that are out of phase without some hardware.
Any help would be great.
Thank you,
Curtis
Comments
I acually want a specific phase shift.
Thanks,
Curtis
Thanks everyone, kuroneko reply looks like it might work. I am still trying to understand the spin code. There are a few methods in that code I have never used yet. I will experiment with it today. @Tracy, This is part of my ultrasound project. I am needing this to experimentally test my phase shift measurement circuit using two flip-flops and an XOR IC. That is why I need two 50% duty squarewaves with one having a phase shift. I want to test my circuit at different frequencies and phase shifts and compare data from the prop and the scope in order to prove my concept. If this works than I will need to take the echo from the ultrasonic transducer (sinewave) and convert it to a squarewave of 50% duty and measure its phase shift from the reference squarewave from the transmitter.
Thanks,
Curtis
I tried the code that kuroneko posted and for for counter A it gives me a nice square wave, but for counter B it gives me a square wave that is stepped. Looks like two squarewaves superimposed. I tested these on separate scope channels.
Thanks,
Curtis
I tried your code on a Parallax QuickStart Board and then when I went home, I tried the same code on a GadgetGangster Prop Board and the Prop Professional Board and it worked on both. The scope showed a phase shift (24 us difference between two waves with the period 100 us). I used (frqa := frqb := 536871 ) for 10 khz before at work and after at home. I think it was the QuickStart Board.
I'll use this and let everyone know.
Thanks,
Curtis