270 likes | 409 Views
– Software Design Considerations –. Josh Marchi, Jeff King, Paul Rosenberger, Dan Chambers . Project Overview. “Reverse Geocache” Box Locked box that will only open after one or more pre-determined GPS locations have been visited
E N D
– Software Design Considerations – Josh Marchi, Jeff King, Paul Rosenberger, Dan Chambers
Project Overview • “Reverse Geocache” Box • Locked box that will only open after one or more pre-determined GPS locations have been visited • Directs user to next location by GPS coordinates, compass heading, or text description displayed on LCD. • Route stored on microSD card located inside the box, able to be reprogrammed by PC • RFID “master key” to allow access to box without finishing puzzle
PSSCs • An ability to obtain and decode global positioning data in order to verify if current location matches pre-determined desired location. • An ability to utilize accelerometer and magnetometer data to determine a compass heading with tilt compensation. • An ability to access and interpret files located on a microSD card. • An ability to display information to the user via an LCD display. • An ability to identify an RFID tag using an RFID reader.
Software Design- Computational Requirements • GPS coordinate analysis at a rate of 1Hz • Determine distance to next waypoint • Compass heading / tilt compensation at a rate of approximately 5Hz • Floating point values, trig functions required (lookup table) • SD card interface uses MDD File System Library • Large amount of Flash/SRAM
Software Design- Microcontroller • PIC24FJ256GA106 • 16 Bit Architecture • Up to 16 MIPS CPU speed • 256KB Flash • 16KB RAM • Memory Disk Drive File System Library Support • 4 UART Modules • 3 I2C Modules • 3 SPI Modules • 64 Total Pins • Reasons for Selecting: • Enough UART/SPI/I2C channels • Adequate Flash/RAM for all code/libraries • MDD File System Library Support
Software Design- Code Organization (Interrupt/Polling Hybrid) • Interrupts Generated • UART Rx character received (GPS, RFID) • Flag set when entire message received • Periodic Timers (compass, fuel gauge polling) • Flag set, polling done in main loop • Main Loop • Analyze RFID message if flag is set • If ID matches “master key”, unlock box, play buzzer, update LCD • Analyze GPS message if flag is set • If GPS matches desired waypoint, load next waypoint, update LCD • If GPS doesn’t match waypoint, just update LCD with new position • Obtain Compass data if flag is set • Calculate heading with tilt compensation, update LCD • Obtain Fuel Gauge data if flag is set • Calculate and update LCD