Download presentation
Presentation is loading. Please wait.
1
Wireless Communication
Studienarbeit Vortrag Wireless Communication Von Spisa Yang Liu(215622)
2
Einleitung Digital Signal Controller(dspic30F3013)
I/O Ports UART SPI Radio Frequenz Funkmodule nRF905 Transceiver Steuerungsregister Transmit and Receive Komplete Module Interface Anwendungsbeispiel
3
dspic30F3013 I/O Ports TRISx: Data Direction Register
1:Input, 0:Output PORTx: I/O Port Register Read: Value of the I/O Pin Write: To Port Data Latch LATx: I/O Latch Register Read: Value in Port Data Latch ADPCFGx: ADC Port Configuration Register (Port B) 1: Digital I/O, 0: Analog I/O
4
Universal Asynchronous Receiver Transmitter(UART)
Full-Duplex 8- or 9 Bit Data Transmission Even, Odd or No Parity One or Two Stop Bits Fully Integrated Baud Rate Generator 16 Bit Prescaler Baud Rate 29bps to 1.875Mbps 4 Deep FIFO Transmit Data Buffer 4 Deep FIFO Receive Data Buffer Error Detection 9 Bit Mode with Address Detection Transmit Receive Interrupt
5
UART Register Control Register: UxMode
Enable, Alterative IO Pins, Parity Data Selection… Status and Control Register: UxSTA Transmit Enable, Address Detect Mode, Error Detection, Buffer Overflow, Transmit Buffer Full… Receive Register: UxRXREG Example: unsigned char c = U1RXREG; Transmit Register: UxTXREG Example: U1TXREG = ‘c’; Baud Rate Generator: UxBRG
6
UART Register Example: Quarze: 20MHz BaudRate: 57.6Kbps UxREG = 4.42=4
Real BaudRate: 62.5Kbps Error: 8.5%>3% Quarze: MHz UxREG = 5 Error: 0%
7
Serial Peripheral Interface(SPI)
Synchronous Serial Interface communicate with other Peripheral or Microcontroller Serial EEPROMs, Shift Register, Display Drivers, ADCs, nRF905 SPI Interface consist of 4 Pins SDIx: Serial Data Input SDOx: Serial Data Output SCKx: Shift Clock Input or Output SSx: Active low Slave Select or Frame Synchronization I/O Pulse
8
SPI Register SPI Status and Control Register: SPIxSTAT
SPI Enable, SPI Transmit Buffer Full Status, SPI Receive Buffer Full Status SPI Control Register: SPIxCON Framed SPI Support, 8-Bit or 16-Bit Select, Master or Slave Select Secondary and Primary Prescale Bits Bit Rate from Fcy to Fcy/512
9
SPI Master Mode Operation
10
Radio Frequenz Funkmodule
Single Chip Transceiver nRF905 433MHz, 868MHz, 915MHz ISM Band GFSK Transceiver Betriebspannung 1.9v-3.6v Bis 50Kbps Multikanäle Senderleistung –10dBm--10dBm Carrier Detection Adress Match von Packet 8-Bit, 16-Bit CRC Codierung Manchester Codierung 5x5mm 32Pin QFN Package
11
nRF905 Blockschaltbild
12
nRF905 Register
13
nRF905 Instruction
14
nRF905 Configuration Register
15
nRF905 Configuration Register
CH_NO, 9 Bits: Frequenz Einstellen Freq = (422.4+CH_NO/10)*(1+HFREQ_PLL)MHz Beispiel: Freq = 433MHz CH_NO=0x04c=0b HFREQ_PLL, 1 Bit: Frequenz Einstellen 0: 433MHz Band, 1: 868MHz oder 915Mhz Band PA_PWR, 2 Bits: Sendleistung Einstellen -10dBm, -2dBm, 6dBm, 10dBm RX_AWF, TX_AWF, 3 Bits: Adressenbereit 001: 1 Byte …… 100: 4 Byte
16
nRF905 Configuration Register
RX_PW, TX_PW, 6 Bits: Payload Bereit : 1 Byte……100000: 32 Byte RX_ADDRESS, 4 Byte: Receiver Adresse XOF, 3 Bits: Oszillator Frequenz 4MHz, 8MHz, 12MHz, 20MHz 011: 16MHz CRC_EN 1 Bit: CRC Codierung Enable 0: Disable, 1: Enable CRC_MODE 1 Bit: CRC Codierung Mode 0: 8 Bit Mode, 1: 16 Bit Mode
17
nRF905 Register and Control
TX_ADDRESS, 4 Byte: Send Address TX_PAYLOAD, 32 Byte: Send Data RX_PAYLOAD, 32 Byte: Receive Data STATUS_REGISTER, 1 Byte: AM, DR
18
nRF905 Receive Standby Mode PWR_UP = HI TX_EN = LO TRX_CE = HI
Carrier Detect Set CD High Correct Address? yes Correct CRC? no no yes Set AM LO Read Data in RX_PAYLOAD Via SPI Set DR and AM LO Set DR HI
19
nRF905 Transmit Standby Mode PWR_UP = HI TX_EN = HI TRX_CE = LO
SPI Programming Load TX_ADDRESS and TX_PAYLOAD TRX_EN = HI? Transmitter is Powered up yes no yes TRX_EN = HI? Generate Preamble and CRC, Send Package Set DR Hi when Finish Maximal 1ms no Preamble 10 Bits Address To 4 Bytes Data To 32 Bytes CRC 0, 1 or 2 Byte
20
Wireless Communication Interface
unsigned char NRFConfig[10]; // Configuration Bytes unsigned char RX_ADDRESS[4]; // Speicherplatz RX Address unsigned char TX_ADDRESS[4]; // Speicherplatz TX Address unsigned char SpiRxBuf[32]; // Speicherplatz Receive Data unsigned char SpiTxBuf[32]; // Speicherplatz Send Data void SetNRFRegister(unsigned char CBit, unsigned char Register[], unsigned char Counter); // nRF905 Konfigurieren void SetTxMode(void); // Set TX Mode void SetRxMode(void); // Set RX Mode void TXPackage(void); // Send Data Package void RXPackage(void); // Receive Data Package
21
Komplete Schaltung 433MHz
22
Funkmodule PCB 433MHz
23
Anwendungsbeispiel Aufgabe: Ein String(bis 512 Byte) von einem PC nach ander PC Schicken. PC1 Max232 dspic Funk Module PC2 Max232 dspic Funk Module
24
Schaltplan
25
Protokoll Kommunikation zwischen PC und dspic durch UART
byte0 byte8 byte9 byte521 CMD TA1 TA2 TA3 TA4 DT MP1 MP2 LL Data …… Data CMD: Command Byte, 0x00 für String Schicken TA1-TA4: TX Address DT: Datatyp (Char, Int, Float, Double...) MP1,MP2: Maxmale Package Number int MaxPackNr = (MP1<<8)+MP2; LL: Last Package Length int Datalength = (MaxPackNr-1)*29 + LL
26
Protokoll Wireless Kommunikation Protokoll Sender: First Package
byte0 byte8 ROC TA1 TA2 TA3 TA4 DT MP1 MP2 LL …… ROC: 0x01, Request of Connection TA1…TA4: TX Address DT: Datatyp(Char, Int, Float, Double) MP1,MP2: Maxmale Package Number int MaxPackNr = (MP1<<8)+MP2; LL: Last Package Length int Datalength = (MaxPackNr-1)*29 + LL
27
Protokoll Sender: Empfanger:
byte0 byte3 byte31 byte0 DAT PN1 PN2 Data …… Data CMD …… CMD: Command Byte 0x03: Accept of Connection 0x04: Accept of Data 0x05: Error Package Number DAT: 0x02, Data PN1,PN2: Package Number int PackNr = (PN1<<8)+PN2; Data: Byte3…Byte31
28
Protokoll A B A B A B Pack.1 Pack.1 Header ROC DAT1 DAT1 Timeout
AOC Pack.1 Pack.1 Pack. 1 DAT1 DAT1 DAT1 Pack.1 Pack.1 AOD AOD EPN Pack. 2 DAT2 Pack.2
30
Literatur [1] dsPIC30F Family Reference Manual www.microchip.com
[2] dsPIC30F3013 Data Sheet [3] MPLAB C30C COMPILER USER'S GUIDE [4] NORDIC SEMICONDUCTOR, Single Chip 433/868/915MHz Transceiver nRF905 [5] William Stallings, Data & Computer Communications Sixth Edition, Publishing House of Electronics Industry Beijing, 2001 [6] Karl-Dirk Kammeyer, Nachrichtenübertragung 3. Auflage, Teubner Verlag, 2004 [7] Gordon L. Stueber, Principles of Mobile Communication Second Edition, Kluwer Academic Publishers, 2001
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.