[Solved] CEG 4330/6330 Laboratory 3 Serial Port IO Control

$25

File Name: CEG_4330/6330_Laboratory_3_Serial_Port_IO_Control.zip
File Size: 461.58 KB

SKU: [Solved] CEG 4330/6330 Laboratory 3 Serial Port IO Control Category: Tag:
5/5 - (1 vote)

PURPOSE

In this four-week lab, you will interface an LCD and a Bluetooth modem to the UNO. You will design and implement an embedded system based on components you implemented in previous labs. Interrupt will be used.

NOTE

  • Use an Arduino IDE instead of a simulator for this lab. Compile your code and make sure there is no syntax error. Since the grading will be done without running your code on a real hardware, you should try your best in removing logic errors.
  • You only need to turn in the final Arduino sketch, i.e., a project file with an ino file extension, and a corresponding circuit diagram showing the connection of various components to the UNO pins. The circuit diagram may be a scanned hand-drawing file, or a file generated by some drawing tools.
  • The code should be easy to read with suitable comments and modular programming. In other words, use arrays and short functions. Try to avoid using a long function that contains large number of C statements. Use meaningful function names.

EXPERIMENT

Step 1: Study the Arduino sketch LCD_SPI.ino available on the course pilot website under labsLCD. The sketch works when an LCD display (NHD-0216K3Z-FL-GBW-V3) is connected to some UNO digital pins. There is no need to turn in anything yet.

Hint: The sketch uses neither the SPI hardware available on UNO nor shiftOut( ), an Arduino library function that simulates SPI. It does allow the study of the digital pin waveforms involved in SPI communication.

Step 2: Study https://learn.sparkfun.com/tutorials/using-the-bluesmirf for a Bluetooth modem that may be connected to the UNO board. Conceptually the UNO board may use the modem to communicate with another computer that supports Bluetooth. (Physically, one single computer may serve as both the host PC, i.e., the computer that the UNO connects to, and the other computer that communicates with the UNO through the Bluetooth modem.) Create a project that would conceptually allow the LCD to display a message, e.g., Hello World, sent from a Termite program running on the host PC. The Termite program sends out Bluetooth signals to the Bluetooth modem. The LCD should be cleared initially. There is no need to turn in anything yet.

Hint: Termite is a terminal emulator program, similar to the Arduino IDE serial monitor, that can be freely downloaded from the web. You dont have to download it for this lab.

Step 3: Develop the following UNO-based system by integrating components you have developed.

The system has a keypad, a push-button, a speaker, a potentiometer, an LCD, and a Bluetooth modem. It also takes a square wave input from a function generator with Fin as its frequency. The system functions as follows:

  • When the system starts up, a default music segment, CDEFGAB, is played repeatedly. Each tone lasts for 280 ms. There should a 40 ms pause after each tone.
  • The playing of the default music segment stops when either the keypad or the Bluetooth modem receives some user actions.
  • As in Lab 1, the keypad is used for users to play a new music segment. Pressing down the push-button at the same time with a key allows the music tone to be one octave higher. A special key is used to restart the default music segment again. As in Lab 1, you may assume no debouncing is needed for the push-button.
  • Another way for users to play a new music segment is to send a numerical string (0 to 9, similar to numerical keys on keypad) from the PC-based Termite program through the Bluetooth modem to the UNO board. The duration of each tone would be 280 ms with a 40 ms pause afterwards. A special key is used to restart the default music segment again. Assume that the keypad inputs and the modem inputs will not arrive at the same time or arrive in an interleaving fashion.
  • At any time, only the default music segment is kept in the system.
  • Either the keypad input or the modem input is displayed on the LCD. Users should be allowed to clear the LCD display by using either input.
  • As in Lab 2, a potentiometer and a function generator are used to generate a square wave of 50% duty cycle using a timer 1 channel A output compare interrupt. The square wave frequency is equal to (Fin / scale), where Fin is the (500 to 5,000 Hz) frequency of the square wave from the function generator, while scale is 1, 2, 3 or 4. The analog input from the potentiometer is used to select one of the four scale options. The generation of the square wave may be stopped or re-started by using special commands from either the keypad or the termite program through the modem. Initially the system starts with no square wave generation.

Turn in the .ino file and the circuit diagram file using Pilot dropbox before 5PM on November 12, Friday. There is no need to email the TA.

Some students may get extra credits (therefore more than 100%) if their systems are much better than other students systems. (Note that the system is not fully specified, especially in terms of user friendliness and error handling.) Such grading will be based on the lab instructors subjective evaluations.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CEG 4330/6330 Laboratory 3 Serial Port IO Control
$25