Home

Sending Data using RF Module

image

Contents

1. R8 220 ROBOT HEAD to TOE PR16 Sending Data using RF Module One I O pin is needed for one LED as output of PIC microcontroller The connection for a LED to I O pin is shown in Figure 7 The function of R8 is to protect the LED from over current that will burn the LED When the output is in logic 1 the LED will ON while when the output is in logic 0 the LED will OFF SOFTWARE Flow Chart RF Transmitter Display number on 7 segment Initial number 0 Send No Initial No 0 Increase Increase button pressed number for 1 Decrease Decrease button pressed number for 1 Send button pressed No number Created by Cytron Technologies Sdn Bhd All Rights Reserved 4 Cytron Technologie ROBOT HEAD to TOE PR16 Sending Data using RF Module RF Receiver Enables continuous receive Display number on 7 segment Initial number 0 Disables continuous receive Overrun error Received data is one of 0 F Program Please download the sample program from Cytron website same directory as this DIY project The source code is provided free and Cytron Technologies will not be responsible for any further modification or improvement USART Configuration The Universal Synchronous Asynchronous Receiver Transmitter USART Module for PIC16F876A can be configured in the following mode e Asynchronous full duplex e Synchronous Master half dup
2. All Rights Reserved 3 Cytron gt In Circuit Serial Programming ICSP is used for loading program in this project ICSP offers a convenience way to load program into PIC microcontroller without removing the PIC from the circuit board Thus pin 1 Vpp pin 27 PGC and pin 28 PGD from PIC should be connected to Cytron USB In Circuit Programmer UICOOA through the external cable Besides GND from the circuit board also should be connected with GND from UICOOA and pin 24 PGM should be pulled to GND through a 10K resistor as shown in Figure 5 The programmer UICOOA is not included in DIY project set since it can be used several times for different project set User can also choose other type of PIC programmer to load the program Since the ICSP is used three I O pins RB3 RB6 and RB7 should not be used as input anyway it still can be used for output Push Button as Input for PIC microcontroller VCC 4 7K Push Button SW PB Figure 6 One I O pin is needed for one push button as input of PIC microcontroller The connection of the push button to the I O pin is shown in Figure 6 The I O pin should be pull up to 5V using a resistor with value range 1K 10K and this configuration will result an active low input When the button is being pressed reading of I O pin will be in logic 0 while when the button is not pressed reading of that I O pin will be logic 1 LED inside 7 segment as Output for PIC microcontroller
3. Cytron Technologie PR16 Sending Data using RF Module Version 1 2 Aug 2008 Cytron Technologies Sdn Bhd Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications No representation or warranty is given and no liability is assumed by Cytron Technologies Incorporated with respect to the accuracy or use of such information or infringement of patents or other intellectual property rights arising from such use or otherwise Use of Cytron Technologies s products as critical components in life support systems is not authorized except with express written approval by Cytron Technologies No licenses are conveyed implicitly or otherwise under any intellectual property rights OVERVIEW FEATURES This document describes the development of Cytron PIC16F876A Technologies DIY Do It Yourself Project No 16 8K x 14words of program memory PR16 This project will use two PICI6F876A to On board programming control RF Module Transmitter and Receiver The Universal Asynchronous Receiver Transmitter transmitter will send ODF data in Hexadecimal and UART the receiver will receive the data and display the data on RF Transmitter 315MHz 7 segment display Circuit schematic and PIC source Capable transmit signal up to 100 meters range code will be pr
4. ICI16F876A Interface PIC16F876A with RF Receiver There are 4 pins for the receiver Vcc GND and 2 Data pins The 2 data pins are internally connected each other thus connecting either one to PIC is sufficient Same as transmitter 5V is given to Vcc pin and GND pin is connected to GND of circuit board The data pin should be connected to pin 18 RC7 RX DT of PICI6F876A Power Supply for Circuit Adaptor ay DSI LED Figure 4 For this project the voltage range of power source could be given for this circuit board is between 7V and 15V Higher input voltage will produce more heat at LM7805 voltage regulator Typical voltage is 12V Anyhow LM7805 will still generate some heat at 12V There are two type of power connector on the circuit board DC plug Adaptor is for AC DC adaptor and 2510 02 Power is for battery source Normally AC to DC adaptor can be plugged to Adaptor type connector LM7805 1A maximum will regulate the given voltage to 5V Vcc for supplying power to the PIC16F876A and pull up the push button input The purpose of using diode D1 is for circuit protection in case the polarity of the power source is incorrect Capacitor C5 and capacitor C1 is use to stabilize the voltage input and output of the LM7805 DSI is a green LED small as power indicator ICSP for Programming PIC Microcontroller Pro oranumier Header 5X2 Figure 5 Created by Cytron Technologies Sdn Bhd
5. ed bit read as 0 1 Bit is set 0 Bit is cleared x Bit is unknown Figure 8 R W 0 Riw 0 R W 0 R W 0 R 1 R W 0 esre Pe J men gyno ereh Tat xeo bit 7 Dit 0 CSRC Clock Source Select bit Asynchronous mode Don t care Synchronous mode 1 Master mode clock generated internally from BRG o Slave mode clock from external source TX9 9 bit Transmit Enable bit 1 Selects 9 bit transmission o Selects 8 bit transmission TXEN Transmit Enable bit 1 Transmit enabled o Transmit disabled Note SREN CREN overrides TXEN in Sync mode SYNC USART Mode Select bit 1 Synchronous mode o Asynchronous mode Unimplemented Read as o BRGH High Baud Rate Select bit Asynchronous mode 1 High speed o Low speed Synchronous mode Unused in this mode TRMT Transmit Shift Register Status bit 1 TSR empty o TSR full TX9D 9th bit of Transmit Data can be Parity bit Legend R Readable bit n Value at POR W Wnitable bit T Bit is set U Unimplemented bit read as 0 0 Bit is cleared x Bit is unknown Figure 9 SYNC BRGH 0 BRGH 0 Low Speed Speed BRGH 1 BRGH 1 High Speed Speed Asynchronous receiver transmitter is used to translate data between parallel and serial interface in this project When doing a data communications the condition of and 1 from the side of the sending must be able to be recognized at the receiv
6. essary files and document from Cytron Technologies website www cytron com my These included documentation sample source code schematic component list and software 4 The next step is to install MPLAB IDE and HI TECC C PRO into a computer The MPLAB IDE and HI TECC C PRO can be downloaded from wWwww cytron com my Please refer MPLAB IDE installation step document to install the software The documents can be used to any version of MPLAB IDE software 5 After the installation complete open the project file provided using MPLAB IDE Please refer MPLAB Open Project document to open the sample program 6 Plug in power supply for the circuit User can choose to use battery or AD to DC adaptor ROBOT HEAD to TOE PR16 Sending Data using RF Module AC to DC adaptor ETRON TEL CONVERTER MODEL TMC 500PM INPUT AC 220 240V A o s S i o s 5 iPas tre y EA ooosbte OLANG OLEH TELETARON INDUSTRIES SDN BHD LB i NO 1 BATU 19 JALAN SEGAMAT Figure 18 not included in DIY project set E 9V battery connector Figure 19 not included in DIY project set Connection to the PCB board Figure 20 7 Build the project and load the hex file into the PIC microcontroller using the USB In Circuit Programmer UICOOA When user build the project MPLAB IDE will generate hex file The hex file generated from MPLAB IDE will be named according to project name not C file name Cytron Technologies also p
7. ing side In the asynchronous communication it puts a start bit to the head of the transferred data 8 bits or 9 bits and it puts a stop bit at the end of the data Recognition in the data block is done by it The start bit is a Low level and the stop bit is the signal of the High level Legend X value in SPBRG 0 to 255 Asynchronous Asynchronous Baud Rate Fosci 64 X 1 Rate Fosc 64 X 1 Synchronous Baud Rate Fosc 4 X 1 Figure 10 a ae value decimal BaudRate Fosc 16 X 1 Fosc 16 X 1 N A KBAUD ERROR SPBRG Figure 11 Created by Cytron Technologies Sdn Bhd All Rights Reserved Cytron 5 Technologie ROBOT HEAD to TOE PR16 Sending Data using RF Module Figure 8 and Figure 9 shows the TXSTA Register and RCSTA Register respectively First all relevant bits from TXSTA Register and RCSTA Register should be configured as shown in Figure 12 below The given baud rate from PIC microcontroller for this RF module is up to 3 Kbps However the baud rate was set to 1 2 Kbps for this project to reduce the error during sending data By referring to Figure 10 and Figure 11 SPBRG Register was set to 255 due to 1 2 Kbps baud rate fbaud rate low speed option f set boud rate to 1200bps for ZOMhz crystal f f 8 bit transmission ffenable transmission asynchronous ffenable serial port For Transmitter ffbaud rate low speed option fiset boud
8. lex e Synchronous Slave half duplex R W 0 R W 0 R W O R W O SPEN Serial Port Enable bit 1 Serial port enabled configures RC7 RX DT and RC6 TX CK pins as serial port pins 0 Serial port disabled RX9 9 bit Receive Enable bit 1 Selects 9 bit reception 0 Selects 8 bit reception SREN Single Receive Enable bit Asynchronous mode Don t care S4 1 Enables single receive 0 Disables single receive This bit is cleared after reception is complete Synchronous mode Slave Don t care CREN Continuous Receive Enable bit Asynchronous mode 1 Enables continuous receive 0 Disables continuous receive Synchronous mode 1 Enables continuous receive until enable bit CREN is cleared CREN overrides SREN 0 Disables continuous receive ADDEN Address Detect Enable bit Asynchronous mode 9 bit RX9 1 1 Enables address detection enables interrupt and load of the receive buffer when RSR lt 8 gt s set 0 Disables address detection all bytes are received and ninth bit can be used as parity bit FERR Framing Error bit 1 Framing error can be updated by reading RCREG register and receive next valid byte 0 No framing error OERR Overrun Error bit 1 Overrun error can be cleared by clearing bit CREN 0 No overrun error RX9D 9th bit of Received Data can be parity bit but must be calculated by user firmware amp Legend R Readable bit n Value at POR U Unimplement
9. ovided around the open area Wide input supply 2 5 12V Small dimension ASK Modulation RF Receiver 315MHz Super regeneration design ensures sensitive to weak signal Low power consumption 4mA Small dimension Created by Cytron Technologies Sdn Bhd All Rights Reserved l Cytron 5 Technologie SYSTEM OVERVIEW 7 Segment Push p Microcontroller PIC16F876A 7 Segment Microcontroller PIC16F876A ROBOT HEAD to TOE PR16 Sending Data using RF Module RF Transmitter 315MHz GENERAL DESCRIPTION Cytron Technologies offers several wireless modules such as RF Module Bluetooth Module and ZigBee Module This project will discuss about how RF module function with a microcontroller For this project there are 2 separate circuit boards with a microcontroller PIC16F876A each One board is for transmitter while another for receiver Hexadecimal number from 0 to F which display on 7 segment can be chosen for transmitting The receiver will receive the sent data and display the number RF Module RF Transmitter 3 15MHz Figure 1 This low cost RF transmitter can be used to transmit signal up to 100 meters the antenna design working environment and supply voltage will seriously impact the effective distance It is good for short distance battery power device development It has benefits of e Wide input supply 2 5V 12V e Easy to integrate Data Vcc and GND e Device in dee
10. p sleep mode when Data pin is grounded e Very small dimension Specification Operating Voltage 2 5 V to 12 V Operating Current 4mA 5V 15mA 9V Quiescent Current 10uA Temperature ASK 9 6K TTL 20 mW 5V RF Receiver 3 15MHz Figure 2 This low cost RF Receiver can be used to receive RF signal from any 315MHz transmitter Super regeneration design ensure sensitive to weak signal It has benefits of e Low power consumption 4mA e Easy to integrate Vcc GND and Data e Super regeneration design e Very small dimension Specification Operating Voltage 4 5V to5 5V Operating Current 4mA 5V Operating 10 C 60 C Temperature Sensitivity 105dBm Max Data Rate 4 8K Data Output TTL Created by Cytron Technologies Sdn Bhd All Rights Reserved 2 Cytron gt PIC16F876A Microcontroller This powerful 200 nanosecond instruction execution yet easy to program only 35 single word instructions CMOS FLASH based 8 bit microcontroller packs Microchip s powerful PIC architecture into an 28 pin package and is upwards compatible with the PIC16CS5X PICI2CXXX and PIC16C7X devices The PIC16F876A features 256 bytes of EEPROM data memory Self programming An ICD 2 Comparators 5 channels of 10 bit Analog to Digital A D converter 2 capture compare PWM functions e The synchronous serial port can be configured as either 3 wire Serial Peripheral Interface SPI or
11. rate to 1200bps for ZOMhz crystal ffenable serial port f 8 bit reception ffenable reception For Receiver From TXSTA Register lt __ SPBRG Register Saal From RCSTA Register Figure 12 fdefine display FORTE lt q Define Port B as display segment display Jb00001101 0b10110111 0b10011111 Jb11001101 0b11011011 0b11111011 0b00001111 0b11111111 0b11011111 0b11101111 0b11111001 0601110011 0b10111101 0b11110011 0b11100011 unsigned char 7 seg 16 PORTB 0b01111111 display _7seg num 7 segment display 0 Figure 13 Refer to the schematic diagram pin RB1 to RB7 from PIC are connected to 7 segment and RBO is don t care bit Figure 13 shows the program which displays 0 to F depend on value of num When the value of num changed from 0 to 15 the displayed number will changed from 0 to F respectively The pattern of displayed numbers and alphabets should be determined first by referring the pin diagram of 7 segment below Figure 14 re functions void wart sendiunsigned char data while TXHIF 0 THREG dat a fonly send the new data after the previous data finish sent Figure 15 unsigned char rec_ data while RCIF 0 rec data RCREG ff wait for data ffreturn the received data return rec data Figure 16 Figure 15 shows the Function for Data Transmitting while Figure 16 shows the Function for Data Receiving During the transmit
12. rovide hex file for user Do not forget to switch ON the power The programmer is not included in the hardware set but it can be found at Cytron website User manual is provided at website 8 User can modify this program After modification build the project once again and load the hex file into the PIC microcontroller using Cytron USB In Circuit Programmer UICOOA 7 User can select the desired number by the Increase button and Decrease button For sending the data press Send button then the Created by Cytron Technologies Sdn Bhd All Rights Reserved 7 C yer on ROBOT HEAD to TOE Technologie PR16 Sending Data using RF Module receiver circuit board will display the sent number TEST METHOD 1 Switch ON the power for both RF_TX and RF_RX e Power Led of RF_TX red will turn ON e Power Led of RF_RX green will turn ON e 7 segment for both RF_TX and RF_RX will display 0 2 Press Increase button in RF_TX e Value in 7 segment will change it will display the increase number 3 Press Decrease button in RF_TX e Value in 7 segment will change it will display the decrease number 4 Press Send button in RF_TX e RF TX will send the display number to RF_RX e 7 segment display of RF_RX will display the same number in 7 segment display of RF_TX 5 Press Reset Button e 7 segment display for both RF_TX and RF_RX will display 0 6 If all steps mention above can be executed your projec
13. t is done successfully Congratulations WARRANTY No warranty will be provided as this is DIY project Please check the polarity of each electronic component before soldering it to board Created by Cytron Technologies Sdn Bhd All Rights Reserved 8 Cytron 5 ROBOT Technologie PR16 Sending Data using RF Module Appendix A PCB Layout EF E z O an lt S j R4 A 5 m A O a a ka t P ba Ar Created by Cytron Technologies Sdn Bhd All Rights Reserved C yer on gt ROBOT HEAD to TOE Technologie PR16 Sending Data using RF Module RECEIVER RX 2510 02 gt S gt Connector PR16 20 RF RX 10uF 16V 7 Segment 1 L 1N4148 Diode 7 Box gt 2 Header ceiver TIA AAA Brace om ap Crystal 20MHz H he Hiti A 7 cone A Created by Cytron Technologies Sdn Bhd All Rights Reserved 10 C yer on ROBOT HEAD to TOE Technologie PR16 Sending Data using RF Module Prepared by Cytron Technologies Sdn Bhd 19 Jalan Kebudayaan IA Taman Universiti 81300 Skudai Johor Malaysia Tel 607 521 3178 Fax 607 521 1861 URL www cytron com my Email support cytron com my sales cytron com my Created by Cytron Technologies Sdn Bhd All Rights Reserved 1
14. the 2 wire Inter Integrated Circuit PC bus e A Universal Asynchronous Receiver Transmitter UART 28 Pin PDIP SOIC SSOP RB PGD REG PGC RBS RB4 RBS PGM RB MCLRiVer L RAZIANZVREF ICVREF _ RAWANSVREr RAAITOCKIICIOUT LI RAS ANAISSICZ0UT LI G ooo oo on e a Ro OSC1 CLKI LI OSc2 CLKO _ 10 RcOTIOSaTICK 011 RCITIOSICCP 12 Rc2zccP1 143 RCIVSCKISCL J14 PIC16F873A 876A 187 RCTIRXIDT 170 RCSITHICK 16 RCSSDO 15 RC4 SDISDA Figure 3 Figure 3 shows the pin diagram for PIC16F876A For more detail please download the datasheet from microchip web site at http www microchip com HARDWARE This project will require following hardware a 1x RF Module Set Transmitter and Receiver b 2 x PRI6 Printed Circuit Board RF_RX amp RF_TX c 2x PICI6F876A d Other related electronic components Please refer to the schematic diagram of PR16 The schematic is provided free therefore Cytron Technologies will not be responsible for any further modification or improvement ROBOT HEAD to TOE PR16 Sending Data using RF Module Interface PIC16F876A with RF Transmitter As mention early this RF Transmitter has 3 pins Vcc GND and Data In this project Vcc pin is connected to 5V and GND pin is connected to GND of circuit board The data pin should be connected to pin 17 RC6 TX CK of P
15. ting process TXIF 0 cleared until previous data is totally transmitted For data receiving RCIF 1 when reception is complete then RCREG register will store the received data GETTING START User can obtain the hardware set for this project PR16 either by online purchasing www cytron com my or purchase it in Cytron Technologies Shop 1 Once user has the hardware set soldering process can be started now Please solder the electronic components one by one according the symbols or overlays on the Printed Circuit Board PCB Make sure the component value and polarity is correctly soldered Please refer to PCB Layout in Appendix A Notice Do not forget to solder a wire for each transmitter and receiver as an antenna Caution Make sure all the connectors 2510 are soldered in proper side Those electronic components have polarity such as capacitor diode PIC RF Transmitter RF Receiver and LED should be soldered in right polarity or it may cause the circuit board fail to work Warning Before the battery Power is plugged in make sure the polarity is correct to prevent the explosion Wrong polarity of capacitor also may cause explosion Created by Cytron Technologies Sdn Bhd All Rights Reserved 6 Cytron 5 Technologie Step for soldering 2510 connector Figure 17 2 After soldering process is finished please plug in the PIC16F876A to the 28 pins IC socket in proper side 3 Please download the nec

Download Pdf Manuals

image

Related Search

Related Contents

Guía del usuario  Wentronic 55003  AVT MP3 SOUND MODULES SERIES 100  Samsung GT-C3510T دليل المستخدم  OPERATING INSTRUCTIONS  TW-VoIP-S2 User manual  LP36LED_GM002_manual ml  取扱説明書等(1) - アイ・オー・データ機器  RGLT-100 instruction  IPSO FACTO ISSUE #6  

Copyright © All rights reserved.
Failed to retrieve file