HOME Technical Tips  


The serial port drives and powers PIC16F870. 4 analogue inputs, 6 digital inputs and 6 outputs are serially interfaced between the PC and the PIC. Included a VB6 software, Visual Studio 2005 C# code, PIC C code and a circuit diagram. The application transmits 1 byte of PIC outputs data and receives 9 bytes of data from the PIC.
The PC application can be changed or replaced if the inputs or outputs are to drive other software on the PC.
You can read more about serial interface in http://www.beyondlogic.org/spp/serial.htm

VB6, C#, PIC code and circuit diagram download. You are free to use the circuit diagram and the VB software with no limitations.

The VS C# application.

Circuit Description
See also Technical Tips

Pin 4 at the serial port is turned to +12V by the software enabling DTR. It is regulated to 5V by LP2950 or equivalent. The 5V from the serial port can drive the PIC with about 1mA to spare.
The Optional 8-15V Supply is used in case that extra source current needed from the PIC outputs to drive LEDs or relays.
Pin 3 is used to drive RX input, BC337 reverse the signal phase.
Pin 2 transmit the PIC output to the PC RX receive input. The signal is powered by 12V from pin 4 and -12V from pin 7.
Pin 7 RTS is held at -12V by the VB software.
Analogue inputs are 0-5V. Digital inputs are TTL type. 1K resistors are for protecting the inputs from over voltage.



Comments and questions

Copy the number from the picture It stops net-robots from adding comments.

03.02.2019 - 00:50
Name: Bell
Comment: Very helpful for me, thank you very much

03.02.2019 - 00:49
Name: Bell
Comment: Very helpful for me, thank you very much

21.05.2015 - 00:19
Comment: if possible you can change ccs c code.?? thanks. best regards.

21.05.2015 - 00:17
Name: emin
Comment: yes. I mistake. this codes hi-tech c codes. I don't know hi-tech c. firs time I understand in ccs c. sorry. thanks everything.

16.05.2015 - 23:57
Name: Moty
Comment: Hi Emin, I checked the files and they are OK, try downloading again.

16.05.2015 - 11:46
Name: emin
Comment: very useful. Thanks. everything ok. but c sourch file is incomplete. if possible can you send me full c file. thanks. m.eminerden@gmail.com

25.08.2014 - 11:01
Name: Massoud
Comment: Very useful, thank you.

iconFlag Countermoty22.co.uk  2008-2022