I have two Infrared Transceiver modules from TFDU4101-TR3 on two separate boards each interfaced to ATMega164PA microcontroller. To drive these transceivers an endec is needed which I have not used in my design due to budget constraints.
So what I am trying to do is bit-banging. The RX and TX follow normal standard, RX is active low and TX is active high. I am toggling the TxD pin one 'Board A' 50 times at 5 Khz to send 50 pulses to the receiver. On 'Board B' I have implemented a PIN change interrupt which should technically receive 100 pulses (2 pulses for each transmit pulse that it receives). This is not the final design, I just learning and experimenting how to transmit data from one board to another.
Now the problem is that when I send 50 pulses from Board A to Board B, I do not get 100 pulses, but instead I sometimes get 90 or 81 or 98. In short I don't get the intended number of pulses. Is there something wrong with my approach?
Please let me know if any further information is needed.