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...
checked the com port,baud rate settings as well...
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... "c pulses there" the pulses do not care if you wrote in c or asm
anyhow, try instead to continously transmit 'U' that will give you a square wave with a frequency if 1/2 baudrate.
BTW you DO have a MAX232(equivalent) in the circuit?
Erii
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