This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to receive data from uart using this program

i am editing the program some one already made.i want help to receive the data from uart using the program.here is the interrupt program they have used.

 void serial_interrupt() interrupt 4 using 1
{
        if(RI)
                {
                RI=0;
                com_tmr_rx=5;
                com_r_busy=1;
                //datas[0]=SBUF;
                //datas[com_r_index++]=SBUF;
                if(com_r_index>=34)
                        com_r_index=0;

                }

        if(TI)
                {
                TI=0;
                TX_RX=0;
                if(com_t_index<com_t_length)
                        {
                        TX_RX=1;
                        SBUF=datas[com_t_index++];
                        }
                else
                        {
                        com_t_index=com_t_length=0;
                        TX_RX=0;
                        }

                }

}

.

Parents
  • But, obviously, that only helps if you always and only ever use the same editor.

    Obviously, this forum has no knowledge whatsoever of what editor you use, and no knowledge whatsoever of what settings you have for it!

    "attentien (sic) to de-tail (sic) is important for progremmers (sic)"

    Oh, yes!

    Also the ability to think things through completely!

Reply
  • But, obviously, that only helps if you always and only ever use the same editor.

    Obviously, this forum has no knowledge whatsoever of what editor you use, and no knowledge whatsoever of what settings you have for it!

    "attentien (sic) to de-tail (sic) is important for progremmers (sic)"

    Oh, yes!

    Also the ability to think things through completely!

Children
  • i am editing the program some one already made

    the point always to be made is:

    if you can not make the code yourself, downloaded code is worthless.

    the only thing you can hope (not know) is that the code worked under the circumstances the Author had.

    but, if you could make the code yourself, you will have enough of an understanding of the downloaded stuff to fix/adapt it

    Erik

  • It has been said that debugging is twice as hard as writing the code in the first place.

    Therefore, if you couldn't write the code yourself, you have no chance of debugging it!

  • <quote>But, obviously, that only helps if you always and only ever use the same editor.</quote>

    not troo. no. no not at all. yew can set hard tab stop to 8 (eg) in uvision and vstudio and many othur editers and it looks the sayme.

    bee four some one donates good advise the some one kneeds good under standing.

    Always yo're freind.

    Zeusti

  • But you cannot set tab stops when you post to a website, can you?

    And, if you don't use TABs at all, then you don't have to keep reconfiguring all your different editors. And you don't have to tell others what tab stops to use to view your code.

  • <quote>But you cannot set tab stops when you post to a website, can you?</quote>

    troo. not sayed diferunt.

    <quote>And, if you don't use TABs at all, then you don't have to keep reconfiguring all your different editors.</quote>

    very pour. very very pour.

    keep reconfuguring? only configered each editer once. who do'snt configere there editer when they thirst yews it? won setting four tabs is <bold>realey</bold> hard? realey? sum editers even have default of hard tabs!

    Always yo're freind.

    Zeusti.

  • I have seen files edited with tab size 4, and where the header in all files said "tab size 4". Next guy edited with other tab setting, wondering why the indent looked so strange. Third guy edited with yet another setting (while converting tabs to spaces) and wondered about the astonishing indent.

    Tabs really are no good.

    Also, annotate from some source code repository programs adds a fixed prefix to each line, without checking for tabs. So the initial 8-step tab will only become a 6-step or 5-step tab.

    Then there is the web applications that allows you to look at source code from the repository using your web browser. How would you configure them to know what tab settings you have in the different directories?

    And if you cut some lines and mail inline in the mail program?