cancel
Showing results for 
Search instead for 
Did you mean: 

remote control receiving failed randomly with Input capture of ST72F324

hg-chen
Associate II
Posted on June 25, 2004 at 09:53

remote control receiving failed randomly with Input capture of ST72F324

2 REPLIES 2
hg-chen
Associate II
Posted on June 25, 2004 at 00:19

using input capture of ST72F324 to count the receiving signal from a remote control, but a extra bit(0) will be recognized (9th bit of total 16 byte) ,so the receiving is failed,

the strange thing is it seldom happens, average every 20 something times,

and press the remote control unit again , the receiving will be Ok again.

any idea to debug?
wolfgang2399
Associate II
Posted on June 25, 2004 at 09:53

Hi Kuni,

although I don't know the details of your problem I'll try to give you hint.

If you read the Input Compare Register you should read the two bytes in the correct order: first the ICiHR and then the ICiLR.

At least the Metrowerks cross-compiler will translate the C-code

Int1 = IC1R;

to

ld A,IC1R:1 ; which is IC1LR

ld Int1:1,A

ld A,IC1R ; which is IC1HR

ld Int1,A

Reading the ICiLR first can bring you some problems. More detailes -> Have a look at the special Notes in the manual.

The Cosmic Compiler does it in the right order.

Hope I could help you

woro