Similar documents

How to use RFpro in Packet Mode

Using the USART Serial Communications

UART: Universal Asynchronous Receiver & Transmitter

Using printf with an AVR

International Journal of Emerging Technology and Advanced Engineering Website: (ISSN , Volume 2, Issue 5, May 2012)

Serial Communications

WEATHER STATION WITH SERIAL COMMUNICATION

USART Register Description

Robosoft Systems in association with JNCE presents. Swarm Robotics

19.1. Unit 19. Serial Communications

CSCE 236 Embedded Systems, Fall 2017 Homework 5

Innovati s Bluetooth 100M Universal Wireless Bluetooth Module

[WIR-1286]868MHz LORA Wireless Module. Page 1. LORA 868MHz Wireless serial link [WIR-1286]

EE318 Electronic Design Lab, Project Report, EE Dept, IIT Bombay, April GPS Tracker. Group No: B11

STUDENT NAME(s):. STUDENT NUMBER(s): B00.

COMP2121: Microprocessors and Interfacing

Unit 19 - Serial Communications 19.1

ATmega128 USART. Overview

WiMOD LR Base Plus Host Controller Interface

WIR-1386 / WIR-1186M Long Range 865MHz 867MHz RF Wireless Module with WIR-METERING Mesh Stack

Xbee module configuration from a µcontroller

Sierra Radio Systems. Mesh Data Network. Reference Manual. Version 1.0

WiMOD LR Base Host Controller Interface

Design with Microprocessors

Basics of UART Communication

School of Electrical, Computer and Telecommunications Engineering University of Wollongong Australia

ATmega128. Serial Communication (RS-232C)

Embedded Systems and Software. Serial Communication

BV4109. Serial LCD Controller. Product specification November ByVac 2006 ByVac Page 1 of 12

Firmware Reprogramming Guide

Interrupts & Interrupt Service Routines (ISRs)

DRF1605H Zigbee Module 1.6km Transfer CC2530 Wireless Module UART to Zigbee

WiMOD LR Base Host Controller Interface

Embedded Systems and Software

Data sheet Wireless UART firmware version 4

Doug Fleenor Design, Inc. RS-232 to DMX512 Interface, 2 Generation. March 8, 2010 (Software V1.2)

DEMO XTR-8LR100 DEMO XTR-8LR10 User Manual

User s Manual Closer to Real, Zigbee Module ZIG-100. Wireless Communication. ROBOTIS CO.,LTD

Wireless Modem Exchange (WMX) Protocol Description

Reference Guide RG-00101

SST-2450 Wireless Modem User s Manual

Laboratory 5 Communication Interfaces

CN310 Microprocessor Systems Design

EET203 MICROCONTROLLER SYSTEMS DESIGN Serial Port Interfacing

TABLE OF CONTENTS 2/10

// sets the position of cursor in row and column

AVR EEPROM Memory Read/Write Cookbook BETA version /23/08

Embedded Modbus TCP Module GS11-MT. User Manual REV 1.1. SST Automation.

Bluetooth Embedded Module

RC1170-RC232 USER MANUAL

Manual 601: : USB/RS232. Specifications. Contents. Options

TRAINING GUIDE LEVEL 3 MODBUS WRITE IMPORT COMMAND

Hints and tips when using RC1xx0 RF Modules

+ (5~27 VDC) GND. Bluetooth V4.2 BLE RS-422/485 Serial Adapter. Model: BLE-485C. 1. Package content: BLE RS-422/485 adapter

ELCT706 MicroLab Session #4 UART Usage for Bluetooth connection PC - PIC

CSCE374 Robotics Fall 2013 Notes on the irobot Create

Active RFID Reader User Manual

LM058 Bluetooth Serial Adapter

FireBeetle Board 328P with BLE4.1 SKU: DFR0492

Serial Bluetooth Smart Adapter - RS232, Low Energy 4.1 BLE Datasheet and Quick Reference for BLE232V2

C Programming in Atmel Studio 7 Step by Step Tutorial

