.module test_remote.c
.area text(rom, con, rel)
.dbfile e:/ICC/include/sl3010.c
.dbfunc e port_init _port_init fV
.even
_port_init::
.dbline -1
.dbline 83
; //ICC-AVR application builder : 03-1-21 13:42:41
; // Target : 8515
; // Crystal: 8.0000Mhz
; // Test remote
; // B C
; // D A
; // C----8D4---PA3---PB3
; // A----8D3---PA2---PB2
; // B----8D2---PA1---PB1
; // D----8D1---PA0---PB0
;
; #include
; #include
; #include
;
; unsigned char remote;
;
; //call this routine to initialise all peripherals
; void init_devices(void)
; {
; //stop errant interrupts until set up
; CLI(); //disable all interrupts
; port_init();
;
; MCUCR = 0x00;
; GIMSK = 0x00;
; TIMSK = 0x00;
; SEI(); //re-enable interrupts
; //all peripherals are now initialised
; }
;
; //
; void main(void)
; {
; init_devices();
; while (1)
; {
; remote = PINB & 0xF0;
; PORTA = ~remote;
; }
; }
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
.dbline 84
;
ldi R24,255
out 0x1a,R24
.dbline 84
out 0x1b,R24
.dbline 85
;
ldi R24,128
out 0x17,R24
.dbline 85
ldi R24,255
out 0x18,R24
.dbline 86
;
ldi R24,1
out 0x14,R24
.dbline 86
ldi R24,255
out 0x15,R24
.dbline 87
;
ldi R24,240
out 0x11,R24
.dbline 87
ldi R24,255
out 0x12,R24
.dbline -2
.dbline 88
;
L1:
.dbline 0 ; func end
ret
.dbend
.dbfunc e delay_us _delay_us fV
; time -> R16,R17
.even
_delay_us::
.dbline -1
.dbline 91
;
;
;
L3:
.dbline 93
;
;
.dbline 94
;
subi R16,1
sbci R17,0
.dbline 95
;
L4:
.dbline 96
;
ldi R24,1
ldi R25,0
cp R24,R16
cpc R25,R17
brlt L3
.dbline -2
.dbline 97
;
L2:
.dbline 0 ; func end
ret
.dbsym r time 16 I
.dbend
.dbfunc e delay_ms _delay_ms fV
; time -> R20,R21
.even
_delay_ms::
rcall push_gset1
mov R20,R16
mov R21,R17
.dbline -1
.dbline 100
;
;
;
rjmp L8
L7:
.dbline 102
.dbline 103
ldi R16,1000
ldi R17,3
rcall _delay_us
.dbline 104
subi R20,1
sbci R21,0
.dbline 105
L8:
.dbline 101
;
cpi R20,0
cpc R20,R21
brne L7
X0:
.dbline -2
.dbline 106
;
;
;
;
;
L6:
rcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r time 20 i
.dbend
.dbfunc e turn_right _turn_right fV
.even
_turn_right::
.dbline -1
.dbline 109
;
;
;
.dbline 110
;
ldi R24,96
out 0x12,R24
.dbline 111
;
ldi R24,204
out 0x1b,R24
.dbline -2
.dbline 112
;
L10:
.dbline 0 ; func end
ret
.dbend
.dbfunc e turn_left _turn_left fV
.even
_turn_left::
.dbline -1
.dbline 115
;
;
;
.dbline 116
;
ldi R24,144
out 0x12,R24
.dbline 117
;
ldi R24,51
out 0x1b,R24
.dbline -2
.dbline 118
;
L11:
.dbline 0 ; func end
ret
.dbend
.dbfunc e turn_right_s _turn_right_s fV
.even
_turn_right_s::
.dbline -1
.dbline 120
;
;
.dbline 121
;
ldi R24,32
out 0x12,R24
.dbline 122
;
ldi R24,207
out 0x1b,R24
.dbline -2
.dbline 123
;
L12:
.dbline 0 ; func end
ret
.dbend
.dbfunc e turn_left_s _turn_left_s fV
.even
_turn_left_s::
.dbline -1
.dbline 126
;
;
;
.dbline 127
;
ldi R24,128
out 0x12,R24
.dbline 128
;
ldi R24,243
out 0x1b,R24
.dbline -2
.dbline 129
;
L13:
.dbline 0 ; func end
ret
.dbend
.dbfunc e backward _backward fV
.even
_backward::
.dbline -1
.dbline 132
;
;
;
.dbline 133
;
ldi R24,80
out 0x12,R24
.dbline 134
;
ldi R24,60
out 0x1b,R24
.dbline -2
.dbline 135
;
L14:
.dbline 0 ; func end
ret
.dbend
.dbfunc e forward _forward fV
.even
_forward::
.dbline -1
.dbline 138
;
;
;
.dbline 139
;
ldi R24,160
out 0x12,R24
.dbline 140
;
ldi R24,195
out 0x1b,R24
.dbline -2
.dbline 141
;
L15:
.dbline 0 ; func end
ret
.dbend
.dbfunc e stop _stop fV
.even
_stop::
.dbline -1
.dbline 144
;
;
;
.dbline 145
;
ldi R24,255
out 0x12,R24
.dbline 146
;
out 0x1b,R24
.dbline -2
.dbline 147
;
L16:
.dbline 0 ; func end
ret
.dbend
.dbfunc e sw_touch _sw_touch fV
.even
_sw_touch::
.dbline -1
.dbline 163
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
.dbline 164
;
in R24,0x13
andi R24,16
sts _sw_in,R24
.dbline 165
;
tst R24
brne L18
.dbline 166
;
.dbline 167
;
rcall _backward
.dbline 168
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 170
;
;
lds R24,_work_status
cpi R24,112
brne L20
.dbline 171
;
.dbline 172
;
rcall _stop
rjmp L23
L22:
.dbline 174
.dbline 175
ldi R24,85
out 0x1b,R24
.dbline 176
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 177
ldi R24,170
out 0x1b,R24
.dbline 178
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 179
L23:
.dbline 173
;
rjmp L22
X1:
.dbline 180
;
;
;
;
;
;
;
L20:
.dbline 182
;
;
rcall _turn_left
.dbline 183
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 184
;
L18:
.dbline 186
;
;
in R24,0x16
andi R24,112
sts _sw_in,R24
.dbline 187
;
cpi R24,80
brne L25
.dbline 188
;
.dbline 189
;
rcall _forward
.dbline 190
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 192
;
;
rcall _turn_left
.dbline 193
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 194
;
L25:
.dbline 195
;
lds R24,_sw_in
cpi R24,48
brne L27
.dbline 196
;
.dbline 197
;
rcall _backward
.dbline 198
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 200
;
;
rcall _turn_left
.dbline 201
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 202
;
L27:
.dbline 203
;
lds R24,_sw_in
cpi R24,96
brne L29
.dbline 204
;
.dbline 205
;
rcall _backward
.dbline 206
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 208
;
;
rcall _turn_left
.dbline 209
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 210
;
L29:
.dbline 211
;
lds R24,_sw_in
cpi R24,32
brne L31
.dbline 212
;
.dbline 213
;
rcall _stop
.dbline 214
;
ldi R16,1000
ldi R17,3
rcall _delay_ms
rjmp L34
L33:
.dbline 216
;
;
.dbline 217
;
in R24,0x13
andi R24,16
sts _sw_in,R24
.dbline 218
;
tst R24
brne L36
.dbline 219
;
.dbline 219
rjmp L35
L36:
.dbline 220
;
ldi R24,85
out 0x1b,R24
.dbline 221
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 222
;
ldi R24,170
out 0x1b,R24
.dbline 223
;
ldi R16,250
ldi R17,0
rcall _delay_ms
.dbline 224
;
in R24,0x16
andi R24,15
sts _remote_in,R24
.dbline 225
;
tst R24
breq L38
.dbline 226
;
.dbline 226
rjmp L35
L38:
.dbline 227
L34:
.dbline 215
rjmp L33
L35:
.dbline 228
L31:
.dbline -2
.dbline 229
;
;
;
L17:
.dbline 0 ; func end
ret
.dbend
.dbfunc e mic_startup _mic_startup fV
.even
_mic_startup::
.dbline -1
.dbline 232
;
;
;
rjmp L42
L41:
.dbline 235
;
;
;
.dbline 236
;
in R24,0x13
andi R24,8
sts _mic_in,R24
.dbline 237
;
tst R24
brne L44
.dbline 237
.dbline 237
rjmp L43
L44:
.dbline 238
L42:
.dbline 234
rjmp L41
L43:
.dbline -2
.dbline 239
;
;
L40:
.dbline 0 ; func end
ret
.dbend
.dbfunc e remote_auto_time _remote_auto_time fV
.even
_remote_auto_time::
.dbline -1
.dbline 254
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
.dbline 255
;
in R24,0x16
andi R24,15
sts _remote_in,R24
.dbline 256
;
mov R16,R24
clr R17
cpi R16,0
cpc R16,R17
brne X4
rjmp L48
X4:
X2:
cpi R16,1
ldi R30,0
cpc R17,R30
brne X5
rjmp L59
X5:
cpi R16,2
ldi R30,0
cpc R17,R30
breq L53
cpi R16,4
ldi R30,0
cpc R17,R30
breq L50
cpi R16,8
ldi R30,0
cpc R17,R30
breq L56
rjmp L47
X3:
.dbline 257
;
L50:
.dbline 259
;
;
lds R24,_delay_time2
lds R25,_delay_time2+1
sbiw R24,50
sts _delay_time2+1,R25
sts _delay_time2,R24
.dbline 260
;
cpi R24,50
ldi R30,0
cpc R25,R30
breq X6
rjmp L48
X6:
.dbline 261
;
.dbline 261
ldi R24,100
ldi R25,0
sts _delay_time2+1,R25
sts _delay_time2,R24
.dbline 261
.dbline 262
;
rjmp L48
L53:
.dbline 264
;
;
lds R24,_delay_time1
lds R25,_delay_time1+1
adiw R24,50
sts _delay_time1+1,R25
sts _delay_time1,R24
.dbline 265
;
cpi R24,2
ldi R30,8
cpc R25,R30
brne L48
.dbline 266
;
.dbline 266
ldi R24,2000
ldi R25,7
sts _delay_time1+1,R25
sts _delay_time1,R24
.dbline 266
.dbline 267
;
rjmp L48
L56:
.dbline 269
;
;
lds R24,_delay_time1
lds R25,_delay_time1+1
sbiw R24,50
sts _delay_time1+1,R25
sts _delay_time1,R24
.dbline 270
;
cpi R24,50
ldi R30,0
cpc R25,R30
brne L48
.dbline 271
;
.dbline 271
ldi R24,100
ldi R25,0
sts _delay_time1+1,R25
sts _delay_time1,R24
.dbline 271
.dbline 272
;
rjmp L48
L59:
.dbline 274
;
;
lds R24,_delay_time2
lds R25,_delay_time2+1
adiw R24,50
sts _delay_time2+1,R25
sts _delay_time2,R24
.dbline 275
;
cpi R24,2
ldi R30,8
cpc R25,R30
brne L48
.dbline 276
;
.dbline 276
ldi R24,2000
ldi R25,7
sts _delay_time2+1,R25
sts _delay_time2,R24
.dbline 276
.dbline 277
;
.dbline 279
;
;
L47:
L48:
.dbline -2
.dbline 281
;
;
L46:
.dbline 0 ; func end
ret
.dbend
.dbfile E:\icc\iccavr\sl3010\test_remote\test_remote.c
.dbfunc e init_devices _init_devices fV
.even
_init_devices::
.dbline -1
.dbline 20
.dbline 22
cli
.dbline 23
rcall _port_init
.dbline 25
clr R2
out 0x35,R2
.dbline 26
out 0x3b,R2
.dbline 27
out 0x39,R2
.dbline 28
sei
.dbline -2
.dbline 30
L63:
.dbline 0 ; func end
ret
.dbend
.dbfunc e main _main fV
.even
_main::
.dbline -1
.dbline 34
.dbline 35
rcall _init_devices
rjmp L66
L65:
.dbline 37
.dbline 38
in R24,0x16
andi R24,240
sts _remote,R24
.dbline 39
mov R2,R24
com R2
out 0x1b,R2
.dbline 40
L66:
.dbline 36
rjmp L65
X7:
.dbline -2
.dbline 41
L64:
.dbline 0 ; func end
ret
.dbend
.area bss(ram, con, rel)
.dbfile E:\icc\iccavr\sl3010\test_remote\test_remote.c
_remote::
.blkb 1
.dbsym e remote _remote c
_delay_time2::
.blkb 2
.dbfile e:/ICC/include/sl3010.c
.dbsym e delay_time2 _delay_time2 i
_delay_time1::
.blkb 2
.dbsym e delay_time1 _delay_time1 i
_mic_in::
.blkb 1
.dbsym e mic_in _mic_in c
_remote_in::
.blkb 1
.dbsym e remote_in _remote_in c
_sw_in::
.blkb 1
.dbsym e sw_in _sw_in c
_work_status::
.blkb 1
.dbsym e work_status _work_status c