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.
ts ur vc++ prog u nd 2 go 2 a vc++ prog forum Wow. I'm at a loss for words.
may be vc receiver is not ok ? jane
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.
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
"If the original poster has taken a glance at Atmels s51 appnotes" Maybe he can only understand SMS?
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
"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.
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
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
"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
Do You have correct HW? ->MAX323...
Hi All, Yes Ulf Saß u r correct.I want to send data from mic. to my device.In C51 i have configured as SCON=0x50; TMOD |=0x20; TH1=0xFD; TR1=1; TI=1; for 9600-N-8-1 at 12MHz. My device communicate only on this setting - 9600 baud with NOPARITY 8 bit data and ONESTOPBIT. 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 ? more after u r reply..... rutu
If I understood, you try to send data from a 89S51 to your target device? You should check, if the 89S51 is sending (for example connect it to a PC with a terminal programm like Hyperterminal or Docklight, check with a scope). For RS232 debugging I always use Docklight. There is a free eva-version on the web.
Telepath is known to be unreliable across a single, not too large room --- do you really think it'll work any better across the Internet? I.e.: you will have to be much more specific in describing your 8051 code before it starts to make sense to even look at the problem seriously.
View all questions in Keil forum