Microchip PIC Networks Amrit Bandy, Ben Funk Neil Goldsman.

Slides:



Advertisements
Similar presentations
EUSART Serial Communication.
Advertisements

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
Review: Interrupts & Timers
ECT 357 Ch 18 UART. Today’s Quote: Be careful that your marriage doesn’t become a duel instead of a duet. Be careful that your marriage doesn’t become.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
DATA COLLECTION USING ZIGBEE NETWORK Timothy Melton Moscow, ID.
Starting with serial Chapter Ten 10.1, 10.2,
USARTS CS423 Dick Steflik. USART ● Universal Synchronous Asynchronous Receiver Transmitter ● used to send and receive small packets over a serial line.
Eng. Husam Alzaq The Islamic Uni. Of Gaza
Electronics and Networks: Dumb things with Wires Week 2: Serial Overview Jonah Brucker-Cohen Matthew Karau Monday 10am - 12pm Trinity College Dublin MSc.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Wireless Data Link for a Hospital Advisor: Prof Yngvesson Team: Shruti Sharma Wen Lo Ike Amazu.
Wireless Data Acquisition for SAE Car Project by: J.P. Haberkorn & Jon Trainor Advised by: Mr. Steven Gutschlag.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
Serial Communication ETEC 6416.
ECE/CS-352: Embedded Microcontroller Systems Embedded Microcontroller Systems.
Wireless Intelligent Sensor Modules for Home Monitoring and Control Presented by: BUI, Phuong Nhung, 裴芳绒 António M. Silva1, Alexandre Correia1, António.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Chapter 4 TIMER OPERATION
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
Lecture Set 9 MCS-51 Serial Port.
“Describe the overview of hardware interfacing and the serial communication interface. Describe the PIC18 connections to RS232. Explain the serial port.
Universal Asynchronous Receiver/Transmitter (UART)
RS232 #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
Embedded System Design Laboratory October 4, 2002Stanford University - EE281 Lecture #3#1 Lecture #3 Outline Announcements AVR Processor Resources –UART.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Example. SBUF Register SCON Register(1) SCON Register(2)
Universal Asynchronous Receiver/Transmitter (UART)
8051 Micro controller. Architecture of 8051 Features of 8051.
ECE/CS-352: Embedded Microcontroller Systems The Silicon Laboratories C8051F020 Enhanced 8051 Part 4 Timer3, Temperature Sensor, AD0WINT.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
The Principle of Electronic Data Serial and Parallel Data Communication Transmission Rate Bandwidth Bit Rate Parity bits.
This material exempt per Department of Commerce license exception TSU Architecture Wizard and PACE Lab 2 Introduction.
CSCI1600: Embedded and Real Time Software Lecture 16: Advanced Programming with I/O Steven Reiss, Fall 2015.
Lecture 3 CSE 341 – Microprocessors Lecture 3 Md. Omar Faruqe UB 1228
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Serial Communication RS-232. In order to make two devices communicate, whether they are desktop computers, microcontrollers, or any other form of integrated.
Microcontrollers JULES CALELLA. Microcontrollers vs Microprocessors  Microprocessors – do not contain RAM, ROM, I/O  Microcontrollers – The whole package.
TRANSMISSION LINE MULTIPLE FAULT DETECTION AND INDICATION TO EB
Criteria for choosing a microcontroller A microcontroller must meet the task at hand efficiency and cost effectively. Speed. What is highest speed of.
Wireless control of an LED. the XBee transceiver transmitter: sends radio waves receiver: receives radio waves transceiver: sends AND receives.
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective.
Application Case Study Christmas Lights Controller
Serial Communications
Serial I/O Port.
Embedded Microcontroller Systems
Application Case Study Security Camera Controller
Serial mode of data transfer
68HC11 Interrupts & Resets.
Embedded Microcontroller Systems
Source: Serial Port Source:
Serial I/O and Data Communication.
SERIAL PORT PROGRAMMING
Atmega32 Serial Programming Basics
ECE 3430 – Intro to Microcomputer Systems
Source: Serial Port Source:
Asynchronous Serial Communications
Serial Communication Interface
Source: Serial Port Source:
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
ECE 3430 – Intro to Microcomputer Systems
EUSART Serial Communication.
Source: Serial Port Source:
PIC Serial Port Interfacing
PIC Serial Port Interfacing
AVR UART The UART, or Universal Asynchronous Receiver Transmitter, provides hardware support for a serial port on AVR processors Signaling is compatible.
Presentation transcript:

