cancel
Showing results for 
Search instead for 
Did you mean: 

[q]Read Port4...

byounghoon_koh
Associate II
Posted on May 20, 2003 at 23:26

[q]Read Port4...

3 REPLIES 3
byounghoon_koh
Associate II
Posted on May 17, 2011 at 11:54

Hello Guys,

I'm trying to pushed key value using external interrupt 0. Port4 is defined as a GPIO port and assigned to keys. When a key is pushed, external interrupt 0 is occured and I'll copy the Port4 state to a variable. However, the Port4 state isn't read. This is the example code.

key_var = P4;

Is it fault?

Thanks,

Byounghoon

joseph2399
Associate II
Posted on May 17, 2011 at 11:54

In the Application note AN1171 appendix A, there is a design example that is samiliar to your application. You can get the app. note from the website at:

http://www.st.com/stonline/books/toc/an/460.htm

byounghoon_koh
Associate II
Posted on May 17, 2011 at 11:54

Thanks for the reply, but I want to know the handling method of 'P4'. AN1171 is refered about PA, PB, PC and PD. As I know, these 4 ports operate differently with P4.

Please give me some more advice...

-----

I fixed it!!

The problem was on the speed of the MCU. Actually, I copied the value of P4 in main routine. However, the value of P4 is changed in transition between interrupt routine and main routine. So I copied the value of P4 in interrupt routine and it work well.

Thanks,

Byounghoon

[ This message was edited by: aormaniac on 21-05-2003 09:39 ]