Communication using the USB to TTL cable is very simple, In this tutorial we are going to create and embedded system that converts all text to upper case. All characters that are sent to the microcontroller are sent back to the PC. If the character is in the range 'a' to 'z' then these are sent back as 'A' to 'Z'. The entire program written in 'C' using
the CCS compiler is
shown below...
The CCS compiler contains functions to setup and configure the PIC's USART (Universal Synchronous-Asynchronous Receiver/Transmitter), It also has built in functions to receive, transmit and even change character cases. We will look at each of these steps in turn without using built in functions so that we get an understanding of what is going on. Microchip supply an Integrated Development Environment (IDE) for the PIC microcontroller absolutely free (MPLAB). This also includes an Assembler. The software examples are coded in C in this tutorial, and although C Compilers for the PIC are generally very expensive the HI-TECH compiler is completely free for some of the popular PIC types. Most C compilers integrate into the Microchip IDE. The Example code is provided for this tutorial requires MPLAB and the HI-TECH compiler. It is outside the scope of this tutorial to step through the installation of this software. |