PDA

View Full Version : PC interface



tigrot
- 9th October 2004, 15:07
hi there!

first of all i want to congratulate all users in this forum because you are making this forum very interested! well done!

now,i am a newbie in both using the PICBasic and the pic 16F877 and i wish to make communication between the pic and the pc.From the datasheet,i found out that the pic has a USART and that port C has TX and RX pins.i concluded that i can communicate with the pc directly using USART (i.e. without using any max232) and this is what i wish to do.

i wish to interface the pic using portc only (because i am using the other ports for other devices like lcd etc) and without using any max232 but my problem is that i don't know how to make both the hardware interface (i do not wish to make a mistake and "burn" the pc serial port) and the programming part (because i am new to PICBasic although i have read many posts here and discovered some codes like SERIN,SEROUT etc).

can you pls help me?

Thank You

Melanie
- 9th October 2004, 19:32
If you use the Hardware USART you MUST use an hardware inverter, either a MAX232 or equivallent, or just a simple transistor as an invertor. You cannot invert the USART through a software setting.

Only SOFTWARE asynchronous communication options such as DEBUG, DEBUGIN, SERIN, SEROUT, SERIN2 and SEROUT2 give you the ability to invert. You can connect then as per the diagrams in your PICBasic manual using just a simple series Resistor. I have used values as low as 1K5 without doing any harm to the PIC.

If you are new, start with software and work you way up to the Hardware after you feel more comfortable. In the code examples section is a ready-to-run application "Communications Example : PC to PIC bi-directional dialogue" just change the ports and settings for your preferred PIC, Port and Pins.