EDBG. Description. Programmers and Debuggers USER GUIDE

XStream AT Commands. Advanced Manual v South 520 West, Suite 180 Lindon, UT Phone: (801) Fax: (801)

Serial Bluetooth Smart Adapter - RS232, Low Energy 4.2 BLE Datasheet and Quick Reference for USBLE232DEXA

CEL MeshConnect ZICM35x Test Tool User Guide

CM5000 DATASHEET v0.1

RC232 Configuration and Communication Tool (CCT) User Manual

The I-7530A RS-232/485/422 to CAN Converter

Amarjeet Singh. January 30, 2012

NE-4100 Series Serial Command Mode User s Guide

Wireless-Tag WT51822-S4AT

AN703. Micro64/128. Accessing the 36k of SRAM 12/3/04

CAN / RS485. Product Description. Technical Reference Note. Interface Adapter. Special Features

Getting Started With the Micro64

+ (5~27 VDC) GND. Bluetooth V4.1 BLE RS-232 Serial Adapter. Model: BLE-232B. 1. Package content: BLE RS-232 adapter

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

ZFSM-201-KIT-1 Wireless UART Application User Guide

Serial Bluetooth Smart Adapter - RS232, Low Energy 4.2 BLE Datasheet and Quick Reference for USBLE232C

Introduction USART & AVR EVK1100

InfoTag KE28xx Communications for 186 CPU Firmware Version 4

ICRM SER User s Guide

C1098 JPEG Module User Manual

Zigbee Module User Guide

USER GUIDE EDBG. Description

Design with Microprocessors

4. Application Programming

An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal

CMUCAM V1.12 interface Specific for RS232 By: Alexis Mesa

RC11xx(HP)-TM/ RC25xx(HP)-TM

Bluetooth V4.1 BLE RS-232 Serial Adapter Model: BLE-232B Bluetooth V4.2 BLE RS-232 Serial Adapter Model: BLE-232C

1. General Description

LM058 Bluetooth v2.0, v2.1 RS232 Serial Adapter - SMA Connector Standalone (With Embedded Bluetooth v2.0 / v2.1 Stack)

1602 SMART LCD DISPLAY MODULE HCMODU0122

SLSM5 SYNTHESIZER INTERFACE DEFINITION PLL IC

INDEX. Document Name : User Manual for SC10EJ Serial to Ethernet Converter

+ (5~27 VDC) GND. Bluetooth V4.2 BLE RS-232 Serial Adapter. Model: BLE-232D-E. 1. Package content: BLE RS-232 adapter

Version. Table of Contents

Flex Series User Guide

ECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015

Transcription:

Overview RFSv4.3 is a RF module providing easy and flexible wireless data transmission between devices. It is based on AVR Atmega8 with serial output which can be interfaced directly to PC. Features 2.4 GHz Carrier Frequency RS232 UART interface with variable baud rate Input supply voltage: 5V to 12V 255 possible Channels frequencies (0 to 255) Programmable Device Address (255 per channel) Default mode is 0 and baudrate is 9600. Easy-to-Use AT command: Set working mode, Serial Baud Rate, etc. Compact Size, Out of Box: Plug and Play Supported Baud Rate 9600,19200, 38400. Two easily configurable modes: Data mode and Command node. Page 1

Pin Configuration Page 2

[RF Communication Release] 2012 Connecting the RF Module Step 1 Step 3 Page 3 Step 2 Step 4

Note [RF Communication Release] 2012 Configuring the RF Module Version The firmware version can be check by issuing ATFV command. Out of the box When powered on, RF module will send ok through serial port at 9600 baud. The default operation mode is Transceiver and the default sender and receiver address is 0. If you have two RF module, any data sent to RF_A from serial port the same data will be received by RF_B and displayed on the serial port. AT Commands The configuration of the RF module can be modified using AT commands. At startup the RF module is in data mode. To submit AT commands, the RF module must be switched to command mode by sending three plus signs ( +++ ) on serial port software. When the RF module receives the ( +++ ) on the serial port it will respond with: ok, starting command mode. The RFBee is now in command mode until switched back to data mode (using ATO0 see below) or power reset. AT Format: AT + Comand(ASCII) + parameters (optional, character)+<cr> Where <CR> is Carriage Return which has binary value 13 (0x0D in Hex). Page 4

