Difference between revisions of "826"
(+clear template to keep image in associated section) |
(→Counters: +basic encoder programming) |
||
Line 19: | Line 19: | ||
When a snapshot is caused by counts equal to a compare register, the snapshot counts will always be equal to the compare register value. | When a snapshot is caused by counts equal to a compare register, the snapshot counts will always be equal to the compare register value. | ||
+ | |||
+ | ===How to read incremental encoders=== | ||
+ | |||
+ | ''Which functions should I use for incremental encoders?'' | ||
+ | |||
+ | There are many options, but basic operation works as follows: | ||
+ | |||
+ | First configure and enable the counter channel: | ||
+ | |||
+ | Call S826_CounterModeWrite() with mode=0x00000070 | ||
+ | Call S826_CounterStateWrite() with state=1 | ||
+ | |||
+ | To read the current encoder counts: | ||
+ | |||
+ | Call S826_CounterRead() |
Revision as of 10:19, 27 March 2014
Contents |
ADC
Calibration errors caused by missing shunt
On 826 SDKs earlier than version 3.2.0, analog calibration values will not be applied without J6 (labeled "Calibration Enable") installed. A missing shunt is intended to protect against accidental overwriting of calibration values, but in these SDKs it also prevents the reading of those values. This is resolved in SDK version 3.2.0 and above; in these versions the shunt functions as intended and must be installed only when calibrating the board (though leaving it installed all the time is okay).
If board calibration is incorrect, make sure J6 is installed or upgrade to SDK version 3.2.0 or higher. The 826 SDK can be downloaded from the 826 product page.
Apparent nonlinearity
Many of our customers have observed ADC nonlinearity during development and discovered that that it was caused by excessive common-mode voltage (CMV). This often happens when the ADC is used to measure an isolated voltage source such as a battery, thermocouple, or isolated power supply. Since the source is isolated, the CMV may float up or down until it exceeds the maximum allowed CMV of the ADC's input circuitry.
If you are using an isolated source, be sure to connect one side of the source to the ADC power supply ground as shown in the diagram to the right. This will prevent high CMV that might othewise result in apparent non-linearity or calibration errors.Counters
Snapshot counts upon match
When a snapshot is caused by counts equal to a compare register, the snapshot counts will always be equal to the compare register value.
How to read incremental encoders
Which functions should I use for incremental encoders?
There are many options, but basic operation works as follows:
First configure and enable the counter channel:
Call S826_CounterModeWrite() with mode=0x00000070 Call S826_CounterStateWrite() with state=1
To read the current encoder counts:
Call S826_CounterRead()