We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, I have written a program in VC++ to write a char array of 13 bytes on COM port using 9600-N-8-1 parameters. when i send this to my target device it responds, but same program when i send through 89S51 my device does not respond.To set 9600-N-8-1 i have written 0xFD value. Can anyone no the reason for such strange behaviour. Please let me know.... rutu.
"But i can't read from micro. using same VC++ prog. to read. what might be the problem ?" its ur vc++ prog u nd 2 go 2 a vc++ prog forum
its ur vc++ prog u nd 2 go 2 a vc++ prog forum Stefan, You have not grasped the idea behind SMS. What you wrote took me only 10 seconds to decode, had it been true SMS it should have taken at least 1 munute. Erik
Hi, SCON=0x50; TMOD |=0x20; TH1=0xFD; TR1=1; TI=1; Is these values correct for 9600-N-8-1 at 12MHz with Atmel 89S51 ? if not plz let me know the correct values. Rutu
"Is these values correct for 9600-N-8-1 at 12MHz with Atmel 89S51 ? if not plz let me know the correct values." According to Keil's baudrate calculator you can't do 9600 baud with timer 1 at 12MHz.
According to Keil's baudrate calculator you can't do 9600 baud with timer 1 at 12MHz. While, you, indeed, can do it relatively precise with timer 2 - Why, Oh Why, does so many use these silly non-UART frequencies for their crystals? I honestly believe that 11.0592 is the most sold frequency, so it can not be a matter of avialability. If the original poster has taken a glance at Atmels s51 appnotes re UART, he would have seen that all specify 11.0592 crystal. Oh well, it is probably too much to ask that someone that is too lazy to spell the words out and instead writes stupid SMS would read something. Erik
"If the original poster has taken a glance at Atmels s51 appnotes" Maybe he can only understand SMS?
Hi, I checked the baudrate calculater and accordingly configured also i replaced the crystal with 11.0592, even then i m not getting the rs232 communication at 9600. I tried activating the SMOD, even then no use. Have anyone faced similar problem. Rutu
Earlier in this thread you said: "I have checked with Hyperterminal it is ok.I get the data on hyperterminal. When i send data from computer using VC++ prog. the microshows it correctly.But i can't read from micro. using same VC++ prog. to read. what might be the problem ?" Summarising this we get: 1) Hyperterminal to 8051 ok 2) 8051 to hyperterminal ok 3) VC to 8051 ok 4) 8051 to VC NOT ok Which pretty much indicates the problem is with your VC program.
may be vc receiver is not ok ? jane
ts ur vc++ prog u nd 2 go 2 a vc++ prog forum Wow. I'm at a loss for words.
Hi, Individual connection is working fine.But not in between the microcontroller and the module. I suspect that when i put 0 "zero" the microcontroller just skips it.Because i don't see anything for 0 in hyperterminal. can this be a problem. rutu
Hey, I was just looking at threads on the forum when i came across a thread saying that, when we output 0x0A on RSR232 it actually outputs /r/n means 0x0D,0x0A. My last output on the RSR232 is 0x0A.Which is end of packet.Can this be the reason for communication failer. Rutu.
I was just looking at threads on the forum when i came across a thread saying that, when we output 0x0A on RSR232 it actually outputs /r/n means 0x0D,0x0A. Have you written your own putchar function? Jon
You should better use an other terminal program than Hyperterminal (which shows only printable ascii). ..as I wrote before look at http://www.docklight.de (in english). It will show you ascii/hex/binary!
Hi, Yes i have modified the putchar function keeping only single SUB=c loop.I have also downloaded docklight but still not used. Just check my prog. and let me know if i am making some mistake.The aim of this program is to output the array of 13 character size (0x40,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0xBF,0x0A}on the RS232 port at 9600bps,NOPARITY,8bit data,1 stop bit. #include<reg52.h> #include<stdio.h> char m_Write[13]={0x40,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0xBF,0x0A}; char loop=13; void main(void) { SCON=0x50; TMOD |=0x20; TH1=0xFD; TR1=1; TI=1; while(1) { while(loop--) putchar(m_Write[13-loop]); loop=13; } } and what modification is required to output the same data in ascii. like 4005000000000000000079BF0A the above data. rutu
Milan G asked higher up in this thread "Do You have correct HW? ->MAX232..." You never answered I am starting to suspect that you are one of those "no RS232 transciever is required" ill informed people. Erik