hello everyone....my program transmits 'SAMPLE CODE' continuously on the uart...chip 'm using is p89v51rd2..the problem is nothing is being displayed on the hyperterminal...i checked the TXD pin on the scope,i can c pulses there...i've checked the serial cable,shorted pins 2 n 3,even that works fine....watelse could be the problem..??help me out...
hhey 'm sorry...i meant i can 'see' pulses there... nd there is a max 232 in the circuit...
nd there is a max 232 in the circuit... why will you not disclose (nd) if there is a MAX232?
what do you see when transmitting 'U' constantly?
Erik
i keep getting aa hex.
continously transmit 'U' that will give you a square wave with a frequency if 1/2 baudrate.
and there is a max 232 (HIN232CPZ IC) on the circuit... continously transmitting 'U' and checking the txd pin on the scope gives me a square wave of frequency 2.2kHz,but the baudrate i've set is 9600 (RCAP2H = 0xFF; RCAP2L = 0xB2;)
The reload values for RCAP2H:RCAP2L as 0xFFB2 match 9600 baudrate speed for uart with T2 as baudrate generator in two cases:
a. If Xtal= 12MHz and microcontroller in X2mode (6 cycles per 1machine cycle) or b. If Xtal= 24MHz and microcontroller in X1mode (12 cycles per 1machine cycle)
a sample calculattion for T2 baudrate can be found at www.mcu4u.eu/.../
Also, Hyperterminal at PC side must be configured with the same setting as the microcontroller uart. example: Speed 9600, Data bits 8, Stop bits 1, Parity None, Handshake None.
If other handshake protocol is used like DTR/DSR or XON/XOFF must both devices have the same configuration.
Wiring is important. For DCE to DTE needs a straight cable (DB9: 2 to 2, 3 to 3, 5 to 5) No hardware handshake. For DTE to DTE needs a crossover cable (DB9: 2 to 3, 3 to 2, 5 to 5) No hardware handshake.
Other "terminal" software as putty and teraterm may be more convenient www.chiark.greenend.org.uk/.../download.html http://www.ayera.com/teraterm/
'U' and checking the txd pin on the scope gives me a square wave of frequency 2.2kHz,but the baudrate i've set is 9600 (RCAP2H = 0xFF; RCAP2L = 0xB2;) I guess the actual frequency is 2.4kHz which means you are transmitting at 4800 baud. RCAP values are meaningless when you do not state your oscillator frequency.
go here http://www.keil.com/c51/baudrate.asp
an oscillator frequency of 11.0592MHz
the serial communication code is set at a baudrate of 9600 (RCAP2H = 0xFF; RCAP2L = 0xB8;) at an oscillator frequency of 11.0592MHz...when i interface the board to a PC hyper-terminal,junk values are being transmitted..but when i changed the PC hyper-terminal settings to a baudrate of 4800,its receiving and transmitting without any error....what could be the problem?? i checked the crystal on the board..it gives a sine wave with the proper frequency..
"what could be the problem"
Have you read previous posts?
Have you visited previously posted links?
Did you plan to?
Have you made some own speculations?
i've checked all the previous links..the values calculated are all correct....i still cant figure out what is it wrong that 'm doing??
hhey i changed the value of RCAP2L from B8 to DC and its working...thanQ everyone..
I don't believe you!
Check again at http://www.keil.com/c51/baudrate.asp - and note that you need to specify more than just the oscillator frequency and RCAP2...
And think about what settings could possibly change the speed by a factor of two...
Review the basics of the 8051/2 UART:
www.8052.com/tutser.phtml
http://www.8052.com/tut8052
But do you understand why you needed to do that?
Or, to put it the other way, why you were previously getting half the baud rate you wanted?
Again, you should probably review the basics of the 8051/2 UART:
If you don't understand these basics, then you will keep getting stuck in the same trap!
"i've checked all the previous links..the values calculated are all correct....i still cant figure out what is it wrong that 'm doing??"
So you have visited the link. But did you read the text?
In a previous post in this thread - the same post that contained the link - there was this text:
In the linked calculator, there was a setting: "Machine Cycle 12 or 6"
What conclusions did you make from the forum post, and from the setting in the calculator?
Directly below the calculator, there was this text:
X1_mode: 12cycles, uart_x1: SMOD=0 TH1Reload = 256 - (XTAL / 12 / 32 / baud_rate) X1_mode: 12cycles, uart_x2: SMOD=1 TH1Reload = 256 - (XTAL / 12 / 16 / baud_rate) X2_mode: 6cycles, uart_x1: SMOD=0 TH1Reload = 256 - (XTAL / 6 / 32 / baud_rate) X2_mode: 6cycles, uart_x2: SMOD=1 TH1Reload = 256 - (XTAL / 6 / 16 / baud_rate)
Did you notice the division by 12 and division by 6 (which would agree with you getting exactly a factor 2 wrong baudrate)? What conclusion did you make?
Did you notice that the calculator also had a question "SMOD 0 = uart_x1, 1 = uart_x2", and the demo evaluations below the calculator performed either a division by 32 or by 16 for SMOD=0 or SMOD=1? What conclusion did you make?
'm sorry...but i didn't get u..