[RF Communication Release] 2012 Example: +++ - Go to command mode, the RF module will return ok, starting cmd mode ATBD1<CR> - Set Uart Baudrate of the RF module to 19200, returns ok on success and otherwise error. ATBD<CR> - Get UART Baudrate of the RF module, returns 1 and ok on success and otherwise error. ATO0<CR> - Switch to data mode from command mode, the RFBee will return ok and any data send afterwards will be transmitted again. For ex: In flash magic go to Tools Terminal select com port option -set new lines to CR ( carriage return) Command Parameter AC 0-2 MA 0-255 DA 0-255 Adressing Page 5 Specification Address Check: determines whether the RF module checks the incoming packet address against its own address or not. If broadcast is enabled both its own address and the broadcast 0 address will be considered valid. 0:No address check 1:Address check, no broadcast 2:Address check and broadcast My Address: set the RF module s own Destination Address: set address of the receiver Default Typ e 0 r/w 0 r/w 0 r/w

Config: select wireless transmission data rate 0: 500kbaud RF CF 0-3 1: 250kbaud 2: 10kbaud 0 r/w BD 0-2 3: 2.4kbaud Baud Rate: Set Uart Baud rate of the RF. 0: 9600bps 1: 19200bps 2: 38400bps 0 r/w TH 0-32 Threshold: Set threshold in bytes that will trigger RF to start transmission. 1 r/w Serial 0: Payload only. OF 0-3 1: source, dest, payload 2: payload len, source, dest, payload, rssi, lqi 0 r/w 3: same as 2, but all except for payload as decimal and separated by comma's Page 6

MD 0-2 Mode: Set working mode of the RF. 0:transceive 1:transmit only 0 r/w Mode 2:receive only O 0 Online: return to data mode w CI 0-255 Miscellaneous RS - To select device channel ID. Restore: restore the configuration to default settings. 0 r/w - w Output format : Using ATOF it is possible to change the output format of data packets received. ATOF set to 0: Payload ATOF set to 1: Source address (1 byte) Destination address (1 byte) Payload Page 7

ATOF set to 2: Payload length (1 byte) Source Address (1 byte) Destination address (1byte) Payload RSSI (1 byte) LQI (1 byte) ATOF set to 3: As ATOF2, but now all byte values (except Payload) displayed as decimal and all fields separated by comma s. RSSI: Received Signal Strength Indicator. One byte signed data, unit dbm. LQI: Link quality indicator. One byte data, see CC2500 datasheet for details. Broadcasting : When every RF module has it s a unique address assigned (e.g. 1,2,3 and 4 if you have 4 RF module) there are two ways to let all RF modules receive the same packets: 1. Set ATAC to 0: this will disable address checking and all RF modules will receive all packets sent. Downside of this is that any private communication between e.g. 2 and 3 will always show up at 1 and 4. 2. Set ATAC to 2: this will enable address checking including broadcasts. This will enable private communication between RF modules (e.g. packets between 2 and 3 will not show up at 1 and 4). The RF module sending the broadcast must set the destination address to 0. Packets with destination address 0 will be received by all four RF modules. Page 8

Receive window of RF Module No. 1 Transmit window of RF Module No. 1 Fig 1(a )RF Module No. 1 Receive window of RF Module No. 2 Transmit window of RF Module No. 2 Test Case 1: PC to PC Wireless communication using CC2500 based RF modules. Configure the modules using AT commands: By default address check is disabled and data transmitted by one module will be received by all other modules. Once the 2 modules have been connected to 2 different PC s and are powered on with the terminal initialized on both of them, the connection may be tested. Any data transmitted from one PC will appear on the other PC, character by character. Check fig.1 (a) and 1(b) for input and output on two different PCs. Fig 1(b ) RF Module No. 2 Page 9

