And regarding the second question (MAX232), yes, you generally need to convert from TTL levels to EIA232 levels. The USART outputs a 1 (+5V) for the mark condition, and outputs 0V for the space condition. EIA232 is generally -12V for mark (there's actually a wide range of acceptable voltages, but -12V is typical), and +12V for space. So, you need to invert the signal and change voltage levels. Most EIA232 receivers will accept 0V as a mark, so it's possible (though not within the standard) to directly drive an EIA232 receiver with TTL levels. However, the logic levels still need to be inverted, since a low (-12V) is a mark. If you are bit banging the data, you can do this inversion in software. If you're using the USART, you need to do this change in hardware. The old standard chips are the MC1488 quad EIA232 driver and the MC1489 EIA232 receiver. Maxim has a variety of EIA232 transmitters, receivers, and transceivers. An interesting one I used recently is the MAX221. Its charge pumps shut down if there is not a valid EIA232 voltage on its receiver input, vastly decreasing power consumption when nothing is plugged into the EIA232 port. It also has a pin that goes high when a valid EIA signal is present. I tell the PIC16f870 to sleep when there's no terminal connected. Harold On Fri, 31 May 2002 09:44:08 +1000 Tony Nixon writes: > Rex Byrns wrote: > > > > Can anyone help me out with getting the 16f628 to work with the > picusart > > code? > > > > What is a MAX232? Do I have to have one to talk to a PC? > > > > I will probably use VB to build the PC interface. > > > > -- > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > This little zip file has some basic UART code for a 16F627 and a > 16F873. > Plus a bit banged UART. > > http://www.bubblesoftonline.com/projects.rs232.zip > > -- > Best regards > > Tony > > mICros > http://www.bubblesoftonline.com > mailto:sales@bubblesoftonline.com > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/web/. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu