facing Problem while writing UART driver

hi. I am writing the keyboard driver (using the UART and RS232 protocol). There is an Receive Fifo And one Flag register.when there is an data in receiver fifo the Flag get changed. i am reding the reading the receiver fifo depend on the Flag register (if the receive flag set).but on debugger when i see the Flag register the Flags are not changing? for example : "when the flag which tell there is data in Rx fifo set and then when i do the read operation this flag should get cleared" but it is not getting cleared..

need ur help as soon as possible Thanks

Reply to
rahul
Loading thread data ...

Hi Rahul,

Please give a code sample and some information on what chip you are using, and what debugger etc.

Ross

Reply to
Ross Marchant

hi ross

the program goes like this

while(1) { while ((HOSTSYNC & 0x00000001) != 0x00000001); /* keyboard is connected

*/

for(i=1;i > hi.

Reply to
rahul

Two things jump out straight off:

for(i=1;i

Reply to
Tom Lucas

In addition to what others posted, make sure all the control registers are declared with the "volatile" modifier. Otherwise you code may not read the actual register value when you expect it.

Reply to
Roberto Waltman

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.