Project 13 – UART to computer

PROJECT 13

UART TO COMPUTER

Back to Project 12                                                                                                    Go to Project 14

Universal Asynchronous Receive/Transmit (UART) has becoming a popular item on sending and receiving data in the fast way. In here, we are going to experience on how to use UC00A to communicate with our computer/PC and SK40C.

———————————————————————————————————————————————————-

COMPONENT NEEDED

———————————————————————————————————————————————————-

16 x 2 LCD DISPLAY
  USB TO UART CONVERTER
  HYPERTERMINAL INSTALL
  JUMPER WIRES

———————————————————————————————————————————————————-

CONNECTION

———————————————————————————————————————————————————-

To interface between UC00A and SK40C required only 4 wires connection which is power supply (VDD), ground(GND), transmit(TX) and receive (RX). For serial communication, the transmit and receive for UC00A and SK40C have to be connected in duplex. Please refer figure below and UC00A datasheet.

———————————————————————————————————————————————————-

ADDITONAL INFORMATION

———————————————————————————————————————————————————-

Wires in PIN1 and PIN2 are switch for the second connecter.

HYPERTERMINAL INSTALLATION
HyperTerminal for WINDOW VISTA & 7 please download from this webpage. For WINDOW XP please refer to UC00A datasheet.

STEPS:
1. Open hypertrm.exe. Next, LOCATION INFORMATION will pop up like figure below. Then, click CANCEL until you see the CONNECTION DESCRIPTION.

2. Enter a project name then click OK.

3. Choose the suitable COM port by referring to the DEVICE MANAGER.

4. Setting up the COM PROPERTIES Like figure below

5. Go to FILE > PROPERTIES > SETTING > ASCII SETUP and tick like figure below. After that, the HyperTerminal is ready to go.

———————————————————————————————————————————————————-

CODE OVERVIEW

———————————————————————————————————————————————————-

uart_putstr(“Ready To Receive & Transmit!!”)
Send a string of ASCII through UC00A and display on HyperTerminal to tell the computer that SK40C is ready.

for(i=0 ; i<32 ; i++)
{
if (i == 15) lcd_2ndline();
else if (i == 31) lcd_home();
}
This loop is to count and make sure that the word are display on LCD. This is to make sure that every word display can seen which is for 1st line LCD address are from 0x00 until 0x0F and for 2nd line LCD address are from 0x40 until 0x4F. If “i” counted 15, it automatically shift the cursor to 0x40 and when “i” counted 31, it back to 0x00.

uc_uart_receive();
Receive the data from computer.

data = RCREG;
Store the bytes of data receive in “data”.

send_lcd_data(1,data);
end the data received to LCD which sending the 1 to telling the LCD that the data is a character. The data received from the computer are in ASCII, so there was no need any conversion.

Back to Project 12                                                                                                    Go to Project 14

———————————————————————————————————————————————————-

ATTACHMENT

1. P13 User Manual.pdf
2. Project_13_code.zip

Buy

, , , ,

Related Post

Control and Monitor via SMS Part 2

Simple steps to control Stepper Motor using 2Amp Motor Driver Shield and CIKU

PIC16F VS PIC18F:Analysis of PIC Mid-Range 8 bit family and Advanced 8-bits Family

Gesture Sensor (APDS9960) interface with SK40C+PIC16F877A

7 thoughts on “Project 13 – UART to computer

  1. I am currently study and new in PIC and I need to know if the SK40C-(PIC16F877A) are able to communicate with gsm via usb 2.0?? If yes could you please suggest a method.

  2. No, PIC16F877A cannot communicate directly with USB device. You will need a USB host to communicate with USB device. USB host is something like computer. I would suggest you to find out more about USB.

Leave a Reply

Your email address will not be published. Required fields are marked *