Test Case 2: BOT to BOT Wireless communication using CC2500 based RF modules The example shows the implementation of data transfer using the modules. The following code will allow LED1 of BOT1 to be synchronized with LED1 of BOT2. Initial Settings for Test Case 2: With default settings, address check is disabled. so, data transmitted by one RF will be received by all. For communication between 2 specific modules enable address check using AT commands : For ex: with ATAC =1 Configure the source and destination address using AT commands: ATMA = my address, ATDA = destination address, ATCI = channel ID. RF Module No. 1: RF Module No. 2: 1) ATMA 1, 2) ATDA 2 3) Channel id 0, 3) baud rate 9600(ATBD=0) 1) ATMA 2, 2) ATDA 1 3) Channel id 0, 3) baud rate 9600(ATBD=0) Below is the code required to be programmed in both the bots: The code part labeled as bot1 will be the master. For the master the bot2 code must be commented. The code part labeled as bot2 is for slave. For the slave the bot1 code must be commented. In the below code, the Bot2 section (slave bot) is shown as commented. Make sure to use proper commenting for each case, in order for the code to work correctly. Page 10

#include <avr/io.h> // header file defining I/o operation #define F_CPU 8000000 // CPU @ 8MHZ #define USART_BAUDRATE 9600 // SERIAL Communication @ 9600 baud #define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1) // baud rate formula #include <util/delay.h> // header file defining delay int main (void) // main code begins { DDRB = 0xff; // PORT B as output DDRD = 0xfc; // PORT D PIN 3-7 as output. PIN 2 is input for switch UCSRB = (1 << RXEN) (1 << TXEN); // Enable Rx & Tx of USART UCSRC = (1 << URSEL) (1 << UCSZ0) (1 << UCSZ1); // 8bit, 1 Stop bit, no parity UBRRL = BAUD_PRESCALE; // setting baud rate @ 9600 baud UBRRH = (BAUD_PRESCALE >> 8); unsigned char a=1; unsigned char b; // Character Variable for Rx packet. while(1) // loop forever Page 11

{ /* //BOT1 code //Tx Code if (a == '0') a='1'; else a='0'; UDR = a; // Add next byte to be transmitted to the UDR buffer while ((UCSRA & (1 << UDRE)) == 0); // Loop until UDR buffer is ready to receive // next byte to be transmitted. while ((UCSRA & (1 << RXC)) == 0); // Loop until UDR buffer is receiving RECEIVE data. b = UDR; // Read byte by byte from the Received Data Packet into the variable if (b == '1') //check for Actual data from received Packet to be = (ASCII - '1') { PORTB = 0x01; // led1 on led2 off if true if a[2] == 0x52 } else PORTB = 0x00; Page 12

_delay_ms(1000); */ /* //BOT2 code. //Rx Code while ((UCSRA & (1 << RXC)) == 0); // Loop until UDR buffer is receiving RECEIVE data. b = UDR; // Read byte by byte from the Received Data Packet into the variable if (b == '1') //check for Actual data from received Packet to be = 0x52 (ASCII - R) { PORTB = 0x01; // led1 on led2 off if true if a[2] == 0x52 } else PORTB = 0x00; if (a == '0') a='1'; else a='0'; UDR = a; // Add next byte to be transmitted to the UDR buffer Page 13

while((ucsra & (1 << UDRE)) == 0); // Loop until UDR buffer is ready to receive // next byte to be transmitted. _delay_ms(1000); */ } // While loop closed. return(0); // syntax never reached } Note 1:- Mount the RF modules, one each on the mounting space provided on the two bots. Switch on the two bots. Note 2:- To trace the communication simultaneously on Terminal, open terminal on separate Computers one for each bot. Create a connection with following settings: 1) Port Com1, 2) Baud rate 9600, 3) Flow Control None, 4) Data 8bit, 5) Parity None, 6) Stop Bit 1bit Make use of the 3 wire serial interface provided on the board besides the MCU to watch the signals. You should get a stream of toggling 0 s and 1 s in terminal. Page 14