MikroC has two sets of built-in library functions for UART communications: Software UART and Hardware UART . Since PIC16F628A has a built-in hardware USART module, we are going to use the Hardware UART library. Some PICs don't have hardware USART, such as PIC16F84A. In such cases, any digital I/O pins of PIC can be used for Asynchronous Serial Data Transfer using mikroC Software UART libraries. Experimental Setup The UART Rx and Tx pins in PIC16F628A are multiplexed with RB1 and RB2 pins. In this experiment, we are just sending some character data from PIC to a PC as demonstration of the technique. On PC, the HyperTerminal program should be running to receive data from the PIC16F628A. Since our PIC board does not have a TTL to RS232 voltage level shifter, we are going to construct it on a breadboard. Here is my Level Shifter Circuit:
PIC Programming in C