SA818 Programming Manual

Similar documents
Source Codes for DRA818U/DRA818V

CIS-331 Fall 2013 Exam 1 Name: Total of 120 Points Version 1

CIS-331 Exam 2 Fall 2015 Total of 105 Points Version 1

CIS-331 Exam 2 Spring 2016 Total of 110 Points Version 1

C1098 JPEG Module User Manual

4. Specifications and Additional Information

CIS-331 Exam 2 Fall 2014 Total of 105 Points. Version 1

Gateway Ascii Command Protocol

CIS-331 Fall 2014 Exam 1 Name: Total of 109 Points Version 1

CIS-331 Spring 2016 Exam 1 Name: Total of 109 Points Version 1

CIS-331 Final Exam Spring 2015 Total of 115 Points. Version 1

RS 232 PINOUTS. 1. We use RJ12 for all of our RS232 interfaces (Link-2-Modbus & Link-2-PC- Serial/RS232). The diagram below shows our pin out.

Chapter 10 Sections 1,2,9,10 Dr. Iyad Jafar

ECHO Process Instrumentation, Inc. Modbus RS485 Module. Operating Instructions. Version 1.0 June 2010

EET203 MICROCONTROLLER SYSTEMS DESIGN Serial Port Interfacing

Technical Specification. Third Party Control Protocol. AV Revolution

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

CIS-331 Final Exam Spring 2018 Total of 120 Points. Version 1

UNH-IOL MIPI Alliance Test Program

; Once Initialized, monitor character in calls to CN05 ; set carry for input, to be tested CN35 C SEC

The cache is 4-way set associative, with 4-byte blocks, and 16 total lines

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

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

isource+ RS-232 Capabilities AppNote

CIS-331 Final Exam Spring 2016 Total of 120 Points. Version 1

B: Modbus Map and Retrieving Logs

Here is a C function that will print a selected block of bytes from such a memory block, using an array-based view of the necessary logic:

USB-ASC232. ASCII RS-232 Controlled USB Keyboard and Mouse Cable. User Manual

July Registration of a Cyrillic Character Set. Status of this Memo

NAM M6800 DISK-BUG DS VER 3.5 OPT PAG

Serial Communication with PIC16F877A

KNX TinySerial 810. Communication Protocol. WEINZIERL ENGINEERING GmbH

APPLESHARE PC UPDATE INTERNATIONAL SUPPORT IN APPLESHARE PC

CS 537: Introduction to Operating Systems Fall 2015: Midterm Exam #1

Example of Asyncronous Serial Comms on a PIC16F877

DBK24. Isolated Digital Output Chassis. Overview

6. Specifications & Additional Information

Here is a C function that will print a selected block of bytes from such a memory block, using an array-based view of the necessary logic:

ELCT 912: Advanced Embedded Systems

6.1 Font Types. Font Types

ELE492 Embedded System Design

TEST DVD-VIDEO/ DVD-ROM For Checking DVD Players, DVD Recorders and DVD Drives TDH-940

Hash Constant C Determinants leading to collisionfree

Parallel IO. Serial IO. Parallel vs. Serial IO. simplex vs half-duplex vs full-duplex. Wires: Full Duplex. Wires: Simplex, Half-duplex.

TLS 1.2 Protocol Execution Transcript

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

LynX-10 Legacy Protocol Specification Version 1.01

Acquirer JCB EMV Test Card Set

Triple DES and AES 192/256 Implementation Notes

ZN-DN312XE-M Quick User Guide

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

KRAMER ELECTRONICS LTD. USER MANUAL MODEL: VA-8xl 8-Channel Balanced Stereo Audio Amplifier. P/N: Rev 1

2-Type Series Pressurized Closures


CIS-331 Final Exam Fall 2015 Total of 120 Points. Version 1

Modbus Module. Data sheet. Communication module for MULTICAL 403 and MULTICAL 603

First Data Dual Interface EMV Test Card Set. Version 1.20

Serial Communication

Modbus Module. Data sheet. Communication module for MULTICAL 403 and MULTICAL 603

Embedded Systems Programming and Architectures

CMOS TYPE CAMERA JC406M-W01

First Data EMV Test Card Set. Version 1.30

First Data DCC Test Card Set. Version 1.30

mon-v30.asm Stmt Loc Object code Source Statement AS22 Assembler - V1.2 dd/mm/yy page 1

First Data EMV Test Card Set. Version 2.00

