Micro Lover
Member level 2
hi
I am using 89c51. for using serial port I am using these commands
these are working correctly
------------
but in main function i am calling 2 functions
for example
---------------------
At the location "??????????" I want to call the DisplayData() after a specific clock period, for example after every 1000 clocks. is it possible to set the timer0 of 89c51 for this purpose.
I am using 89c51. for using serial port I am using these commands
Code:
SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD = 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 0xfd; /* TH1: reload value for 9600 baud */
TR1 = 1; /* TR1: timer 1 run */
------------
but in main function i am calling 2 functions
for example
---------------------
Code:
void main()
{
while(1)
{
if(RI)
{
GetData();
}
if(??????????)
{
DisplayData();
}
}
}