Demo 17 - Receiving data from Host through Serial Port. Introduction:

Similar documents
Demo 20 - Sequential Sampling of ADC. Introduction:

Demo 8 - Programmable Timer. Introduction:

The Timer RB output pin P31 (TRB0) is connected to a point LED to view the mono shot pulse duration.

In the HEW, open a new project by selecting New workspace from the main menu.

8051 Serial Communication

Serial Communication Prof. James L. Frankel Harvard University. Version of 2:30 PM 6-Oct-2015 Copyright 2015 James L. Frankel. All rights reserved.

A pplications Engineering. Powerful Processors Easy to Use. SKP8CMini-13. User's M anual. Rev. 1.0 October w w w.renesas.com

M16C R8C FoUSB/UART Debugger. User s Manual REJ10J

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP2

8051 Microcontroller

ARM HOW-TO GUIDE Interfacing GPS with LPC2148 ARM

Document: Datasheet Date: 22-Mar-11 Model #: 3679 Product s Page:

MCS-51 Serial Port A T 8 9 C 5 2 1

Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation

Emulating an asynchronous serial interface (ASC0) via software routines

A pplications Engineering. Powerful Processors Easy to Use. SKP8CMini. User's M anual. Rev. 1.2 January w w w.renesas.com

Z8 Encore! XP F0822 Series Development Kit

Manual of Board ET-PIC STAMP 18F8722-K22 ET-PIC STAMP 18F8722-K22

EET203 MICROCONTROLLER SYSTEMS DESIGN Serial Port Interfacing

Sender Receiver Sender

Am186ER/Am188ER AMD continues 16-bit innovation

ACT-IR8200P. IrDA Compliant Protocol Processor Preliminary Specification. Copyright 2003 ACTiSYS Corporation, All Rights Reserved

Interfacing a Hyper Terminal to the Flight 86 Kit

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

ET-PIC 24 WEB-V1. o Central Processing Unit (CPU) o System. o nanowatt Power Managed Modes. o Analog Features

ZigBee Compliant Platform 2.4G RF Low Power Transceiver Module for IEEE Standard. DATA SHEET Version B

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP3

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing

8051 Timers and Serial Port

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP9

Microcomputer System Design

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

EASY219 / IEC CANopen Master / Slave

Menu. What is SPI? EEL 3744 EEL 3744 SPI

Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

Features: Analog to Digital: 12 bit resolution TTL outputs, RS-232 tolerant inputs 4.096V reference (1mV/count) 115K max speed

Bluetooth Interface Module

Serial communication

AP16050 SAB C161V/K/O. Emulating an asynchronous serial interface (ASC) via software routines. Microcontrollers. Application Note, V 1.0, Feb.

8051 Microcontroller

Hints and tips when using RC1xx0 RF Modules

Galep-Adapter DIL-40 => ISP-ASYNC/SYNC Article-No.:

Emulating an asynchronous serial interface (USART) via software routines

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

F2MC MB90385 series Evaluation Board Documentation. Revision Date Comment V New document

The Freescale MC908JL16 Microcontroller

CF-850/F1KM-176-S Hardware Manual

USB MOD1 - USB Plug and Play Serial Development Module

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

1. Specifications Functions Used Operation Software Flowcharts Program Listing... 13

CF-850/F1K-144-S Hardware Manual

CHAPTER 1 MICROCOMPUTER SYSTEMS. 1.1 Introduction. 1.2 Microcontroller Evolution

OE 20 C1 OE20C VCC RxD RST LED1 LED2. TxD XTAL2 XTAL1 NC. TxK TxL. RxK GND. v /05/2004. Features

S3F8S5A Development Kit

5WG AA_1 TECHNICAL DATA. KNX-Processor 78F0534/2.5, 78F0535/2.5 and 78F0537/2.5. Features. Description. Order Numbers

MSP430-EasyWeb3 development board Users Manual

IA186EB/IA188EB. 8-Bit/16-Bit Microcontrollers. Data Sheet. 8-Bit/16-Bit Microcontrollers January 9, 2015

Nios Embedded Processor Development Board

MOS INTEGRATED CIRCUIT

AN Interfacing Philips Bridge IC with Philips microcontroller. Document information

The Atmel ATmega168A Microcontroller

Fig.12.5 Serial Data Line during Serial Communication

Experiment# 8: Photo-Interrupter Control

