Question: Software Tools To complete the assignment you will need the following software tools: MPLAB X IDE v3.51 (as installed in Lab 1) MobaXterm (a terminal
Software Tools
To complete the assignment you will need the following software tools:
MPLAB X IDE v3.51 (as installed in Lab 1)
MobaXterm (a terminal application; see: http://mobaxterm.mobatek.net/)
Lab Specifications
You will develop a PIC32 application for your ChipKIT which measures the distance picked up by the MAXSONAR range finder, and which displays the distance measured in a variety of ways.
The MAXSONAR module is an automatic module that returns the distance measured in inches, once every 49ms, as an ASCII-formatted message through a UART connection. Your program needs to parse this message and decode the distance in inches as an integer value. The distance measured then needs to be returned to the user using two different mechanisms (a) as a bar-graph on the LEDs, and (b) as a formatted message to a terminal connected to the ChipKit through the USB-UART connection. Both UART connections, the MAXSONAR UART and the USB-UART, have to work at 9600 baud, 8 data bits, no parity, and 1 stop bit.
The 4 LEDs of the board will indicate the distance measured using the following scale. The LEDs are continuously updated, as soon as measurements are available.
For distances less than 8 inches, all LEDs are off
For distances greater than or equal to 8 inches but less than 16 inches, LED1 is on.
For distances greater than or equal to 16 inches but less than 32 inches, LEDs 1 and 2 are on.
For distances greater than or equal to 32 inches but smaller than 64 inches, LEDs 1 through 3 are on.
For distances greater than or equal to 64 inches, all LEDs are on.
The board will also transmit an ASCII message through the USB-UART connection. Every 500ms, the board will transmit an ASCII message formatted as follows:
Distance: nnn Max: nnn Min: nnn
In the above message format, nnn is a numeric value indicating inches of distance, such as 77, 6, or 152 inches. Max and Min display the largest and smallest distance recorded, respectively. These Max-hold and Min-hold values can be reset by pressing button 2 and button 1 on the board, respectively.
If the user presses button 1, then the minimum distance (displayed in the Min field) is reset to 255, the largest value returned by the MAXSONAR.
If the user presses button 2, then the maximum distance (displayed in the Max field) is reset to 0, the smallest distance possible.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