Digital Lighting Systems, Inc.

Libero. Integrated Design Environment (IDE) Frequently Asked Questions

CDR File Information. Comments Direct PCM

Secret Key Systems (block encoding) Encrypting a small block of text (say 64 bits) General considerations for cipher design:

460 Presentation Audio Mixer

PROFIBUS-DP SLAVE COMMUNICATIONS INTERFACE For 584S/590/620 Product Manual

Acquirer JCB Dual Interface EMV Test Card Set

Digital Lighting Systems, Inc. CD400-DMX DMX512 Four Channel Dimmer and Switch module

Generic RS232 protocol

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Communications guide. Line Distance Protection System * F1* GE Digital Energy. Title page

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller

ECE 354 Introduction to Lab 1. February 5 th, 2003

CS 380 Lab 4 Keyboard Input Assigned 2/11/10 30 Points

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013

Embedded Systems and Software. Serial Communication

Embedded Systems and Software

No Trade Secrets. Microsoft does not claim any trade secret rights in this documentation.

MIDI-Scope. Artistic Licence Engineering Ltd. Software Version V1.3 Manual Revision V1.91

Parallax Serial LCD 2 rows x 16 characters Non-backlit (#27976) 2 rows x 16 characters Backlit (#27977) 4 rows x 20 characters Backlit (#27979)

Modbus Register Map: InRow ACRD60x / ACRC60x

ASCII Code - The extended ASCII table

Custom Identity Confirmation Process

FOCUS on Intrusion Detection: Intrusion Detection Level Analysis of Nmap and Queso Page 1 of 6

[MS-FSSHTTPD]: Binary Data Format for File Synchronization via SOAP. Intellectual Property Rights Notice for Open Specifications Documentation

VM7000A PAPERLESS RECORDER COMMUNICATION FUNCTION OPERATION MANUAL

Systems/DBG Debugger Version 2.20

Experiment 7:The USART

DNP3 Communication User's manual

Matrix Switching System User Manual. Matrix Routing Switch. HDMI 4x4 HX-44 V.2012HX44.00


One subset of FEAL, called FEAL-NX, is N round FEAL using a 128-bit key without key parity.

COPYRIGHT 2013 WAVELENGTH OPTO- ELECTRONIC (S)PTE., LTD PUBLISHED 05/02/2013. Motorized Zoom Beam Expander User Manual

Tutorial & Demo! image and audio transmission on wireless sensor networks!

Tel: Fax:

Transcription:

SA818 Programming Manual Standard Uart interface is used to configure the parameter of SA818 Walkie Talkie. The format of UART is 9600, 8, N, 1, which means: Baud = 9600, data bit = 8bit, Parity = None, Stop bit = 1 bit. The interface is TTL or CMOS @3.3V. The parameters which can be configured are: Bandwidth, Tx-frequency, Rx-frequency, SQ, Tx_SubAudio(Tx_CTCSS/ Tx-CDCSS), Rx_SubAudio (Rx_CTCSS/Rx-CDCSS), Volume, Scan frequency, Audio filter, etc. When commands received, the module will verify and reply acknowledge message; User should wait enough time to send the next command until received the acknowledge signal. 1. Instruction Command Format: All instructions command ended with <CR><LF>, and ASCII is used. 2. Commands List: There are 5 commands in total to be used, below is the list: 1

Command 1: Handshake instruction command Command 2: Group parameters configuration Command 3: Scan frequency configuration Command 4: Volume configuration Command 5: Audio filter command 3. Instruction Command Description: 3.1)Handshake instruction command Format:AT+DMOCONNECT <CR><LF> Reply:+DMOCONNECT:0<CR><LF> 3.2) Group parameters configuration Format:AT+DMOSETGROUP=BW,TX_F,RX_F,Tx_subaudio,SQ,Rx_subaudio Sample 1:AT+DMOSETGROUP=0,415.1250,415.1250,0012,4, 0013 Sample 2:AT+DMOSETGROUP=0,415.1250,415.1250,754N,4, 445I Parameter Description: 2

