max232 and pic16f877a

Status
Not open for further replies.

Eng.Abbasi

New Member
hello all

im using USART module in pic16f877a to transfer data to the serial port of my pc . first do i have to use max232 to make the preparation for the PC port or not,
second i used value d'31' in the BRGH register to set baud-rate 9600 was it wrong?

and thanx for all
 
The serial port of a PC does use RS-232 levels so I would say that you need the transceiver. The value in the BRGH register depends on the frequency of operation of the PIC, so the value you used may or may not be correct. What does the datasheet say?
 
Check my tutorials, the last of the RS232 ones uses the hardware USART at 9600 baud with a 20MHz crystal.
 
You can download an Excel 2000 SPBRG Calculator spreadsheet from this thread on Forum Microchip; **broken link removed**

There's also a single-file stand-alone application (screen shot below) you can download from that same thread.

Regards, Mike

**broken link removed**
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…