| ??? 01/06/01 06:21 Read: times |
#7892 - RE: Serial port and basic |
Hi Daxx,
I have developed a very simple test circuit, based on AT89C2051. The code is very small. What it does, is that it polls the input what it gets from IR receiver, turn the timer ON first when it detects any input from IR Receiver, and keep timer running in 16bit mode. Once the signal again goes high(signal bit stops) for that particular received bit the timer stops. Remember IR receiver output is "Active low". There is sufficiant time interval between two IR bit. Within that interval the Micro assembles the timer contents in ascii and send it across to pc via serial port. I used 19200baud, and receiving on hyper terminal. There is a "comma' and a "'space" sent after every bit data(timer's contents). I know the timer increment at every instrucion cycle which is 11059200/12=xxxx and multiply this by timer contents I received. I get the bit duration. Now I know how many bits I have received and duration of each bit. Take all data to excel worksheets and analyze the way I like. IR RECEIVER: ------------ If you find that your data is not within the "tolerable range" and the readings are not matching each other at all, that means, your IR receiver is not compatible with the remote Ir transmition unit. You have to get something different. But I think most IR receivers works well, except their internal time delay. Basically inside the IR receivers there is a kind of "'monostable" circuit, which holds the output signal for a predetermine time delay in relation with the input. So if two bits of a carrier enters within the time delay generated by monostable, the output signal keep goes steady. and uP thinks that signal is still comming in. Once carrier stops comming to the input, the output of IR receivers also stops, after a small time delay. If 2nd bit of IR carrier takes longer then "time delay" generated by IR receiver, then output also change and uP might think that further data is belongs to the next bit. If you want I can send you that code written in assembly. Or I can send you a hex format file, so you can directly burn-in to your device. goodluck Rauf |