BW:0: 12.5K 1: 25K TX_F:Tx Frequency value, SU818-U: 400~480MHz, SU818-V :134~174MHz, RX_F:Rx Frequency value,su818-u: 400~480MHz, SU818-V :134~174MHz, Tx_subaudio: Tx_CTCSS or TX_CDCSS Rx_subaudio: Rx_CTCSS or RX_CDCSS. If 0000 is set, that means subaudio function is disable. No CTCSS and no CDCSS. The range of Tx_CTCSS and Rx_ctcss is 1 38. Please find below table for Tx_CDCSS and Rx_CDCSS. The table is only list the code ended with I, the code ended with N is not shown. Actually the code ended with N can be used without any problems. The code ended with N is the complement of the code ended with I. For example: 023I = 11001000000111000110111 3

023N=~023I=00110111111000111001000 SQ: 0 ~ 8 0: listen mode 1 8: Different SQ Level. 3.3) Scan frequency configuration Purpose:Check if the matched signal exist in the specified frequency channel. This command is used for Scanning function. User send different frequency value by this command and wait for the reply of the module, then can find if matched signal exist and decide whether need to turn to next channel. Format:S+Rx_F Reply Format:S=X 0 > Signal matched on the frequency channel, 1 > no signal found example: S+455.2250 S=0 3.4)Volume Configuration 4

Format:AT+DMOSETVOLUME=X Reply: +DMOSETVOLUME: 0 X is the volume level, the range is 1---8. Example:AT+DMOSETVOLUME=1 3.5) Audio Filet Command Format: AT+SETFILTER=PRE/DE-EMPH, HIGHPASS, LOWPASS Reply: +DMOSETFILTER: X X : 0: command succeed, 1: command failed PRE/DE-EMPH: 1: emphasis bypass 0: emphasis normal 5

HIGHPASS: 1: voice_highpass_filter_bypass 0: voice_highpass_filter normal LOWPASS: 1: voice_lowpass_filter_bypass 0: voice_lowpass_filter normal For example: AT+SETFILTER=0, 0, 0 +DMOSETFILTER: 0 3.6) Close Tail Tone Command Format: AT+SETTAIL=TAIL 6

Reply: +DMOSETTAIL: X X : 0: command succeed, 1: command failed TAIL: 1: open tail tone 0: close tail tone For example: AT+SETTAIL=0 +DMOSETTAIL: 0 3.7) Read RSSI Format: RSSI? 7

Reply: RSSI=X X : Value of RSSI, from 0 to 255, unit 1dB For example: In ASCII: RSSI? RSSI=128 In HEX: 0x52 0x53 0x53 0x49 0x3f 0x0d 0x0a 0x52 0x53 0x53 0x49 0x3D 0x31 0x32 0x38 0x0d 0x0a 3.8) Read Version of module 8

Format: AT+VERSION Reply: +VERSION:SA818_VX X :Version of module For example: AT+VERSION +VERSION:SA818_V4.0 Schedule 1: CDCSS coding Code Transform Bit Pattern Hex Bit Pattern 023I 11001000000111000110111 640E37 025I 10101000000111101101011 540F6B 9

026I 01101000000110111010011 340DD3 031I 10011000000111111000101 4C0FC5 032I 01011000000110101111101 2C0D7D 043I 11000100000101101101101 620B6D 047I 11100100000110111111000 720DF8 051I 10010100000101010011111 4A0A9F 054I 00110100000100101111011 1A097B 065I 10101100000110001011101 560C5D 071I 10011100000110011110011 4E0CF3 072I 01011100000111001001011 2E0E4B 073I 11011100000101100111010 6E0B3A 074I 00111100000111100010111 1E0F17 10

114I 00110010000101111010110 190BD6 115I 10110010000111010100111 590EA7 116I 01110010000110000011111 390C1F 125I 10101010000111011110000 550EF0 131I 10011010000111001011110 4D0E5E 132I 01011010000110011100110 2D0CE6 134I 00111010000110110111010 1D0DBA 143I 11000110000101011110110 630AF6 152I 01010110000100110111100 2B09BC 155I 10110110000110110010001 5B0D91 156I 01110110000111100101001 3B0F29 162I 01001110000100111101011 2709EB 11

165I 10101110000110111000110 570DC6 172I 01011110000111111010000 2F0FD0 174I 00111110000111010001100 1F0E8C 205I 10100001000110010111011 508CBB 223I 11001001000101110001011 648B8B 226I 01101001000100001101111 34886F 243I 11000101000111011010001 628ED1 244I 00100101000101011111100 128AFC 245I 10100101000111110001101 528F8D 251I 10010101000111100100011 4A8F23 261I 10001101000111101110100 468F74 263I 11001101000100010111101 6688BD 12

