Revision 256

View differences:

branch/colomban/Emb_App.tws
7 7
[GENERAL_DATA]
8 8
[BREAKPOINTS]
9 9
[OPEN_WORKSPACE_FILES]
10
"C:\Users\macolomban1\Downloads\programme_principal_etud (4).c" 
10 11
"E:\tp_info6_2018_colomban\tp_info6\bsp\clavier.c" 
11 12
"E:\tp_info6_2018_colomban\tp_info6\bsp\dma0.c" 
12 13
"E:\tp_info6_2018_colomban\tp_info6\bsp\mli.c" 
......
18 19
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\Debug\mr308.inc" 
19 20
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\programme_principal_etud.c" 
20 21
[WORKSPACE_FILE_STATES]
22
"C:\Users\macolomban1\Downloads\programme_principal_etud (4).c" 150 150 1430 351 0 10 
21 23
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\Debug\mr308.inc" 0 0 1430 351 0 7 
22 24
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\conf_noyau.cfg" 0 0 1596 539 0 9 
23 25
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\crt0mr.a30" 150 150 1430 351 0 6 
branch/colomban/Emb_App/SessionM32C_E8a_system.hsf
141 141
"{55384715-F881-421C-A548-D7D1ABE158E1}PDMRWndInstanceKey0" "{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system" 
142 142
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_DENORMAL_MODE" "0" 
143 143
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_ROUND_MODE" "0" 
144
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000044" 
145
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000020" 
144
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000102" 
145
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000143" 
146 146
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_10" "0000000000000000" 
147 147
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_11" "0000000000000000" 
148 148
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_12" "0000000000000000" 
149 149
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_13" "0000000000000000" 
150 150
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_14" "0000000000000000" 
151 151
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000512" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0579" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF1DC1" 
153 153
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000009DC" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000814" 
156
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000014" 
157
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000044" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000AFA" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000834" 
156
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000006" 
157
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004044" 
158 158
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_21" "0000000000000000" 
159 159
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_22" "0000000000000000" 
160 160
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_23" "0000000000000000" 
......
171 171
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_33" "0000000000000000" 
172 172
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "000000000000036A" 
173 173
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
174
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000009" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A08" 
174
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "000000000000000C" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000005" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000B30" 
177 177
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000512" 
178 178
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
179 179
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
......
209 209
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Global," 
210 210
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "alpha, 2, 0, P, Col, Dec, MA" 
211 211
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Global," 
212
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "2" 
212
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "cpt, 2, 0, P, Col, Hex, MA" 
213
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Global," 
214
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "3" 
213 215
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
214 216
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
215 217
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
......
283 285
"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 -4 -30 948 486 9 0 "" "0.0" 
284 286
"{WK_00000001_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 0 "0.11" 365 0 0 350 200 18 0 "32774|32775|32777|<<separator>>|32780|<<separator>>" "0.0" 
285 287
"{WK_00000001_MEMORY}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.23" 365 2 -1 350 200 2065 0 "42202|42203|42204|42233|<<separator>>|42206|42205|42230|42229|42207|<<separator>>|42208|42209|42210|49076|42228|42227|<<separator>>|42231|42232|42234|42235|<<separator>>|42211|<<separator>>|32796|32797" "0.0" 
286
"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 3 "0.48" 365 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
288
"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 3 "0.53" 365 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
287 289
"{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 4 "0.18" 365 0 0 350 200 18 0 "47300|47301|47302|47303|47304|47305|47314|47306|47307|47308|47311|47312|47313|42211|42509|42303" "0.0" 
288 290
"{WK_00000001_REGISTERS}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59421 0 0 "1.00" 236 0 0 350 200 2065 0 "" "0.0" 
289
"{WK_00000001_WATCH}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.23" 365 0 0 350 200 18 0 "32781|32783|<<separator>>|32771|32772|32773|<<separator>>|32786|<<separator>>|32810|32811" "0.0" 
291
"{WK_00000001_WATCH}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.18" 365 0 0 350 200 18 0 "32781|32783|<<separator>>|32771|32772|32773|<<separator>>|32786|<<separator>>|32810|32811" "0.0" 
290 292
"{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 308 0 0 350 200 18 0 "" "0.0" 
291 293
"{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
292 294
"{WK_TB00000002_EDITOR}" "TOOLBAR 0" 59419 0 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
......
313 315
[WINDOW_Z_ORDER]
314 316
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\programme_principal_etud.c" 
315 317
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\crt0mr.a30" 
318
"C:\Users\macolomban1\Downloads\programme_principal_etud (4).c" 
319
"E:\tp_info6_2018_colomban\tp_info6\bsp\uart0.c" 
320
"E:\tp_info6_2018_colomban\tp_info6\bsp\radiocommande.c" 
321
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\conf_noyau.cfg" 
316 322
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\Debug\mr308.inc" 
317
"E:\tp_info6_2018_colomban\tp_info6\Emb_App\conf_noyau.cfg" 
318
"E:\tp_info6_2018_colomban\tp_info6\bsp\radiocommande.c" 
319
"E:\tp_info6_2018_colomban\tp_info6\bsp\uart0.c" 
320 323
"E:\tp_info6_2018_colomban\tp_info6\bsp\periph.c" 
321 324
"E:\tp_info6_2018_colomban\tp_info6\bsp\clavier.c" 
322 325
"E:\tp_info6_2018_colomban\tp_info6\bsp\dma0.c" 
......
367 370
[FLASH_DETAILS]
368 371
"" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
369 372
[BREAKPOINTS]
370
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 95237480 1 "{00000000-0000-0000-C000-000000000046}" "" 
373
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 85333832 1 "{00000000-0000-0000-C000-000000000046}" "" 
371 374
[END]
branch/colomban/Emb_App/crt0mr.a30
97 97
; after reset,this program will start
98 98
;-----------------------------------------------------------------
99 99
__SYS_INITIAL:
100
	LDC	#__Sys_Sp,ISP	; set initial ISP
