Presentation is loading. Please wait.

Presentation is loading. Please wait.

Studienarbeit Vortrag Wireless Communication Von Spisa Yang Liu(215622) 30.11.2005.

Similar presentations

Presentation on theme: "Studienarbeit Vortrag Wireless Communication Von Spisa Yang Liu(215622) 30.11.2005."— Presentation transcript:

1 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 Write: To 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 BaudRate: 57.6Kbps 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 nRF MHz, 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 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 …… : 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? no Correct CRC? yes Set AM LO no Set DR HI yes Read Data in RX_PAYLOAD Via SPI Set DR and AM LO

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? no Transmitter is Powered up Generate Preamble and CRC, Send Package Set DR Hi when Finish Maximal 1ms TRX_EN = HI? no yes 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. PC1Max232dspic Funk Module PC2Max232dspic Funk Module

24 Schaltplan

25 Protokoll Kommunikation zwischen PC und dspic durch UART CMDTA1TA2TA3TA4DTMP1MP2LLData …… Data byte0 byte8byte9byte521 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 ROCTA1TA2TA3TA4DTMP1MP2LL …… byte8 Sender: First Package byte0 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 DATPN1PN2Data …… Data byte0 byte3byte31 Sender: CMD Empfanger: byte0 …… DAT: 0x02, Data PN1,PN2: Package Number int PackNr = (PN1<<8)+PN2; Data: Byte3 … Byte31 CMD: Command Byte 0x03: Accept of Connection 0x04: Accept of Data 0x05: Error Package Number

28 Protokoll ROC AOC DAT1 AOD A B Header Pack. 1 DAT2 Pack. 2 A B DAT1 Pack.1 DAT1 AOD Pack.1 Timeout A B DAT1 Pack.1 DAT1 EPN Pack.1 Timeout Pack.1 Pack.2


30 Literatur [1] dsPIC30F Family Reference Manual [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

Download ppt "Studienarbeit Vortrag Wireless Communication Von Spisa Yang Liu(215622) 30.11.2005."

Similar presentations

Ads by Google