265I 10101101000100111100001 5689E1 271I 10011101000100101001111 4E894F 306I 01100011000111110011000 318F98 311I 10010011000110110001110 498D8E 315I 10110011000101100011011 598B1B 331I 10011011000101111100010 4D8BE2 343I 11000111000111101001010 638F4A 346I 01100111000110010101110 338CAE 351I 10010111000111010111000 4B8EB8 364I 00101111000110100001011 178D0B 365I 10101111000100001111010 57887A 371I 10011111000100011010100 4F88D4 13

411I 10010000100101101110111 484B77 412I 01010000100100111001111 2849CF 413I 11010000100110010111110 684CBE 423I 11001000100110011101001 644CE9 431I 10011000100110100011011 4C4D1B 432I 01011000100111110100011 2C4FA3 445I 10100100100100011101111 5248EF 464I 00101100100101111110010 164BF2 465I 10101100100111010000011 564E83 466I 01101100100110000111011 364C3B 503I 11000010100101100011110 614B1E 506I 01100010100100011111010 3148FA 14

516I 01110010100111011000001 394EC1 532I 01011010100111000111000 2D4E38 546I 01100110100101111001100 334BCC 565I 10101110100111100011000 574F18 606I 01100001100110011011101 30CCDD 612I 01010001100110001110011 28CC73 624I 00101001100110101111000 14CD78 627I 11101001100111111000000 74CFC0 631I 10011001100100010100111 4CC8A7 632I 01011001100101000011111 2CCA1F 654I 00110101100111000011001 1ACE19 662I 01001101100111100010010 26CF12 15

664I 00101101100111001001110 16CE4E 703I 11000011100111010100010 61CEA2 712I 01010011100110111101000 29CDE8 723I 11001011100100011001110 65C8CE 731I 10011011100100100111100 4DC93C 732I 01011011100101110000100 2DCB84 734I 00111011100101011011000 1DCAD8 743I 11000111100110110010100 63CD94 754I 00110111100111110000010 1BCF82 Appendix: Part of the communication refers to C program.(mcu: PIC1939) 16

//======================== RAM DEFINE Const unsigned char CMD_HAND[15]=0x41,0x54,0x2B,0x44,0x4D,0x4F,0x43,0x4F,0x4E,0x4E,0x45,0x43,0x54,0x0d,0x0a; unsigned char CMD_SET[15]=0x41,0x54,0x2b,0x44,0x4d,0x4f,0x53,0x45,0x54,0x47,0x52,0x4f,0x55,0x50,0x3d; unsigned char CMD_VOLUME[16]=0x41,0x54,0x2B,0x44,0x4D,0x4F,0x53,0x45,0x54,0x56,0x4f,0x4c,0x55,0x4d,0x45,0x3d; unsigned char tx_buf[50]=0; unsigned char rx_buf[30]=0; unsigned char tx_len; unsigned char rx_len; unsigned char len_txnow; unsigned char len_rxnow; unsigned char status_cnt = 2; //======================================================= 17

void uart_init() // MCU UART Initialization (set to standard format) SPBRGH = 0; SPBRG = 23; TXSTA = 0; RCSTA = 0x90; BAUDCON = 0; TXIE = 0; RCIE = 0; //------------------------------------------------ void check_uart() // send handshake instruction to module regularly to detect the module's connection status unsigned char i; if(flag.in_rx == 1) 18

rx_cnt --; if(rx_cnt == 0) Flag.in_rx = 0; Flag.in_tx = 0; Flag.cn_fail = 1; LED_CTCS = LED_OFF; Flag.poweron = 1; fresh_display(); return; if((flag.in_tx == 1) (Flag.in_rx == 1)) instruction. return; send_hand(); // No interleave sending instruction, to ensure the module properly receiving 19

//------------------------------------------------ void uart_trans_check(void) // judge the transmitting instructions is complete or not if((flag.in_tx == 1)&&(len_txnow > tx_len)&&(txif == 1)) stop_tx(); // Send over, close the sending UART function. Flag.in_tx = 0; Flag.in_rx = 1; rx_cnt = 2; len_txnow = 0; len_rxnow = 0; tx_len = 0; clr_tx_buf(); // Initializes the related registers and flags start_rx(); // receiving function is available 20

