Added I2C Integration page #docs

This commit is contained in:
pyr0ball 2020-05-12 23:35:46 -07:00
parent f744b4539a
commit 7988739542
2 changed files with 38 additions and 2 deletions

View file

@ -11,7 +11,8 @@
- To change sensor input pullup vRef low threshold: `VFOL` [integer in millivolts] - To change sensor input pullup vRef low threshold: `VFOL` [integer in millivolts]
- To change comparator trigger high threshold: `VCOMP` [integer in millivolts] - To change comparator trigger high threshold: `VCOMP` [integer in millivolts]
- To change the duration between ADC measurements: `LOOP_D` [integer in milliseconds] - To change the duration between ADC measurements: `LOOP_D` [integer in milliseconds]
- To calibrate internal vRef **(see notes below): `CONST` [Vcc measurement in millivolts] - To update the internal vRef constant value **(see notes below): `CONST` [long value]
- To update the internal vRef using a multimeter reading: `ADJUSTVCC` [integer in millivolts]
You can also enable or disable DEBUG output with: `DEBUG [0|1]` You can also enable or disable DEBUG output with: `DEBUG [0|1]`
@ -52,7 +53,18 @@ The ADC reading function assumes an "ideal" multiplier constant. Each Atmega
chip is slightly different, so it won't be completely accurate without tuning. chip is slightly different, so it won't be completely accurate without tuning.
Most of the time this won't be necessary, so don't mess with this if you don't Most of the time this won't be necessary, so don't mess with this if you don't
know what you're doing! know what you're doing!
The reading can be fine-tuned by using a multimeter. Simply take a voltage readig at the Anode of D1 and input it's value in millivolts afte rthe `CONST` command The reading can be fine-tuned manually by using a multimeter, and this equation:
`scale_constant = internal1.1Ref * 1023 * 1000`
where
`internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function)`
If the scale_constant calculated is different from the default 1125300, update the voltMeterConstant variable in pP_config.h with the correct value or send a new value with `CONST`
Alternatively, you can input a direct reading from a multimeter, in millivolts, and have the sensor calculate the constant value automatically by using `VCCADJUST`
## Sensitivity Tuning Workflow ## Sensitivity Tuning Workflow

View file

@ -0,0 +1,24 @@
# Integration using I2C
Default I2C Address: 0x10
## I2C Command Register Map
see [Pyr0-Piezo Parameters Explanation](../pyr0piezo-parameters/pyr0piezo-parameters.md) for more specific details on the command aliases.
|I2C Register|Command Alias|Arguments|Type|Bytes Length
|---|---|---|---|---|
|0x00|GAIN_F|Gain Factor|Input|2
|0x01|VFOL|Millivolts|Input|4
|0x02|VCOMP|Millivolts|Input|4
|0x03|LOOP_D|Milliseconds|Input|2
|0x04|TRG_D|Milliseconds|Input|2
|0x05|HYST|Millivolts|Input|2
|0x06|LOGIC|Boolean|Input|2
|0x07|PZDET|Boolean|Input|2
|0x08|CONST|Millivolts|Input|4
|0x09|CONFIG|None|Output|32
|0x0a|ERASE|None|Input|1
|0x0b|STATE|None|Output|10
|0x0c|VCCSW|Boolean|Input|1
|0x0d|VCCADJUST|Millivolts|Input|4