...
Unfortunately, the 6V case was still clearly out of range since for both 12V and 6V to be reasonable on the CB pins, 12V had to result in a value less than 3.3V while 6V greater than 1.9V (which is not possible with a resistor divider). Options were discussed to make use of both the pwm and analog pins of the control, pilot signal (PA5 and PA6) to create a set of equations to pinpoint each state and duty cycle, however that was dismissed due to overall complexity (not intuitive) and fact there exists non-unique points due to the analog signal not differentiating between the value of PWM and the amplitude of the PWM, makes it unideal. Another option was discussed to use the PWM pin as an analog input, which was also dismissed because in some cases this may be impossible due to the conversion time of the ADC and the frequency + duty cycle of the PWM (for example, it may be very hard to catch a 1kHz 10% DC signal high on the correct edges and convert that to an accurate PWM). For the ideal operation, there would be a hw change in which something like a difference amplifier was used to make the range between 12V peak and 6V peak smaller to fit both values within the range of controller board IO operation. For now, we still want to verify the 6V amplitude works given the need to ensure the entire high voltage power path (from 240VAC to load) works. It should be noted that in general, filtered PWM to provide an analog value should mainly be used for debug as reading the PWM is more accurate and does not include ADC error.
To do so, the resistor divider was modified to allow for the 6V range to be greater than Vih (of around 1.9V). To do this, since the standby mode is unavoidable in operation, the divider was modified so the 12V input is just under the absolute maximum rating for a tta IO pin, which is 4V. A R11 resistance of 7.37kohm was determined to achieve this, and can be seen in the following whiteboard calcs (using a paralleled 430 and 7.5kohm resistor):
...