2021-11-3

This commit is contained in:
Asryn 2021-11-03 10:23:24 +08:00
parent 310543de71
commit 070fc38866
13 changed files with 3654 additions and 0 deletions

View File

@ -15,6 +15,7 @@
* 09. homework 点击SW1改变LED状态
* 10. task010 一阶段考核:通过SW1对流水灯进行操作,当按下SW1时暂停流水灯并保持当前状态,当再次按下时在上次保存状态开始继续向下执行。
* 11. Zigbee无线通信 A、B两板相互控制LED
* 12. task010 上电时D3,D4,D5,D6跑马效果,当SW1按下,同时当D6亮起时控制双联继电器打开,D6熄灭控制双联继电器关闭

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
This is an internal working file generated by the Source Browser.
10:07 50s
C:\Users\Suik\Desktop\task004\Debug\Obj\code.pbi

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Project/>

View File

@ -0,0 +1,15 @@
@REM This batch file has been generated by the IAR Embedded Workbench
@REM C-SPY Debugger, as an aid to preparing a command line for running
@REM the cspybat command line utility using the appropriate settings.
@REM
@REM You can launch cspybat by typing the name of this batch file followed
@REM by the name of the debug file (usually an ELF/DWARF or UBROF file).
@REM Note that this file is generated every time a new debug session
@REM is initialized, so you may want to move or rename the file before
@REM making changes.
@REM
"D:\IAR Systems\Embedded Workbench 6.0\common\bin\cspybat" "D:\IAR Systems\Embedded Workbench 6.0\8051\bin\8051proc.dll" "D:\IAR Systems\Embedded Workbench 6.0\8051\bin\8051sim.dll" %1 --plugin "D:\IAR Systems\Embedded Workbench 6.0\8051\bin\8051bat.dll" --backend -B "--proc_core" "plain" "--proc_code_model" "banked" "--proc_nr_virtual_regs" "8" "--proc_pdata_bank_reg_addr" "0x93" "--proc_dptr_nr_of" "1" "--proc_codebank_reg" "0x9F" "--proc_codebank_start" "0x8000" "--proc_codebank_end" "0xFFFF" "--proc_codebank_mask" "0xFF" "--proc_data_model" "large" "-p" "D:\IAR Systems\Embedded Workbench 6.0\8051\config\devices\Texas Instruments\ioCC2530F256.ddf" "--proc_driver" "sim"

View File

@ -0,0 +1,24 @@
[InterruptLog]
LogEnabled=0
SumEnabled=0
GraphEnabled=0
ShowTimeLog=1
ShowTimeSum=1
SumSortOrder=0
[Breakpoints]
Count=0
[Interrupts]
Enabled=1
[MemoryMap]
Enabled=0
Base=0
UseAuto=0
TypeViolation=1
UnspecRange=1
ActionState=1
[Aliases]
Count=0
SuppressDialog=0
[TraceHelper]
Enabled=0
ShowSource=1

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>task004./Debug</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>84</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build>
<ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1395</ColumnWidth1><ColumnWidth2>372</ColumnWidth2><ColumnWidth3>93</ColumnWidth3></Build>
</Static>
<Windows>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-15843-25665</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>task004.</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3>
<Tabs>
<Tab>
<Identity>TabID-2691-28777</Identity>
<TabName>Build</TabName>
<Factory>Build</Factory>
<Session/>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\source\code.c</Filename><XPos>0</XPos><YPos>30</YPos><SelStart>160</SelStart><SelEnd>160</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-05711d30><key>iaridepm.enu1</key></Toolbar-05711d30></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>502</Bottom><Right>158</Right><x>-2</x><y>-2</y><xscreen>160</xscreen><yscreen>155</yscreen><sizeHorzCX>115942</sizeHorzCX><sizeHorzCY>221429</sizeHorzCY><sizeVertCX>115942</sizeVertCX><sizeVertCY>720000</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>153</Bottom><Right>1382</Right><x>-2</x><y>-2</y><xscreen>1384</xscreen><yscreen>155</yscreen><sizeHorzCX>1002899</sizeHorzCX><sizeHorzCY>221429</sizeHorzCY><sizeVertCX>115942</sizeVertCX><sizeVertCY>221429</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View File