KNX-Processor 78F0534/2.5, 78F0535/2.5 and 78F0537/2.5

Nuvoton 1T 8051-based Microcontroller NuTiny-SDK-N76E885 User Manual

ST78C34 GENERAL PURPOSE PARALLEL PRINTER PORT WITH 83 BYTE FIFO DESCRIPTION. PLCC Package FEATURES ORDERING INFORMATION

SRL0 Serial Port Unit

8-bit RISC Microcontroller. Application Note. AVR 305: Half Duplex Compact Software UART

HP 48 I/O Technical Interfacing Guide

MF1-RW-TTL-PCB Mhz Mifare ISO14443A reader/writer module with TTL interface CONTENT 1. MAIN FEATURES...,, PINNING INFORMATION...

The Atmel ATmega328P Microcontroller

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

OE90C2600 OE90C2600 PLCC-28. mobydic 2600 plus version 1.00 released Features

ALE/PROG# is pulsed low during programming,

1.3inch OLED User Manual

8086 Hardware Specification

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Communication Module No: CS/ES/11 Quadrant 1 e-text

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

8051 Serial Port. EE4380 Fall02 Class 10. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

V850ES/SG3, V850ES/SJ3

SPART. SPART Design. A Special Purpose Asynchronous Receiver/Transmitter. The objectives of this miniproject are to:

LM072 Bluetooth Module Standalone (With Embedded Bluetooth v2.0/v2.1 Stack)

PCI based dual UART and printer port chip CH352

PIC-I/O Multifunction I/O Controller

Preliminary. PACKAGE - 28-pin MLP (5mm X 5mm) Example Circuit Diagram CP V. 48MHz Oscillator. USB Function Controller 512B EEPROM

AN ELNEC EN ISP-HC08. Application note for In-System Programming of Motorola/Freescale HC08 microcontrollers

Three criteria in Choosing a Microcontroller

Megawin 8051 ISP via COM Port

Application Note. Megawin USB EasyCOM

SPART. SPART Design. A Special Purpose Asynchronous Receiver/Transmitter. The objectives of this miniproject are to:

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP

2 in 1. BigAVR User s Manual AVR. MikroElektronika. Software and Hardware solutions for Embedded World

PIC-P67J60 development board Users Manual

DEV-1 HamStack Development Board

Serial Communication. Spring, 2018 Prof. Jungkeun Park

Lecture 25 March 23, 2012 Introduction to Serial Communications

Transcription:

Introduction: This demo program gives an idea about receiving data from the host using the serial port in asynchronous mode at 500 baud using serial port 0. The received data will be stored in the RAM area of the micon. The starting address and number of bytes are also sent from host along with data. Hardware: The serial port lines RXD0 and TXD0 are level shifted using the RS level shifter device MAX and terminated in a 9 pin DIN connector. The host serial port lines and the micon s serial port lines connected using a serial port cable. For minimum configuration, three lines are to be connected between the host and the micon namely RXD, TXD and Ground. The ground of micon circuit is connected directly to the host ground. The RXD line of micon is connected to the TXD line of host and the TXD line of micon is connected to the RXD line of host as shown below: 6 7 8 4 9 5 6 7 8 4 9 5 Micon Side Host Side The pins, 6, 4, 7 & 8 of the 9 pin DIN connector at host are connected as shown to loop the hardware handshaking signals.

Circuit: +5V C PF C4 PF +5V PROGRAM NORMAL JP C NC XTAL 0MHZ C NC R 4K7 +5V +5V VREF EX +5V C 0.uF C 0.uF +5V R 0K + JP4 D IN448 U CD4006 C6 4.7uF JP JP + C 0uF + C4 0uF C 0uF + C 0uF C5 0uF CON7 6 7 8 4 9 5 Serial Port + + SW RESET 4 XOUT/P47 CNVSS RESET U P7/TXD0/RXD R8C/ VCC 7 5 VSS IVCC 6 8 P/TZOUT XIN/P46 MODE P0/KI0 5 P/KI 4 P/KI P/KI P4/TXD0 P5/RXD0 0 P6/CLK0 9 P7/INT/CNTR0 8 P0/CNTR0 P45/INT0 6 AVSS 0 8 9 P/INT/CNTR AVCC/VREF P00/AN7/TXD P0/AN6 0 P0/AN5 9 P0/AN4 P04/AN 7 P05/AN 6 P06/AN 5 P07/AN0 4 P/INT/TCIN 7 4 5 0 9 U MAX C+ V+ C+ V- C- C- TIN TOUT TIN TOUT ROUT RIN ROUT RIN 6 4 7 8 5 VSS VDD 6 R 4K7 4 CD4006 U

