hello dipankar, happy new year :) , clear me on one thing do you have your data(of both sensors)? which you want to send before entering in the if loop timer ISR (you mentioned in your code) which represent your 5 sec. In your case what you says as integer 6000 & 3000. what i am saying if i am correct then you have sensor 1= integer 6000 ( 0x1770 hex) sensor 2= integer 3000 ( 0x0BB8 hex) before entering to 5 sec loop in timer ISR and as 5 second time passes you want to send it through UART. (and of-course this is not the whole application a part of it). what i am suggesting is why you are calling uart ISR from timer ISR twice? or even why you are calling UART ISR. instead of that you can make an array say transmit_buffer[4]={0x17,0x70,0x0B,0xB8} // data you want to send and in your 5 second if loop make a flag high say send_flag=1; in your main () { // your application code if ( send_flag ) { // send your complete array transmit_buffer {without calling any UART ISR } //make send_flag=0 ; } } correct me if i am wrong. thanks
↧