RS-232 UART Problem in PIC18F2550

Status
Not open for further replies.

Briez

Member level 5
Joined
Nov 30, 2012
Messages
83
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Visit site
Activity points
1,835
I am programing UART in pic18f2550, and it works well in proteus.

But i can't get required output on my hyperterminal.

I have made my circuit like,

Code:
MCLR= +5V
VSS= 0V
VDD= +5V
Crystal(16.590Mhz)= Pin 8-9 (uC)

RC7(RX) = PIN-12 of max232
RC6(TX) = PIN-11 of max232

RC7 made input pin by TRISC
RC6 made output pin by TRISC.

Config bits are,

PLLDIV= 00
FOSC= 0C
PWRT= 1F
WDT= 1E
MCLRE= Enabled, RE input Disabled.
and max232 connection is shown in figure,
 

Hi,

You need to give a bit more info, like your Usart program code.

Check your actual chip make and number, the Maxim datasheet for the MAX232 chip states 1uf caps.
Also needs a cap from pin 16 to ground.

Again check your 232 chip pin outs they should be 11 to 14 and 13 to 12

Hope you mean you have got the crystal across pins 9 and 10 ?

With the frequency of the crystal you are using, does that match up ok with the baud rate calculations /settings in your program code ?
You are aware the 2550 has decent internal oscillator that works ok with th Usart ?
 

Attachments

  • 000043.jpg
    43.5 KB · Views: 144


I have used 1uf/100v cp of all. And look at attached picture if you worry about program that it works fine in proteus with baudrate 9600 and crystal 16.590Mhz.


I have loaded SPBRG value 107(decimal) with BRGH=1 according to calculation for crystal of 16.590mhz at pins 9-10.
 

Briez, some tip, I saw in your proteus schematic that RS pin of LCD is floating, I suggest you to check that in program. It is not related to your main problem, but in practice it could be.

About your serial port problem:

Try to locate the datasheet errata for PIC18F2550 and look for any UART corrections.
Verify if your hyperterminal (PC) if correctly configured, i.e. Baud Rate, Data Bits, Parity, Stop bits, and so on. If you can try to use a device known to be functional to test communication with your PC.

I hope this can help you to find a solution. Yosmany325.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…