@ -0,0 +1,91 @@
#include<ioCC2530.h>
#define LED1 P1_0
#define LED2 P1_1
#define SW1 P1_2
#define LED3 P1_3
#define LED4 P1_4
#define JD1 P1_7 //¼ÌµçÆ÷1
#define JD2 P2_0 //¼ÌµçÆ÷2
unsigned char key_down = 0;
void initial_gpio(){
P1SEL &=~0X9F;
P1DIR |=0X9B; //P1_7
P1DIR &=~0X04;
P1INP &=~0X04;
P2INP &=~0X40;
P2SEL &=~0X01; //P2_0
P2INP |=0X01;
IEN2 |=0X10; //°´Å¥ÖжÏ
P1IEN |=0X04;
PICTL |=0X02;
EA = 1;
JD1 = 0;
JD2 = 0;
P1 &=~0x1F;
}
void delay(int time){
int i , j;
for(i = 0;i<time;i++){
for(j = 0;j<255;j++);
}
}
#pragma vector = P1INT_VECTOR
__interrupt void P1_INT(void){
if(P1IFG & 0X04){
while(!SW1);
if(key_down == 0){
key_down = 1;
}else{
key_down = 0;
P1 &=~0x1F;
}
P1IFG &=~0X04;
}
P1IF = 0;
}
void main(){
initial_gpio();
while(1){
// if(SW1 == 0){
// delay(10);
// if(SW1 == 0){
// while(!SW1);
// if(key_down == 0){
// key_down = 1;
// }else{
// key_down = 0;
// }
// }
// }
if(key_down){
LED2 = 1;
delay(2000);
LED2 = 0;
LED1 = 1;
delay(2000);
LED1 = 0;
LED4 = 1;
JD1 = 1;
delay(2000);
LED4 = 0;
JD1 = 0;
LED3 = 1;
delay(2000);
LED3 = 0;
}else{
P1 &=~0x1F;
}
}
}

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<project>
<fileVersion>2</fileVersion>
<fileChecksum>627649192</fileChecksum>
<configuration>
<name>Debug</name>
<outputs>
<file>$TOOLKIT_DIR$\inc\ioCC2530.h</file>
<file>$TOOLKIT_DIR$\config\devices\Texas Instruments\lnk51ew_CC2530F256_banked.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\task004.pbd</file>
<file>$PROJ_DIR$\Debug\Obj\code.r51</file>
<file>$TOOLKIT_DIR$\lib\clib\cl-pli-blxd-1e16x01.r51</file>
<file>$PROJ_DIR$\Debug\Exe\task004.hex</file>
<file>$PROJ_DIR$\source\code.c</file>
<file>$PROJ_DIR$\Debug\Exe\task004..d51</file>
<file>$PROJ_DIR$\Debug\Obj\code.pbi</file>
</outputs>
<file>
<name>[ROOT_NODE]</name>
<outputs>
<tool>
<name>XLINK</name>
<file> 7 5</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\Debug\Obj\task004.pbd</name>
<inputs>
<tool>
<name>BILINK</name>
<file> 8</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\source\code.c</name>
<outputs>
<tool>
<name>ICC8051</name>
<file> 3</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 8</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICC8051</name>
<file> 0</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 0</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\Debug\Exe\task004..d51</name>
<outputs>
<tool>
<name>XLINK</name>
<file> 5</file>
</tool>
</outputs>
<inputs>
<tool>
<name>XLINK</name>
<file> 1 3 4</file>
</tool>
</inputs>
</file>
</configuration>
<configuration>
<name>Release</name>
<outputs/>
<forcedrebuild>
<name>[MULTI_TOOL]</name>
<tool>XLINK</tool>
</forcedrebuild>
</configuration>
</project>

1281
task011/task004/task004..ewd Normal file

File diff suppressed because it is too large Load Diff

2072
task011/task004/task004..ewp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\task004..ewp</path>
</project>
<batchBuild/>
</workspace>