100
LDC	#__Sys_Sp,ISP	; set initial ISP
101 101

  
102 102
	MOV.B	#2,0AH
103 103
	MOV.B	#00,PMOD		; Set Processor Mode Register
branch/colomban/Emb_App/programme_principal_etud.c
124 124
unsigned short      dist ;
125 125
unsigned short      k=4; //pour augmenter la vitesse jusqu'a la position souhait?e
126 126
unsigned short      ka=1;
127
unsigned short 		cpt;
127 128
void vitesse(unsigned short vit);
129
CanFrame comm;
130
CanFrame req;
131
UINT flag;
128 132

  
129 133
void main()
130 134
{   
......
142 146
	sta_cyc(ID_acqui);
143 147
	sta_tsk(ID_periph_rx);
144 148
	sta_tsk(ID_asserv);
145
	sta_tsk(ID_roue);
149
	sta_tsk(ID_roue);
150
	sta_tsk(ID_capteur);
151
	
146 152
	dly_tsk(1500);
147 153
	
148 154
    while(1)
......
150 156
		LED_J=1;
151 157
		
152 158
		LED_J=0;
159
		vitesse(30);
160
        
153 161
		
154
        vitesse(20);
155
		
156 162
	}
157 163
	
158 164
}
......
165 171

  
166 172
{
167 173
		unsigned short consigne = 400;
168
		CanFrame comm;
169
	    CanFrame req;
170
		UINT flag;
171 174
		while(1){
172 175
			
173 176
			req.data.id = 'R';
......
187 190
} 
188 191

  
189 192
void vitesse(unsigned short vit){
190
		CanFrame comm;
191 193
		comm.data.id = 'V';
192 194
		comm.data.rtr = 0;
193 195
		comm.data.val = vit;
......
198 200

  
199 201
void asserv_roue(){
200 202
	unsigned short consignes = 770;
201
	    CanFrame comm;
202
	    CanFrame req;
203
		UINT flag;
203
	    
204 204
		while(1){
205
			
206 205
			req.data.id = 'U';
207 206
			req.data.rtr = 1;
208 207
			periph[ADDR('U')].ev=0X01;
209 208
			snd_dtq(CanTx, req.msg);
210 209
			wai_flg(ev_periph,0X01,TWF_ANDW, &flag);
211 210
			dist=periph[ADDR('U')].val;
212
			
211
			if(dist>1600){
212
					comm.data.id = 'D';
213
					comm.data.rtr = 0;
214
					comm.data.val = 0;
215
					snd_dtq(CanTx, comm.msg);
216
					dly_tsk(150);
217
				
218
				}
213 219
			comm.data.id = 'D';
214 220
			comm.data.rtr = 0;
215 221
			comm.data.val = ka*(-consignes + dist);
......
217 223
			
218 224
		
219 225
		}		
220
	}
226
	}
227

  
228
void capteur(){
229
	     	while(1)
230
			{
231
			req.data.id = 'C';
232
			req.data.rtr = 1;
233
			periph[ADDR('C')].ev=0X01;
234
			snd_dtq(CanTx, req.msg);
235
			wai_flg(ev_periph,0X01,TWF_ANDW, &flag);
236
			cpt=periph[ADDR('C')].val;
237
			
238
	}
239
}
branch/colomban/Emb_App/conf_noyau.cfg
2 2
//
3 3
//    kernel.cfg : building file for MR308 Ver.4.00
4 4
//
5
//    Generated by M3T-MR308 GUI Configurator at 2018/12/11 15:58:50
5
//    Generated by M3T-MR308 GUI Configurator at 2018/12/14 14:46:45
6 6
//
7 7
////////////////////////////////////////////////////////////////////////////////
8 8

  
......
20 20

  
21 21
// max definition
22 22
maxdefine{
23
	max_task	= 5;
23
	max_task	= 6;
24 24
	max_flag	= 3;
25 25
	max_dtq	= 2;
26 26
	max_cyh	= 1;
......
79 79
	initial_start	= OFF;
80 80
	exinf	= 0x0;
81 81
};
82
task[]{
83
	entry_address	= capteur();
84
	name	= ID_capteur;
85
	stack_size	= 256;
86
	stack_section	= stack;
87
	priority	= 6;
88
	initial_start	= OFF;
89
	exinf	= 0x0;
90
};
82 91

  
83 92
flag[]{
84 93
	name	= ev_bus_fin_tr;

Also available in: Unified diff