Difference between revisions of "Protocol decoder:Graycode"
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
 (Created page with "{{Infobox protocol decoder | id              = graycode | name            = graycode | description     = Gray Code and Rotary Encoder | status          = ?? | license...")  | 
				|||
| Line 11: | Line 11: | ||
| probes          = —  | | probes          = —  | ||
| optional_probes = D0-D7  | | optional_probes = D0-D7  | ||
| options         = numchannels,   | | options         = numchannels, edges, avg_period  | ||
}}  | }}  | ||
| Line 18: | Line 18: | ||
== Parameters ==  | == Parameters ==  | ||
'''  | '''edges''': Rotary encoders are usually labeled as having N ''pulses'' per turn. A pulse consists of rising and falling edge and you have two lines that are phase-shifted by 90° to one another. This allows to extract ''4N edges'' per turn.  | ||
'''numchannels''': due to a current bug in Pulseview, assigned optional probes aren't reported correctly, so you'll have to select the number of channels manually.  | '''numchannels''': due to a current bug in Pulseview, assigned optional probes aren't reported correctly, so you'll have to select the number of channels manually.  | ||
Revision as of 19:03, 18 September 2017
| 
 | |
| Name | graycode | 
|---|---|
| Description | Gray Code and Rotary Encoder | 
| Status | ?? | 
| License | GPLv2+ | 
| Source code | decoders/?? | 
| Input | logic | 
| Output | graycode | 
| Probes | — | 
| Optional probes | D0-D7 | 
| Options | numchannels, edges, avg_period | 
The graycode protocol decoder can decode Gray Codes up to 8 data lines (but easily generalizes). One popular special case is the Rotary Encoder, which has two lines, A and B. The decoder will report phase, counting direction, absolute count, as well as timing information. Sorry for that mislabeling.
Parameters
edges: Rotary encoders are usually labeled as having N pulses per turn. A pulse consists of rising and falling edge and you have two lines that are phase-shifted by 90° to one another. This allows to extract 4N edges per turn.
numchannels: due to a current bug in Pulseview, assigned optional probes aren't reported correctly, so you'll have to select the number of channels manually.