PIC Based Quadrature Signal Gen & 2 Phase Non overlapping Clock

hi,
The circuit is designed for a 12F683 PIC, it outputs QA and QB [ quadrature signals] also two other pins output a 2 Phase non overlapping clock pulses.
The purpose of the project is to be able to drive the QEA and QEB Input pins of say 18F2431/4431, to enable bench testing of Quadrature Encoder programs without an actual encoder disk.

Pulse output rate is controlled by a 10K trim pot, a rate less than 10 ADC counts stops the output pulses.
Forward/Reverse [Up/Dwn] of QA and QB is controlled by a switch.

The 2 Phase clock is for general purpose use, the clock rate is controlled by the same pot as the quad pulses.

The Oshonsoft Basic code [the .txt] and Hex file are attached, the Scope image shows the Oshonsoft scope.

NOTE: If higher or lower ranges of the pulse rates are required, modify the program OSCCON setting.
eg:
'the internal osc has a freq range of 125KHz to 8MHZ , plus 31KHz LFINTOSC
'OSCCON=%01010000' 2MHz Pulse Rate/ 2
OSCCON = %01100000 'Internal osc 4MHz
'OSCCON = %01110000 ' 8MHz Pulse Rate *2

1574645591629.png


1574645602045.png

Eric

Blog entry information

Author
ericgibbs
Views
2,501
Comments
2
Last update

Downloads

More entries in General

More entries from ericgibbs

Share this entry

Top