MEC302 – Embedded Computer Systems 2023/24 – Semester 2 Assignment 2R

Java Python MEC302 - Embedded Computer Systems

2023/24 - Semester 2

Assignment 2 - Programming 8051 microcontroller

Remarks:

1. The assignment is worth 10% of the module mark.

2. The assignment tasks are designed to be implemented (i.e., programmed) in Keil uVision 5 and emulated on edSim51di emulator.

3. Submission deadline is May 12, 23:59. Only submit to LM.

4. Late submissions will be penalized according to the University policy:

•   5% deduction for each working day after the submission deadline;

•   work received more than five working days after the submission deadline will receive a mark of zero.

Instructions:

1. The assignment contains two tasks to program  8051 microcontroller  with peripheral  devices emulated in edSim51di.

2. Question 1 is worth 30%, Question 2 is worth 30%, Question 3 is worth 30%, and Report is worth 10%.

3. For each task you must submit one Embedded C program (.c file) for 8051 microcontroller with the following name pattern: student-id_task-number.c . Do not submit any other file formats as

it will be impossible to compile them!

4. You need to write a report consisting of

a.   Flow chart for each question.

b.   Explanation of the program. You should make comments in your embedded C code. The more

comments you make the easier it will be for the instructor to follow.

5. Put all the .cfiles and report in one ZIP file.

6. The submitted files will be compiled by the TAs using Cx51 compiler by Keil uVisdai 写MEC302 – Embedded Computer Systems 2023/24 – Semester 2 Assignment 2R ion 5 and tested on edSim51di emulator to check if your programs meet all requirements set in tasks.

AVOID HARD CODING!!

Hard coding refers to the practice of embedding fixed values directly into the source code of a program or system, rather than using variables or configuration files. These fixed values are typically constants, literals, or specific data that remain unchanged during the execution of the program.

Programming task 1

Switches are connected to port P2. LEDs are connected to the P1 port.

1)  Press 0: LED1 is ON

2)  Press 1: LED2 is ON

3)  Press 2: LED3 is ON

4)  Press 3: LED4 is ON

5)  Press 4: LED5 is ON

6)  Press 5: LED6 is ON

7)  Press 6: LED7 is ON

8)  Press 7: all LED is ON

Programming task 2

Switches are connected to port P2. 7-segment is connected to the P1 port.

The 7-segment will display one number higher than the one pressed.

For example, when you press “2”, the 7-segment will display “3” .

Programming task 3

You are asked to control the motor. The switches are connected to P2.

1)  Press the key Switch 0 and turn the motor X rotations in the clockwise direction and then stop.

2)  Press the key Switch 1, turn the motor X rotations in the counter clockwise direction and then stop.

X = last digit of your student ID. If it is 0, replace it with 5   Artificial intelligence Java or Java Python C++        WX:codehelp

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值