Discussion in "General help Guidance and Discussion" started by    abbas1707    Aug 8, 2007.
Mon Sep 10 2007, 09:39 pm
#21
hi Ajay!
replying late coz i was out of town for some tafreeh.
im posting c program and proteus file.only max232 and db9 are not included in this files coz those are perfect as im only able to send characters from controller to pc.means transmission is working fine.
problem occurs when i use this attached c code or use sendString method which i posted in previous post.
n believe me the circuit and code which i am attaching were working perfectly some days ago.
i succcessfully logged the temperature in my vb program.
but i dont know wat happened to it now.it shows no response now.
also i clear u dat there is no problem in the circuit because i said my friend to write code in assembly
for this project.he made an assembly program and i cant believe dat his assembly code is working fine on this circuit.i m also sending u dat assembly code.but there is some ascii conversion problem in his code i think(but not sure as i have zero knowledge of assembly).but im getting exact reading in hex repersentation (which i done in vb) from his code.
i think dat circuit contains some type of filter which is blocking my c program to function...hehehe
realy it makes me feel like a 2 takay ka programmer.....coz its so simple and and shame on me dat my program getting floped( but i still believe dat there is some filter in circuit otherwise it would have not shown response some days ago)
plz help
waiting 4 ur reply

Tue Sep 11 2007, 01:22 am
#22
I checked your circuit... and i checked the code too.. it seems perfect to me.. nothing wrong..
I took a screenshot too.. take a look.. its working.. check your programmer buffer is loading all the bytes or not, because my friend had this problem on his software..
Tue Sep 11 2007, 01:58 am
#23
i know dat its working on proteus.problem is dat it is not working on hardware.
im using ez downloader for burning code.and if there was some problem wid burner then y this circuit was working fine wid my code before.and also i worked wid my friends burner for this project but same problem occurs.but he is also using ez downloader.shud i try it wid different burner??
im still very disappointed with circuits behavior.
Ajay i want to request every one on this forum if anyone have the circuitry for serial cmmunication of AT89c51 plz plzzzzz help me and do check this code on their(if anyone have) circuit.
coz even this simple program giving me no response

#include <reg51.h>
void delay()
{
int k,l;
for(k=0;k<50;k++)
for(l=0;l<280;l++);
}
void init()
{
TMOD=0x22;
TH1=0xFD;
SCON=0x50;
TR1=1;
}
void sendChar(unsigned char ch)
{

delay();
delay();
SBUF=ch;
while(TI==0);
TI=0;
}

void sendString(unsigned char *a)
{
while(*a!='\0')
{
sendChar(*a);
a++;
}
}
void main()
{
init();
while(1)
{
sendString("abbas");
delay();

}
}
wat do u say Ajay...wat shud i do ....
i have no other way to solve it


[ Edited Tue Sep 11 2007, 02:00 am ]
Tue Sep 11 2007, 04:08 am
#24
Is the above code working with your circuit?
I will check it on my controller and will tell you the results..
By the way... did you check your circuit? coz sometimes a small connection or a short can give you a big problem. Even though your circuit was working, I advice you to double check the circuit once..
Also if your friend has a different circuit then tell him to check it too.. so you can get some idea.. as far as program is concerned there seems no problem right now..
Tue Sep 11 2007, 04:19 am
#25
no the above code not works on my circuit.
and it is confirmed that there is no problem in the circuit as i told u dat the circuit is working fine with assembly code of my friend which i posted on top of page..
Wed Sep 12 2007, 02:34 am
#26
Hi.. abbas..
one thing i am confused with.. you wanted to tell me that your friend's code is working on your controller board but your code which was working few days back.. suddenly stopped working is it?
If that is the case.. stress your mind and try to undo the change you made before when code worked..
Wed Sep 12 2007, 02:58 am
#27
yes my friend's code is working on my controller board but my code which was working few days back.. suddenly stopped working
and i still have those codes in original form which were working fine on my circuit
but now they are faaarigh
code is correct i think bcoz it works fine on proteus,circuit is fine coz it works fine wid my frend code.
then where is the problem......?????
i think i must quit c programming and turn to assembly

have u tried dat string program on ur circuit??
Wed Sep 12 2007, 03:13 am
#28
no not yet... i was just thinking about your program only.. and trying to understand what you really meant.. wait i try your send string program now.. will take a sec.. hold on!
Wed Sep 12 2007, 03:53 am
#29
yes your serial program working on my controller board.. all i can say is.. check your connections or something :-s
 abbas1707 like this.
Wed Sep 12 2007, 04:19 am
#30
i will try it wid some different programmer board :mad

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

AntoniaRoons
Fri Apr 19 2024, 09:59 pm
carpinteyrowrl
Fri Apr 19 2024, 02:51 pm
DonaldJAX
Fri Apr 19 2024, 01:08 pm
Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am
DonaldKnown
Thu Apr 18 2024, 12:24 am