Download presentation
Presentation is loading. Please wait.
Published byLenard George Modified over 8 years ago
1
COMMUNICATIONS SANS WIRES WIRELESS COMMUNICATIONS Team Leader: Jon Golden Software Specialist: Riley Fisher Hardware Specialist: Shane Coyle Support Specialist: Malik Credle 30 March 2016
2
AGENDA Wireless Purpose Plan of Attack Hardware Requirements Data Format Sample Code Implementation Results Tips for Success 2
3
WHY WIRELESS? Want to collect tuning data from various subsystems Car is in operation making LCD unreadable Don’t want a long umbilical Low power wireless is the solution! 3
4
HOW TO ACHIEVE WIRELESS COMMS MCU grabs data points MCU formats data for transmission Data is piped to wireless transmitter Wireless receiver gets data Receiver interprets data packet Data is displayed via PC virtual interface 4
5
PARTS XBEE Operating Voltage/Current/Frequency 2.8V - 3.4V Transmitting Current: 45mA @ 3.3V Receiving Current: 50mA @ 3.3V Frequency: ISM 2.4 GHz Transmission Format ASCII or Binary Baud Rate 1200bps – 250 kbps Range Indoor: up to 100’ Outdoor line-of-sight up to 300’ Base Station TXS0104e Level Translator TXS0104e (top view) 5
6
PINS 6
7
TXS0104e 7
8
PACKET FRAMING Serial Monitor: 9600 Baud 8 data bits No parity 1 stop bit No flow control 0x0A termination (‘\n’ Line Feed) 80 character buffer size Packet Format: $SCID,BID,VBattery,IRData,SteerPW,CurrentSpeed,MotorDC:CheckSum\n 8
9
CODE 9 /* *** SCI1init(): initialize the SCI module */ void SCI1init(void){ SCI1BD = 78; // baud rate = BUSCLK/(16*BD), BD is 13bits SCI1C1 = 0; // default is 8bit/no flow/no parity/1 stop bit SCI1C2 = 0x0C; // enable Tx & Rx }
10
CODE 10 /* *** checksum8(): compute & return 1's * complement checksum of specified byte array * in: p=pointer to beginning of byte array * len=length of array in bytes * out: 8-bit 1's comp. checksum */ byte checksum8(void *p, int len) { byte *q = p; byte sum = 0; for (; len > 0; --len) sum += *q++; return (byte) ~sum; } /* *** SCIputX(): output either a string or single * character to the SCI module */ void SCI1putc(char c){ while (!(SCI1S1_TDRE)) {} // wait for SCI Tx ready SCI1D = c; // send the char } void SCI1puts(char *s){ while (*s){// while *s not terminating null, SCI1putc(*s++); // output 1 char & advance pointer }
11
CODE 11 /* * sendData(): function to periodically transmit status data "packet" * from global variables */ void sendData() { char s[80] = ""; // packet string to be sent byte cksum; // 8-bit 1's complement checksum // create broadcast packet string sprintf(s, "$SC%d,%d,%d,%d,%d,%d,%d", MyID, BID, Battery, irdata, steerpw, CurrentSpeed, MotorDC); // calculate checksum cksum = checksum8(s, (int) strlen(s)); // and append it to string sprintf(s + strlen(s), ":%02x", cksum); // add end-of-packet marker strcat(s, EOP); // send status packet SCI1puts(s); }
12
LABVIEW VI Car ID Destination ID Battery Voltage IR Data Steering Pulse Width Speed Motor DC 12
13
CONSOLE BLOCK DIAGRAM 13 Parse Packet Checksum (8bit)
14
FOR EXAMPLE: Lets take a look at SC5 right now…right now 14
15
RESULTS & ANALYSIS 15 SIDSID DIDDID EOPEOP
16
ISSUES AND WARNINGS D O N O T send 5V to Xbee — use level translator! Ensure level translator is installed correctly (proper orientation and connections) Ensure SCI Baud Rate is at the agreed upon 9600 bps 16
17
THE MOST IMPORTANT SLIDE Verify your wiring – Double and triple checks HIGHLY ENCOURAGED Packet Format: $SCID,BID,VBattery,IRData,SteerPW,CurrentSpeed,MotorDC:CheckSum\n Important Code: // calculate checksum cksum = checksum8(s, (int) strlen(s)); // and append it to string sprintf(s + strlen(s), ":%02x", cksum); // add end-of-packet marker strcat(s, EOP); SCI1BD = 78; // baud rate = BUSCLK/(16*BD), BD is 13bits 17
18
REFERENCES XBEE Module Datasheet Digi International. (2009). XBee User Manual. Retrieved March 24, 2016, from http://www.aet.calu.edu/~jsumey/CET360/smartcar/datasheets/xbee-user-manual.pdf http://www.aet.calu.edu/~jsumey/CET360/smartcar/datasheets/xbee-user-manual.pdf TXS0104E Datasheet Texas Instruments. (2006). TXS0104E Voltage-level Translator Manual. Retrieved March 24, 2016, from http://www.aet.calu.edu/~jsumey/CET360/smartcar/datasheets/TXS0104E.pdfhttp://www.aet.calu.edu/~jsumey/CET360/smartcar/datasheets/TXS0104E.pdf MCF51JM128 Reference Manual Freescale Semiconductor, Incorporated. (2009, June). MCF51JM128 ColdFire® Integrated Microcontroller Reference Manual. Retrieved March 22, 2016, from http://www.aet.calu.edu/ftp/cet/360/resources/Coldfire/MCF51JM128-RefManual-v2.pdf http://www.aet.calu.edu/ftp/cet/360/resources/Coldfire/MCF51JM128-RefManual-v2.pdf The MCF51JM Microcontroller Sumey, J. (2016, March 30). The MCF51JM Microcontroller. Retrieved from Jeff Sumey's Virtual Resource Center: http://www.aet.calu.edu/~jsumey/CET360/ppts/02-Coldfire.pdfhttp://www.aet.calu.edu/~jsumey/CET360/ppts/02-Coldfire.pdf 18
19
QUESTIONS? 19
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.