Updated Configuration Variables (CV) List (markdown)

Gabriel Koppenstein committed 2022-08-02 15:08:51 +02:00
1 parent f160a59811
commit 8c70460a97
1 file changed
+42 -31
+42 -31
@@ -1,51 +1,62 @@
# Comments regarding Configuration Variables:
CV.h contains default values for every CV. When your board is still "factory new" these values need to be written into flash. This is normally done automatically (see CV65 for reference), alternatively you can write a value of 8 to CV8. Also note that index 0 in the CV array corresponds with CV1 and so forth. This list only contains CVs that are in use.
CV.h contains default values for every CV. When your board is still "factory new" these values are automatically written into flash. CV_65 == 255 indicates a factory condition and resets all CVs to default. Alternatively to reset all CVs to default a value of 8 can be written to CV8. Also note that index 0 in the CV array corresponds with CV_1, index 1 corresponds with CV_2 and so forth. This list only contains CVs that are in use.
# CV List:
### CV1 - Basic address
#### CV_1 - Basic address
Short DCC address
***
### CV2 - V_min
#### CV_2 - V_min
Min motor voltage/speed
***
### CV3 - Acceleration rate
CV_3*CV_59 = Time for one discrete speed step change in ms
***
#### CV_3 - Acceleration rate
CV_3*CV_175 = Time for one discrete speed step change in ms
### CV_4 - Deceleration rate
CV_4*CV_59 = Time for one discrete speed step change in ms
***
#### CV_4 - Deceleration rate
CV_4*CV_175 = Time for one discrete speed step change in ms
### CV_5 - V_max
#### CV_5 - V_max
Max motor voltage/speed
***
### CV_6 - V_mid
#### CV_6 - V_mid
Mid motor voltage/speed
***
### CV_7 - Version No.
Rev 0.2 = 1
***
#### CV_7 - Version No. (Read-Only)
Rev 0.3 = 1
### CV_8 - Manufacturer
Default = 13 = Public Domain & Do-It-Yourself Decoders
#### CV_8 - Manufacturer (Read-Only)
Default = "13" = Public Domain & Do-It-Yourself Decoders
Writing a value of 8 resets all CV values to the default values in CV.h.
This will also happen if CV_65 == 255 == 0xFF
***
This will also happen if CV_65 == "255" == "0xFF".
### CV_9 - PWM Frequency
#### CV_9 - Motor PWM Frequency
f in Hz = CV_9 * 100 + 10000
Default = (150 * 100 + 10000)Hz = 25kHz
***
#### CV_11 - Packet timeout
If no package is received for x seconds (x = CV_11) the decoder will automatically stop the motor (Emergency Stop).
### CV_59 - speed_helper timer delay
This timer delay can be used to change the time between two speed steps. So basically an additional option to adjust dec/acc rate
***
#### CV_12 - Permitted operating modes
Currently DCC Digital mode is the only supported mode.
### CV_65 - New flash variable
Each bit of the factory new flash chip should have a inital state of "1"(Resulting in a value of 0xFF for the whole byte of CV_65). This will be checked for in the beginning of core0.c (see cv_setup_check()). When CV_65 == 255 == 0xFF the default config (CV.h) will be written to flash.
***
#### CV_17 & CV_18 - 14-Bit extended/long address
Address is only used if bit5 has a value of "1" in CV_29.
![Long Address](https://github.com/gab-k/RP2040-Decoder/blob/main/docs/svg/Long_address.svg)
Bit15 and bit14 which correspond to bit7 and bit6 of CV_17 are always "1". CV_17 = "192" & CV_18 = "0" is also not a valid address. Otherwise the valid value range of CV_17 ranges from "192" to "231" and "0" to "255" for CV_18 respectively.
#### CV_29 - Decoder Configuration
Bit0 is used to reverse direction i.e. "0" = normal, "1" = reverse.
Bit5 switches between basic and extended addressing modes i.e. "0" = basic address, "1" = extended address.
The other 6 bits are currently not in use and therefore irrelevant.
#### CV_65 - New flash variable
Each Byte of the factory new flash chip should have a inital state of "0xFF". This will be checked for in the beginning of core0.c (see cv_setup_check()). When CV_65 == "255" == "0xFF" the default config (CV.h) will be written to flash. Alternatively a reset to default can be done by either writing "8" to CV_8 or writing "255" to CV_65 which then triggers a reset on restart.
#### CV_175 - speed_helper timer delay
This timer delay can be used to change the time between two speed steps. So basically an additional option to adjust the deceleration and acceleration rate.