KlausST
Advanced Member level 7
- Joined
- Apr 17, 2014
- Messages
- 26,316
- Helped
- 4,926
- Reputation
- 9,875
- Reaction score
- 5,799
- Trophy points
- 1,393
- Activity points
- 177,191
Hi,
Don´t expect answers, as long as you give undocumented code.
It seems you want to give us a riddle.
I try it anyway.
You say it depends on the "sent()" function.
SBUF: In your whole code I can´t find how SBUF is treated. What´s the purpose? How does it work?
TI: In your whole code I can´t find how TI is treated. What´s the purpose? How does it work? I can´t find it to be initialized. Once it is not "0" the loop obviously will be infinite.
***
Try to debug your code by setting/clearing outputs at special points in your code. With a scope you can verify if the code is executed, how often it is executed and how long it takes for the code to be executed.
For example: SET an output at the first line of your SENT() function and CLEAR it at the last line of your SENT() function.
Debug your code this way step by step, until you find the line of code that creates the problem.
***
Again: Please give COMPLETE informations. Otherwise don´t expect (much) answers.
Klaus
Don´t expect answers, as long as you give undocumented code.
It seems you want to give us a riddle.
I try it anyway.
You say it depends on the "sent()" function.
Code:
void sent()
{
SBUF = 254;
while(TI == 0);
TI = 0;
SBUF: In your whole code I can´t find how SBUF is treated. What´s the purpose? How does it work?
TI: In your whole code I can´t find how TI is treated. What´s the purpose? How does it work? I can´t find it to be initialized. Once it is not "0" the loop obviously will be infinite.
***
Try to debug your code by setting/clearing outputs at special points in your code. With a scope you can verify if the code is executed, how often it is executed and how long it takes for the code to be executed.
For example: SET an output at the first line of your SENT() function and CLEAR it at the last line of your SENT() function.
Debug your code this way step by step, until you find the line of code that creates the problem.
***
Again: Please give COMPLETE informations. Otherwise don´t expect (much) answers.
Klaus