Thank you both for your usefull comments.
@ Richard,
you are correct, I've done my self calculations and we are the same.
The problem must be somewhere else or at PIC configuration (maybe ??)
Since I don't have any other way to see what happens here, I'm simply printing on LCD the values I'm reading with the PULSIN command.
My results are correct @4 MHz but wrong at 16 MHz.
@4 MHz I get for "Start" pulse, "0" pulse and "1" pulse respectively : 898, 56, 168. These results are correct according to the NEC protocol (for ex. 898 * 10 us ~ 9 ms which is fine for the start pulse).
But @ 16 MHz I get : 3600, 229, 129.
The 3600 result is correct (~ 898 * 4),
The 229 result is also correct (~ 56 * 4),
BUT 128 is wrong and should be ~ 168 * 4 = 672 !!!
So here is my problem, I can read @16 MHz the "Start" pulse and "0" pulse, but the "1" pulse is wrong, it's way LOWER value than it should be.
What do you think about this ?
Bookmarks