首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导41081程序、C++编程调试、program编程讲解 辅导Web开发|调试Matlab程序
项目预算:
开发周期:
发布时间:
要求地区:
41081 Sensing, Actuation and Control
Outline of Lab 1
In this lab, you will learn
1. how to install and configure RIMS;
2. how to use RIMS, including how to debug and run a program at different speeds, and
how to call functions;
3. How to develop C programs with different functionalities.
PART 1: Installing RIMS and practices
Download RI Tools from: http://www.cs.ucr.edu/~vahid/pes/RITools/ . After you download the
Windows version v2.8, run the RIMS.EXE file to install it.
Go to the RI Tool help page and get familiar with the basic functions.
First Try:
• Double-click RIMS desktop icon
• Click "Save" button to save the preloaded sample C program
• Click "Compile" button to convert C code to machine instructions (not seen by user) for
the RI microcontroller
• Click "Run" button to run the program
• Click "A0" switch to change A0's value from 0 to 1, note the "B0" value changes to 1
and its LED turns green per the sample program, which sets B0 to 1 when A0 is 1 and
A1 is 0.
• Click the "A1" switch, note that B0 changes back to 0, according to the sample program.
Debugging
• While running, move speed slider left to execute slower, right to execute faster.
• Press "Break" to stop execution; The arrow indicates the current C instruction to run
• Press "Step" to execute one machine instruction (note: one C instruction may consist of
several machine instructions).
• Press "Continue" to resume the execution
RIMS basic practices
RIMS (Riverside-Irvine Microcontroller Simulator) is a graphical tool that supports C
programming and simulated execution of RIM.
Click “Open sample” to load any file. Press "Compile", then press "Run". Press A0 to A7 to
change to 1, then press A0 to A7 to change to 0; note B changes in led. Press "Terminate".
Click “File” then “New” to start a new project.
41081 Sensing, Actuation and Control
3
Modify the program by assigning B0 = (A0 && A1) || (!A0 && !A1); Change the simulation speed
to "Slowest". Press "Compile", then press "Run". Change the values of A0 and A1. Note that the
simulator highlights the next statement to execute. Press Stop.
Modify the program by setting B0 to 1 when A0 is 0 and A1 is 0, or when A0 is 0 and A2 is 0.
(for example: B0 = (A0 && A1) || (A0 && A2));
Modify the program by setting B0 to 1 when the number of 1s on A2, A1, and A0 is two or
more (i.e., when A2A1A0 are 011, 110, 101, or 111). Click "Compile" then "Run" to test your
program
41081 Sensing, Actuation and Control
4
Change the simulation speed to "Slowest" while the program is running; note the highlighted
statement is the next statement to execute
RIMS debugger
Set A1A0 to 00, run the program, then press "Break". Press "Step" 5 times; note that the
current statement is highlighted and move forward with each press of "Step".
Change A1A0 to 01, then press "Step" until B0 changes. Press "Continue" to resume running.
Press "Terminate" to end the simulation
41081 Sensing, Actuation and Control
5
Using printf
Add to the while(1) loop: printf("B = %d\r\n", B);. Press Compile then Run.
Set A0 and A1 to 1, so B0 is 1. Press “Break”. Note that the value of B is output in the terminal
window. Note that you can also set it as Slowest. What’s the result in terminal window? Save
your code.
41081 Sensing, Actuation and Control
6
PART 2: TASKS
Task 2.1: Seat belt warning system (4 points).
A car has a sensor connected to A0 (1 means the car is on), another sensor connected to A1 (1
means a person is in the driver's seat), and a sensor connected to A2 (1 means the seat belt is
fastened). Write RIM C code for a "fasten seat belt" system that illuminates a warning light (by
setting B0=1) when the car is on, a driver is seated, and the seat belt is not fastened. Test the
written code with RIMS for all possible input combinations of A2, A1, A0.
Send us your results in a file (Word or PDF) for marking using UTS canavs:
(1) Copy of your source code; (2 points)
(2) Screenshot of the case where: the car on, the driver is not seated (1 point)
(3) Screenshot of the case where: the car on, the driver is seated and the seat belt is not
fastened (1 point)
Task 2.2: RIMS 7-segment display (6 Points)
Design and implement a C program using RIMS, that will continuously display the value of A3
A2 A1 A0, i.e. 0x0 to 0xF in a 7-segment display connected to B. Using optimal code for
efficiency. See below as an example: A3 A2 A1 A0 = 0110, i.e., 6 in decimal. Refer to
https://en.wikipedia.org/wiki/Seven-segment_display for more on 7-segment display.
Send us your results for marking:
41081 Sensing, Actuation and Control
7
(1) Copy of your source code; (2’)
(2) Screenshot when A3 A2 A1 A0 = 0101; (1’)
(3) Screenshot when A3 A2 A1 A0 = 1100; (1’)
(4) What is your idea if we need to display A7 A6 A5 A4 A3 A2 A1 A0 using two 7-
segment display? Explain your idea, a short description and diagram as above will be
good. (2’)
Task 2.3: Parking lot sensors (5 Points)
A parking lot has eight spaces, each with a sensor connected to RIM input A7, A6, ..., A0. A RIM
input being 1 means a car is detected in the corresponding space. Spaces A7 and A6 are
reserved handicapped parking. Write a RIM C program that: (1) Sets B7 to 1 if both handicapped
spaces are full, and (2) Sets B2 B1 B0 equal to the number of available non-handicapped spaces.
For example, if the number of available non-handicapped spaces is 3, B2 B1 B0 are 011. Test
in RIMS. Refer to below function on how to get a bit given a char variable.
Send us your results for marking:
(1) Copy of your source code; (3’)
(2) Screenshot the result when test A = 0011 0000; (1’)
(3) Screenshot the result when test A = 1100 1101; (1’)
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!