Menu

TheoryOfOperation

Anonymous

A reverse biased photodiode acts as the receiver. The microcontroller's built-in comparator can use its DAC as the positive input to the comparator. The comparator's output can then be routed to a physical pin (RC4). Said output signal is then looped back via the PCB to the UART receive pin (RB5).

The analog signal coming from the photodiode is also routed via the PCB to an ADC input (RC6). This allows the software to periodically sample the voltage and adjust the DAC value as needed.