Functional Description: In asynchronous mode, each transmitted or received character begins with a start bit and ends with one or two stop bits. Serial communication is synchronized one character at a time. The transmitting and receiving sections of the SCI are independent, so full-duplex communication is possible. The transmitter and the receiver are both double-buffered, so data can be written and read while transmitting and receiving are in progress, enabling continuous transmitting and receiving. Figure shows the general format of asynchronous serial communication. In asynchronous serial communication the communication line is normally held in the mark (high) state. The SCI monitors the line and starts serial communication when the line goes to the space (low) state, indicating a start bit. One serial character consists of a start bit (low), data (LSB first), parity bit (high or low), and one or two stop bits (high), in that order. When receiving in asynchronous mode, the SCI synchronizes at the falling edge of the start bit. The SCI samples each data bit on the eighth pulse of a clock with a frequency 6 times the bit rate. Receive data is latched at the center of each bit.

Registers Used: U0MR - UART0 transmit/receive mode register U0C0 - UART0 transmit/receive control register 0 U0C - UART0 transmit/receive control register U0MR - UART0 Transmit/Receive Mode Register: UMR register is initialized with the data H 05 to select following options:. UART mode transfer data 8 bits long,. Internal clock,. Stop bit, 4. No parity. 4

U0C0 - UART0 Transmit/Receive Control Register 0: Data H 00 is set to register U0C0 register to select following options:. fsio clock is selected,. TXD pin is a pin of CMOS,. Transmit data is output at falling edge of transfer clock and receive data is input at rising edge, 4. LSB First. 5

U0C - UART Transmit/Receive Control Register : Bit RE is set to enable reception. Software Description: The data received from host through serial port is stored in RAM area of micon. The serial port 0 is used in standard 8 bit UART mode with no parity and one stop bit. The serial port 0 is configured to read data at 500 baud rate @ 0MHZ. After reset,. The external crystal oscillator is selected as clock source for MCU and other peripherals.. The serial port 0 is initialized in 8 bit mode with one stop bit and no parity configuration at 500 baud rate @ 0MHz. After the initialization, the control will read two bytes of data from host for address of RAM area. Then the number of bytes is read from host as one byte data. Finally the actual data are read from host through serial port 0 and stored in RAM area. 6

The functions in the file Demo7.C and short descriptions are listed below: Functions main ClockInitialization Description Initializes the serial port 0 and sends the programmed message through serial port0. Input: None. Output : None. Selects the external crystal oscillator as clock source for the CPU and other peripherals. Input: None. Output : None. InitializeSerialPortChannel0 Initializes the serial port 0 in 8 bit mode at 9600 baud rate. Input: None. Output : None. ReadByteSerialPort0 Sends the given message to host through serial port 0. Input: Message. Output : None. 7

Program Flow: Start Initialize the clock circuit and select the external clock for CPU operation. Initialize serial port 0 in 8 bit UART mode with no parity and one stop bit. Receive bytes of address. Receive number of bytes. (count) Read one byte of data and store it in RAM. Decrement the count and check with 0.!= 0 = 0 Halt 8

Execute Demo: After reset, the data sent from the host are received through serial port 0 and stored in RAM area. 9

Use Topview Simulator to Verify the Design. Open the project Demo7 in the R8C/Tiny System Simulator using Open Project option from Project menu. The project window opens up along with the Demo7.c file. Use Build option from Build menu to compile the project. An output window captures the compiler ouput. Use Project -> Download Project from main menu to download the.mot file into the simulator s memory for simulation. Open the simulated host window make the setting as shown below: 0

Open Serial port, Simulated host and RAM area windows and arranage them as shown below.

Down load the program using Download Project command in Project menu. Run the program using Go command in Run menu. In this demo program, a group of data is sent from the simulated host window to micon s serial port 0. The data sent from the host received in micon and stored in the RAM area. The group of data is already created as as data file in the name of test.dat and the data from this file is sent from host. Now press the Send button in host window, this will read the data from the given file and sends the data to serial port 0.