On Sat, 1 Apr 2000, Josh Wardell wrote: > I am using a 16F876 for a project and need to implement standard > asynchronous RS-232 serial transmission (and reception) for part of it. > Unfortunately, after exploring the PICLIST archives and the small amount of > documentation Microchip has on the subject, I have been unable to > successfully send or receive data over a serial port to terminal software. I > have found some samples from the PICLIST search that seemed like they would > work, but again I have been unsuccessful. Time is becoming an issue, and I > would greatly appreciate any help I could get. > Because so many things are involved with serial communication, it is hard > to track down what is going wrong. And, unfortunately, no code I have seen > is complete from the start to beginning. Can someone possibly give me an > entire source file that they have confirmed works, that simply transmits and > receives a few characters? > Also, everything I have read only seems to mention using the Tx and Rx > pins on Port C. Are connecting these pins to the opposite pins on a serial > port all that is needed? Is there no need for any RTS/CTS connections etc? > Thanks for your time and any help you can give. Below are the details of > my configuration. Please be patient as I have limited experience. > > Using PIC 16F876 > 4.000 MHz OSC > Powered at 5V TTL > Programming in Microchip MPLAB 4.99.07 > with Picstart PLUS programmer 2.01.00 Josh, I haven't used a 'real' 16F876, however I've studied it quite a bit in developing a simulatable version for gpsim. While searching the archives you may've ran across my post on this subject. In the past week or so, I've updated the sample code that illustrates how the uart can be programmed. This is a simple example that I use only for testing gpsim. There are probably much better examples that target other processors than the 16f876. But keep in mind that they all implement the same uart (AFAIK). So you may be better off trying to search for uart drivers for the C65 or C74. But here's the example http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/~checkout~/examples/14bit/usart_14.asm?rev=1.2&content-type=text/plain&cvsroot=gpsim (which may wrap around in your mail reader) In general, you can view this and other examples in gpsim's CVS repository at: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/examples/?cvsroot=gpsim Scott