//------------------------------------------------ void uart_recv_ack(void) if(flag.in_rx == 0) return; if(len_rxnow == rx_len) Flag.in_rx = 0; if((rx_buf[rx_len-3] == 0x30)&&(rx_buf[rx_len-2] == 0x0d)&&(rx_buf[rx_len-1] == 0x0a)) // judge return instruction status_cnt = 2; Flag.cn_fail = 0; LED_CTCS = LED_ON; fresh_display(); 21

stop_rx(); if((rx_len == 15)&&(Flag.poweron)) Flag.reset = 1; Flag.poweron = 0; return; else if(flag.cn_fail == 1) return; else status_cnt -= 1; if(status_cnt == 0) // If the Continuous instruction returns null, the module connection failed flag bit Flag.cn_fail = 1; LED_CTCS = LED_OFF; 22

Flag.poweron = 1; //------------------------------------------------ void send_hand() unsigned char i; for(i=0;i<=14;i++) tx_buf[i] = CMD_HAND[i]; // Load the handshake instruction rx_len = 15; tx_len = 15; // Write handshake instruction to send and receive data bytes len_txnow = 0; Flag.in_tx = 1; 23

clr_rx_buf(); // Clear the receive buffer start_tx(); // send UART function is available //------------------------------------------------ void send_set() unsigned char i; for(i=0;i<=14;i++) tx_buf[i] = CMD_SET[i]; tx_buf[15] = ASCII(Flag.gbw); tx_buf[16] = ASCII_comma; ASCII_TFV(); tx_buf[25] = ASCII_comma; ASCII_RFV(); tx_buf[34] = ASCII_comma; 24

tx_buf[35] = ASCII(Tx_ctcs_3); tx_buf[36] = ASCII(Tx_ctcs_2); tx_buf[37] = ASCII(Tx_ctcs_1); tx_buf[38] = ASCII(Tx_ctcs_0); tx_buf[37] = ASCII_comma; tx_buf[38] = ASCII(sq); tx_buf[39] = ASCII_comma; tx_buf[40] = ASCII(Rx_ctcs_3); tx_buf[41] = ASCII(Rx_ctcs_2); tx_buf[42] = ASCII(Rx_ctcs_1); tx_buf[43] = ASCII(Rx_ctcs_0); // Instruction of sending data are ASCII tx_buf[44] = 0x0d; tx_buf[45] = 0x0a; // Send instructions all ends with a carriage return line feed(0x0d,0x0a) rx_len = 16; tx_len = 46; // Write handshake instruction to send and receive data bytes 25

len_txnow = 0; Flag.in_tx = 1; clr_rx_buf(); start_tx(); //------------------------------------------------ void send_vol() unsigned char i; for(i=0;i<=15;i++) tx_buf[i] = CMD_VOLUME[i]; // load volume instruction tx_buf[16] = ASCII(vol); tx_buf[17] = 0x0d; tx_buf[18] = 0x0a; rx_len = 17; tx_len = 19; 26

// write number of bytes to set the volume orders to send and receive data len_txnow = 0; Flag.in_tx = 1; clr_rx_buf(); start_tx(); //------------------------------------------------ void clr_tx_buf() // Clear the send buffer unsigned char i; for(i=0;i<=39;i++) tx_buf[i]=0; //------------------------------------------------ void clr_rx_buf() // Clear the receive buffer 27

unsigned char i; for(i=0;i<=18;i++) rx_buf[i] = 0; //------------------------------------------------ void start_tx() // to make it can send UART TXEN = 1; TXIE = 1; //------------------------------------------------ void stop_tx() // close UARTsending TXEN = 0; 28

TXIE = 0; //------------------------------------------------ void start_rx() // to make it can receive UART CREN = 1; RCIE = 1; //------------------------------------------------ void stop_rx() // close UART receiving CREN = 0; RCIE = 0; //------------------------------------------------ void interrupt ISR_timer(void) 29

// interrupt handling unsigned char int_temp; if(txif) if(flag.in_tx == 0) stop_tx(); // Not in delivery status, interrupted by mistake else if(len_txnow <= tx_len) TXREG = tx_buf[len_txnow]; // update sending data len_txnow ++; else TXIE = 0; // send over 30

if(rcif) NOP(); if(flag.in_rx) rx_buf[len_rxnow] = RCREG; // write the returned dato to receive buffer if((len_rxnow++) == (rx_len+1)) stop_rx(); else // Not in receiving state, interrupted by mistake, invalid return values stop_rx(); int_temp = RCREG; 31

32