Microchip PIC Networks Amrit Bandy, Ben Funk Neil Goldsman

2-Node Wired Set-up PICs hooked up with wire connections PICs are small micro-controllers made by Microchip Tx μP1μP2 Tx Rx µP: 16F88 by Microchip Features Built in A/D Conversion Module Universal Asynchronous Transmit and Receive using Tx and Rx ports. (Serial communication controlled by programmer)

Step 1: Establish Network via Clock Synchronization Node Clock Definition: –Built-in 8-bit timer, counts up from 0 to 255, sets off an interrupt upon overflow. Prescalar of up to 256 available. –Node Clock (our timer) updates every time the interrupt occurs (part of code) Synchronization of Clocks –Node A transmits its NodeClock to Node B while Node B receives it and updates its own NodeClock

Timer Synchronization Algorithm Node A: 1.Setup Tx Port for RS232 Transmission and Rx port for RS232 Reception using Universal Asynchronous Reception and Transmission 2.Check for hardware switch-If “on” goto 5 else 3 3.Transmit packet comprising AB in hex (frame sync byte to intelligently qualify data packet to follow), followed by the NodeClock 4.Goto 2 (only one or two iterations needed) 5.Transmit NodeClock value to Real Terminal on Computer and print value on screen. Step 5 is to test the node synchronization

Timer Synchronization Algorithm Node B: 1.Setup Tx Port for RS232 Transmission and Rx port for RS232 Reception using Universal Asynchronous Reception and Transmission 2.Check for hardware switch-If “on” goto 7 else 3 3.Receive first byte, if it is not equal to ABh repeat 3. 4.Clear and start NodeClock 5.Receive second byte (clock of node A), add to NodeClock to update NodeClock 6.Goto 2 7.Transmit NodeClock value to Real Terminal on Computer and print value on screen. Step 7 is to test the node synchronization

Step 2: Data Transmission After Synchronization Voltages represent sensor node reading Each node compares its own voltage with voltage received from the other node and an LED is lit on the node with the highest voltage Procedure: –Assign PIC_id for each node and COMM_id for the node that is transmitting –Establish Network by synchronizing clocks –Transmission and Reception are carried out in equal slots (TDMA) –Transmitting slot includes reading A/D data and transmitting packet –Reception slot includes receiving packet, comparing voltages of all the nodes, and lighting LED –Update COMM_id to give next node a chance to transmit data

Data Transmission Algorithm 1.Synchronize timer to node A 2.If PIC_id=COMM_id goto 3 (transmit) else 7 (receive) 3.Read A/D voltage(10 significant bits) into two 8-bit registers, right justified 4.Transmit packet: ABh, NodeClock, highbyte(data), lowbyte(data) 5.Update COMM_id to allow next node to transmit 6.Wait for slot to expire, goto 2 7.Receive first byte, if it is not equal to ABh goto 7. 8.Clear and start timer 9.Receive second byte, add to NodeClock to update NodeClock 10.Receive highbyte (data) followed by lowbyte (data), and store information for the node which is transmitting 11.Compare voltages for all nodes, light LED if self is highest 12.Update COMM_id, Wait for slot to expire, goto 2

Step 3: Extend Wired Setup to 3 nodes Issue: 16F88 has only one Rx port! Solution: Use AND gate to choose correct line, since the transmitting line is high while receiving. TxRx µP1 TxRx µP2 TxRx µP3

3-Node Wired Setup Using AND Gates Why AND gates? Transmitting line is high while receiving Truth Table shows that the AND gate reproduces the Tx signal TxRxOut Slot1Slot2Slot3 NodeATxRx NodeBRxTxRx NodeCRx Tx

Step 4: Remove the Wires – Employ Transceivers Transceiver used: TR-916-SC-P by Linx Technologies TXEN pin to enable Transmit RXEN pin to enable Receive Can only transmit or receive at a time Algorithm remains the same except –Allow enough time for transceiver to start-up –Enable TXEN, disable RXEN for transmit –Enable RXEN, disable TXEN for receive

Testing Steps 1-4 Setup: 3 PIC 16F88 microcontrollers connected to potentiometers. Nodes B&C synchronize themselves to Node A, transmit their own voltages, receive that of the others, compare and indicate who is the highest using an LED. Baud Rate: 19.2Kbps Transmit/Receive Slots : 200ms with 20MHz clock Results: Both the wired and the wireless models work for 3 nodes.