Background:

advertisement
ME414/514
Homework 5
Due 5-6-2009
Matlab & Microcontrollers
Background:
This homework has a group and individual section. Everyone in the group is responsible
for understanding material covered in the group section and should turn in a copy of the
M-file that completes the first task. #3 and #4 are looking for approximate numbers.
Group Task:
1. Use Matlab to control one of the actuators used in your final project. Use a sensor
to verify correct operation of the actuator. Make a graph showing the command
being sent and the response being sensed.
Individual Task:
2. Assume that the Baud rate is set to 115200 kbps (kilobits per second). How long
would it take for the microcontroller to receive the serial command ‘as’?
3. Look at cdc_task.c and sensor.h for this question. After ‘as’ is received by the
microcontroller, how many clock cycles does it take to complete the command?
4. Look at cdc_task.c and sensor.h for this question. After ‘a2’ is received by the
microcontroller, how many clock cycles does it take to complete the command
and transmit the data back to the laptop?
5. Assume the microcontroller is operating at 1 MHz, how long does it take for the
microcontroller to receive the data, execute the command ‘a2’, and transmit a
response?
6. A non-realtime Operating System, like Win XP, does not guarantee timing on
checking serial ports. Typically they are only checked every 50 milliseconds. Use
your answer from #5 to find a percentage of time that the serial port is actually
transmitting data.
Download