Subversion Repositories svnkaklik

Rev

Rev 410 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 410 Rev 484
Line 1... Line 1...
1
GAS LISTING /tmp/ccCMjSjd.s 			page 1
1
GAS LISTING /tmp/ccowxWMg.s 			page 1
2
 
2
 
3
 
3
 
4
   1               	# 1 "CamInterfaceAsm.S"
4
   1               	# 1 "CamInterfaceAsm.S"
5
   2               	# 1 "<built-in>"
5
   2               	# 1 "<built-in>"
6
   1               	;
6
   1               	;
Line 56... Line 56...
56
  49               	;                              interrupts, and caused problems.  Now,
56
  49               	;                              interrupts, and caused problems.  Now,
57
  50               	;                              the "PCLK" pipe feeds timer1 when needed,
57
  50               	;                              the "PCLK" pipe feeds timer1 when needed,
58
  51               	;                              and is turned off when it isn't needed.
58
  51               	;                              and is turned off when it isn't needed.
59
  52               	
59
  52               	
60
  53               	#include <avr/io.h>
60
  53               	#include <avr/io.h>
61
GAS LISTING /tmp/ccCMjSjd.s 			page 2
61
GAS LISTING /tmp/ccowxWMg.s 			page 2
62
 
62
 
63
 
63
 
64
   1               	/* Copyright (c) 2002,2003,2005,2006, Marek Michalkiewicz, Joerg Wunsch
64
   1               	/* Copyright (c) 2002,2003,2005,2006, Marek Michalkiewicz, Joerg Wunsch
65
   2               	   All rights reserved.
65
   2               	   All rights reserved.
66
   3               	
66
   3               	
Line 89... Line 89...
89
  26               	  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
89
  26               	  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
90
  27               	  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
90
  27               	  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
91
  28               	  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
91
  28               	  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
92
  29               	  POSSIBILITY OF SUCH DAMAGE. */
92
  29               	  POSSIBILITY OF SUCH DAMAGE. */
93
  30               	
93
  30               	
94
  31               	/* $Id: io.h,v 1.24.2.7 2006/04/19 16:53:25 aesok Exp $ */
94
  31               	/* $Id: io.h,v 1.24.2.9 2006/09/13 20:41:41 arcanum Exp $ */
95
  32               	
95
  32               	
96
  33               	/** \defgroup avr_io <avr/io.h>: AVR device-specific IO definitions
96
  33               	/** \defgroup avr_io <avr/io.h>: AVR device-specific IO definitions
97
  34               	    \code #include <avr/io.h> \endcode
97
  34               	    \code #include <avr/io.h> \endcode
98
  35               	
98
  35               	
99
  36               	    This header file includes the apropriate IO definitions for the
99
  36               	    This header file includes the apropriate IO definitions for the
Line 116... Line 116...
116
  53               	
116
  53               	
117
  54               	    Also included are the specific names useable for interrupt
117
  54               	    Also included are the specific names useable for interrupt
118
  55               	    function definitions as documented
118
  55               	    function definitions as documented
119
  56               	    \ref avr_signames "here".
119
  56               	    \ref avr_signames "here".
120
  57               	
120
  57               	
121
GAS LISTING /tmp/ccCMjSjd.s 			page 3
121
GAS LISTING /tmp/ccowxWMg.s 			page 3
122
 
122
 
123
 
123
 
124
  58               	    Finally, the following macros are defined:
124
  58               	    Finally, the following macros are defined:
125
  59               	
125
  59               	
126
  60               	    - \b RAMEND
126
  60               	    - \b RAMEND
Line 176... Line 176...
176
  24               	   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
176
  24               	   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
177
  25               	   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
177
  25               	   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
178
  26               	   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
178
  26               	   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
179
  27               	   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
179
  27               	   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
180
  28               	   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
180
  28               	   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
181
GAS LISTING /tmp/ccCMjSjd.s 			page 4
181
GAS LISTING /tmp/ccowxWMg.s 			page 4
182
 
182
 
183
 
183
 
184
  29               	   POSSIBILITY OF SUCH DAMAGE.  */
184
  29               	   POSSIBILITY OF SUCH DAMAGE.  */
185
  30               	
185
  30               	
186
  31               	/* avr/sfr_defs.h - macros for accessing AVR special function registers */
186
  31               	/* avr/sfr_defs.h - macros for accessing AVR special function registers */
187
  32               	
187
  32               	
188
  33               	/* $Id: sfr_defs.h,v 1.16 2005/09/10 21:31:13 joerg_wunsch Exp $ */
188
  33               	/* $Id: sfr_defs.h,v 1.16.2.2 2006/05/17 08:25:10 joerg_wunsch Exp $ */
189
  34               	
189
  34               	
190
  35               	#ifndef _AVR_SFR_DEFS_H_
190
  35               	#ifndef _AVR_SFR_DEFS_H_
191
  36               	#define _AVR_SFR_DEFS_H_ 1
191
  36               	#define _AVR_SFR_DEFS_H_ 1
192
  37               	
192
  37               	
193
  38               	/** \defgroup avr_sfr_notes Additional notes from <avr/sfr_defs.h>
193
  38               	/** \defgroup avr_sfr_notes Additional notes from <avr/sfr_defs.h>
194
  39               	    \ingroup avr_sfr
194
  39               	    \ingroup avr_sfr
195
  40               	
195
  40               	
196
  41               	   The \c <avr/sfr_defs.h> file is included by all of the \c <avr/ioXXXX.h>
196
  41               	   The \c <avr/sfr_defs.h> file is included by all of the \c <avr/ioXXXX.h>
197
  42               	   files, which use macros defined here to make the special function register
197
  42               	   files, which use macros defined here to make the special function register
198
  43               	   definitions look like C variables or simple constants, depending on the
198
  43               	   definitions look like C variables or simple constants, depending on the
199
  44               	   <tt>_SFR_ASM_COMPAT</tt> define.  Some examples from \c <avr/iom128.h> to
199
  44               	   <tt>_SFR_ASM_COMPAT</tt> define.  Some examples from \c <avr/iocanxx.h> to
200
  45               	   show how to define such macros:
200
  45               	   show how to define such macros:
201
  46               	
201
  46               	
202
  47               	\code
202
  47               	\code
203
  48               	#define PORTA _SFR_IO8(0x1b)
203
  48               	#define PORTA   _SFR_IO8(0x02)
204
  49               	#define TCNT1 _SFR_IO16(0x2c)
204
  49               	#define EEAR    _SFR_IO16(0x21)
205
  50               	#define PORTF _SFR_MEM8(0x61)
205
  50               	#define UDR0    _SFR_MEM8(0xC6)
206
  51               	#define TCNT3 _SFR_MEM16(0x88)
206
  51               	#define TCNT3   _SFR_MEM16(0x94)
-
 
207
  52               	#define CANIDT  _SFR_MEM32(0xF0)
207
  52               	\endcode
208
  53               	\endcode
208
  53               	
209
  54               	
209
  54               	   If \c _SFR_ASM_COMPAT is not defined, C programs can use names like
210
  55               	   If \c _SFR_ASM_COMPAT is not defined, C programs can use names like
210
  55               	   <tt>PORTA</tt> directly in C expressions (also on the left side of
211
  56               	   <tt>PORTA</tt> directly in C expressions (also on the left side of
211
  56               	   assignment operators) and GCC will do the right thing (use short I/O
212
  57               	   assignment operators) and GCC will do the right thing (use short I/O
212
  57               	   instructions if possible).  The \c __SFR_OFFSET definition is not used in
213
  58               	   instructions if possible).  The \c __SFR_OFFSET definition is not used in
213
  58               	   any way in this case.
214
  59               	   any way in this case.
214
  59               	
215
  60               	
215
  60               	   Define \c _SFR_ASM_COMPAT as 1 to make these names work as simple constants
216
  61               	   Define \c _SFR_ASM_COMPAT as 1 to make these names work as simple constants
216
  61               	   (addresses of the I/O registers).  This is necessary when included in
217
  62               	   (addresses of the I/O registers).  This is necessary when included in
217
  62               	   preprocessed assembler (*.S) source files, so it is done automatically if
218
  63               	   preprocessed assembler (*.S) source files, so it is done automatically if
218
  63               	   \c __ASSEMBLER__ is defined.  By default, all addresses are defined as if
219
  64               	   \c __ASSEMBLER__ is defined.  By default, all addresses are defined as if
219
  64               	   they were memory addresses (used in \c lds/sts instructions).  To use these
220
  65               	   they were memory addresses (used in \c lds/sts instructions).  To use these
220
  65               	   addresses in \c in/out instructions, you must subtract 0x20 from them.
221
  66               	   addresses in \c in/out instructions, you must subtract 0x20 from them.
221
  66               	
222
  67               	
222
  67               	   For more backwards compatibility, insert the following at the start of your
223
  68               	   For more backwards compatibility, insert the following at the start of your
223
  68               	   old assembler source file:
224
  69               	   old assembler source file:
224
  69               	
225
  70               	
225
  70               	\code
226
  71               	\code
226
  71               	#define __SFR_OFFSET 0
227
  72               	#define __SFR_OFFSET 0
227
  72               	\endcode
228
  73               	\endcode
228
  73               	
229
  74               	
229
  74               	   This automatically subtracts 0x20 from I/O space addresses, but it's a
230
  75               	   This automatically subtracts 0x20 from I/O space addresses, but it's a
230
  75               	   hack, so it is recommended to change your source: wrap such addresses in
231
  76               	   hack, so it is recommended to change your source: wrap such addresses in
231
  76               	   macros defined here, as shown below.  After this is done, the
232
  77               	   macros defined here, as shown below.  After this is done, the
232
  77               	   <tt>__SFR_OFFSET</tt> definition is no longer necessary and can be removed.
233
  78               	   <tt>__SFR_OFFSET</tt> definition is no longer necessary and can be removed.
233
  78               	
234
  79               	
234
  79               	   Real example - this code could be used in a boot loader that is portable
235
  80               	   Real example - this code could be used in a boot loader that is portable
235
  80               	   between devices with \c SPMCR at different addresses.
236
  81               	   between devices with \c SPMCR at different addresses.
236
  81               	
237
  82               	
237
  82               	\verbatim
238
  83               	\verbatim
238
  83               	<avr/iom163.h>: #define SPMCR _SFR_IO8(0x37)
239
  84               	<avr/iom163.h>: #define SPMCR _SFR_IO8(0x37)
239
  84               	<avr/iom128.h>: #define SPMCR _SFR_MEM8(0x68)
240
  85               	<avr/iom128.h>: #define SPMCR _SFR_MEM8(0x68)
240
  85               	\endverbatim
-
 
241
GAS LISTING /tmp/ccCMjSjd.s 			page 5
241
GAS LISTING /tmp/ccowxWMg.s 			page 5
242
 
242
 
243
 
243
 
244
  86               	
244
  86               	\endverbatim
245
  87               	\code
245
  87               	
246
  87               	
246
  87               	
247
  88               	#ifndef __AVR_HAVE_MOVW__
247
  88               	#ifndef __AVR_HAVE_MOVW__
248
  89               	#  if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
248
  89               	#  if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
249
  90               	#   define __AVR_HAVE_MOVW__ 1
249
  90               	#   define __AVR_HAVE_MOVW__ 1
250
  91               	#  endif
250
  91               	#  endif
Line 296... Line 296...
296
 137               	#define    XL           r26
296
 137               	#define    XL           r26
297
 138               	#define    XH           r27
297
 138               	#define    XH           r27
298
 139               	#define    YL           r28
298
 139               	#define    YL           r28
299
 140               	#define    YH           r29
299
 140               	#define    YH           r29
300
 141               	#endif /* #if __AVR_ARCH__ != 1 */
300
 141               	#endif /* #if __AVR_ARCH__ != 1 */
301
GAS LISTING /tmp/ccCMjSjd.s 			page 6
301
GAS LISTING /tmp/ccowxWMg.s 			page 6
302
 
302
 
303
 
303
 
304
 142               	#define    ZL           r30
304
 142               	#define    ZL           r30
305
 143               	#define    ZH           r31
305
 143               	#define    ZH           r31
306
 144               	
306
 144               	
Line 348... Line 348...
348
 186               	#  include <avr/iom128.h>
348
 186               	#  include <avr/iom128.h>
349
 187               	#elif defined (__AVR_ATmega1280__)
349
 187               	#elif defined (__AVR_ATmega1280__)
350
 188               	#  include <avr/iom1280.h>
350
 188               	#  include <avr/iom1280.h>
351
 189               	#elif defined (__AVR_ATmega1281__)
351
 189               	#elif defined (__AVR_ATmega1281__)
352
 190               	#  include <avr/iom1281.h>
352
 190               	#  include <avr/iom1281.h>
353
 191               	#elif defined (__AVR_AT90CAN32__)
353
 191               	#elif defined (__AVR_ATmega2560__)
354
 192               	#  include <avr/iocan32.h>
354
 192               	#  include <avr/iom2560.h>
355
 193               	#elif defined (__AVR_AT90CAN64__)
355
 193               	#elif defined (__AVR_ATmega2561__)
356
 194               	#  include <avr/iocan64.h>
356
 194               	#  include <avr/iom2561.h>
357
 195               	#elif defined (__AVR_AT90CAN128__)
357
 195               	#elif defined (__AVR_AT90CAN32__)
358
 196               	#  include <avr/iocan128.h>
358
 196               	#  include <avr/iocan32.h>
359
 197               	#elif defined (__AVR_AT90USB646__)
359
 197               	#elif defined (__AVR_AT90CAN64__)
360
 198               	#  include <avr/iousb646.h>
360
 198               	#  include <avr/iocan64.h>
361
GAS LISTING /tmp/ccCMjSjd.s 			page 7
361
GAS LISTING /tmp/ccowxWMg.s 			page 7
362
 
362
 
363
 
363
 
364
 199               	#elif defined (__AVR_AT90USB647__)
364
 199               	#elif defined (__AVR_AT90CAN128__)
365
 200               	#  include <avr/iousb647.h>
365
 200               	#  include <avr/iocan128.h>
366
 201               	#elif defined (__AVR_AT90USB1286__)
366
 201               	#elif defined (__AVR_AT90USB646__)
367
 202               	#  include <avr/iousb1286.h>
367
 202               	#  include <avr/iousb646.h>
368
 203               	#elif defined (__AVR_AT90USB1287__)
368
 203               	#elif defined (__AVR_AT90USB647__)
369
 204               	#  include <avr/iousb1287.h>
369
 204               	#  include <avr/iousb647.h>
370
 205               	#elif defined (__AVR_ATmega64__)
370
 205               	#elif defined (__AVR_AT90USB1286__)
371
 206               	#  include <avr/iom64.h>
371
 206               	#  include <avr/iousb1286.h>
372
 207               	#elif defined (__AVR_ATmega640__)
372
 207               	#elif defined (__AVR_AT90USB1287__)
373
 208               	#  include <avr/iom640.h>
373
 208               	#  include <avr/iousb1287.h>
374
 209               	#elif defined (__AVR_ATmega644__)
374
 209               	#elif defined (__AVR_ATmega64__)
375
 210               	#  include <avr/iom644.h>
375
 210               	#  include <avr/iom64.h>
376
 211               	#elif defined (__AVR_ATmega644P__)
376
 211               	#elif defined (__AVR_ATmega640__)
377
 212               	#  include <avr/iom644.h>
377
 212               	#  include <avr/iom640.h>
378
 213               	#elif defined (__AVR_ATmega645__)
378
 213               	#elif defined (__AVR_ATmega644__)
379
 214               	#  include <avr/iom645.h>
379
 214               	#  include <avr/iom644.h>
380
 215               	#elif defined (__AVR_ATmega6450__)
380
 215               	#elif defined (__AVR_ATmega644P__)
381
 216               	#  include <avr/iom6450.h>
381
 216               	#  include <avr/iom644.h>
382
 217               	#elif defined (__AVR_ATmega649__)
382
 217               	#elif defined (__AVR_ATmega645__)
383
 218               	#  include <avr/iom649.h>
383
 218               	#  include <avr/iom645.h>
384
 219               	#elif defined (__AVR_ATmega6490__)
384
 219               	#elif defined (__AVR_ATmega6450__)
385
 220               	#  include <avr/iom6490.h>
385
 220               	#  include <avr/iom6450.h>
386
 221               	#elif defined (__AVR_ATmega103__)
386
 221               	#elif defined (__AVR_ATmega649__)
387
 222               	#  include <avr/iom103.h>
387
 222               	#  include <avr/iom649.h>
388
 223               	#elif defined (__AVR_ATmega32__)
388
 223               	#elif defined (__AVR_ATmega6490__)
389
 224               	#  include <avr/iom32.h>
389
 224               	#  include <avr/iom6490.h>
390
 225               	#elif defined (__AVR_ATmega323__)
390
 225               	#elif defined (__AVR_ATmega103__)
391
 226               	#  include <avr/iom323.h>
391
 226               	#  include <avr/iom103.h>
392
 227               	#elif defined (__AVR_ATmega324P__)
392
 227               	#elif defined (__AVR_ATmega32__)
393
 228               	#  include <avr/iom324.h>
393
 228               	#  include <avr/iom32.h>
394
 229               	#elif defined (__AVR_ATmega325__)
394
 229               	#elif defined (__AVR_ATmega323__)
395
 230               	#  include <avr/iom325.h>
395
 230               	#  include <avr/iom323.h>
396
 231               	#elif defined (__AVR_ATmega3250__)
396
 231               	#elif defined (__AVR_ATmega324P__)
397
 232               	#  include <avr/iom3250.h>
397
 232               	#  include <avr/iom324.h>
398
 233               	#elif defined (__AVR_ATmega329__)
398
 233               	#elif defined (__AVR_ATmega325__)
399
 234               	#  include <avr/iom329.h>
399
 234               	#  include <avr/iom325.h>
400
 235               	#elif defined (__AVR_ATmega3290__)
400
 235               	#elif defined (__AVR_ATmega3250__)
401
 236               	#  include <avr/iom3290.h>
401
 236               	#  include <avr/iom3250.h>
402
 237               	#elif defined (__AVR_ATmega406__)
402
 237               	#elif defined (__AVR_ATmega329__)
403
 238               	#  include <avr/iom406.h>
403
 238               	#  include <avr/iom329.h>
404
 239               	#elif defined (__AVR_ATmega16__)
404
 239               	#elif defined (__AVR_ATmega3290__)
405
 240               	#  include <avr/iom16.h>
405
 240               	#  include <avr/iom3290.h>
406
 241               	#elif defined (__AVR_ATmega161__)
406
 241               	#elif defined (__AVR_ATmega406__)
407
 242               	#  include <avr/iom161.h>
407
 242               	#  include <avr/iom406.h>
408
 243               	#elif defined (__AVR_ATmega162__)
408
 243               	#elif defined (__AVR_ATmega16__)
409
 244               	#  include <avr/iom162.h>
409
 244               	#  include <avr/iom16.h>
410
 245               	#elif defined (__AVR_ATmega163__)
410
 245               	#elif defined (__AVR_ATmega161__)
411
 246               	#  include <avr/iom163.h>
411
 246               	#  include <avr/iom161.h>
412
 247               	#elif defined (__AVR_ATmega164P__)
412
 247               	#elif defined (__AVR_ATmega162__)
413
 248               	#  include <avr/iom164.h>
413
 248               	#  include <avr/iom162.h>
414
 249               	#elif defined (__AVR_ATmega165__)
414
 249               	#elif defined (__AVR_ATmega163__)
415
 250               	#  include <avr/iom165.h>
415
 250               	#  include <avr/iom163.h>
416
 251               	#elif defined (__AVR_ATmega168__)
416
 251               	#elif defined (__AVR_ATmega164P__)
417
 252               	#  include <avr/iom168.h>
417
 252               	#  include <avr/iom164.h>
418
 253               	#elif defined (__AVR_ATmega169__)
418
 253               	#elif defined (__AVR_ATmega165__)
419
 254               	#  include <avr/iom169.h>
419
 254               	#  include <avr/iom165.h>
420
 255               	#elif defined (__AVR_ATmega8__)
420
 255               	#elif defined (__AVR_ATmega165P__)
421
GAS LISTING /tmp/ccCMjSjd.s 			page 8
421
GAS LISTING /tmp/ccowxWMg.s 			page 8
422
 
422
 
423
 
423
 
-
 
424
 256               	#  include <avr/iom165p.h>
-
 
425
 257               	#elif defined (__AVR_ATmega168__)
-
 
426
 258               	#  include <avr/iom168.h>
-
 
427
 259               	#elif defined (__AVR_ATmega169__)
-
 
428
 260               	#  include <avr/iom169.h>
-
 
429
 261               	#elif defined (__AVR_ATmega169P__)
-
 
430
 262               	#  include <avr/iom169p.h>
-
 
431
 263               	#elif defined (__AVR_ATmega8__)
424
 256               	#  include <avr/iom8.h>
432
 264               	#  include <avr/iom8.h>
425
   1               	/* Copyright (c) 2002, Marek Michalkiewicz
433
   1               	/* Copyright (c) 2002, Marek Michalkiewicz
426
   2               	   All rights reserved.
434
   2               	   All rights reserved.
427
   3               	
435
   3               	
428
   4               	   Redistribution and use in source and binary forms, with or without
436
   4               	   Redistribution and use in source and binary forms, with or without
429
   5               	   modification, are permitted provided that the following conditions are met:
437
   5               	   modification, are permitted provided that the following conditions are met:
Line 468... Line 476...
468
  44               	#ifndef _AVR_IOXXX_H_
476
  44               	#ifndef _AVR_IOXXX_H_
469
  45               	#  define _AVR_IOXXX_H_ "iom8.h"
477
  45               	#  define _AVR_IOXXX_H_ "iom8.h"
470
  46               	#else
478
  46               	#else
471
  47               	#  error "Attempt to include more than one <avr/ioXXX.h> file."
479
  47               	#  error "Attempt to include more than one <avr/ioXXX.h> file."
472
  48               	#endif 
480
  48               	#endif 
-
 
481
GAS LISTING /tmp/ccowxWMg.s 			page 9
-
 
482
 
-
 
483
 
473
  49               	
484
  49               	
474
  50               	/* I/O registers */
485
  50               	/* I/O registers */
475
  51               	
486
  51               	
476
  52               	/* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */
487
  52               	/* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */
477
  53               	#define TWBR	_SFR_IO8(0x00)
488
  53               	#define TWBR	_SFR_IO8(0x00)
478
  54               	#define TWSR	_SFR_IO8(0x01)
489
  54               	#define TWSR	_SFR_IO8(0x01)
479
  55               	#define TWAR	_SFR_IO8(0x02)
490
  55               	#define TWAR	_SFR_IO8(0x02)
480
  56               	#define TWDR	_SFR_IO8(0x03)
491
  56               	#define TWDR	_SFR_IO8(0x03)
481
GAS LISTING /tmp/ccCMjSjd.s 			page 9
-
 
482
 
-
 
483
 
-
 
484
  57               	
492
  57               	
485
  58               	/* ADC */
493
  58               	/* ADC */
486
  59               	#define ADCW	_SFR_IO16(0x04)
494
  59               	#define ADCW	_SFR_IO16(0x04)
487
  60               	#ifndef __ASSEMBLER__
495
  60               	#ifndef __ASSEMBLER__
488
  61               	#define ADC	_SFR_IO16(0x04)
496
  61               	#define ADC	_SFR_IO16(0x04)
Line 528... Line 536...
528
 101               	/* EEPROM Data Register */
536
 101               	/* EEPROM Data Register */
529
 102               	#define EEDR	_SFR_IO8(0x1D)
537
 102               	#define EEDR	_SFR_IO8(0x1D)
530
 103               	
538
 103               	
531
 104               	/* EEPROM Address Register */
539
 104               	/* EEPROM Address Register */
532
 105               	#define EEAR	_SFR_IO16(0x1E)
540
 105               	#define EEAR	_SFR_IO16(0x1E)
-
 
541
GAS LISTING /tmp/ccowxWMg.s 			page 10
-
 
542
 
-
 
543
 
533
 106               	#define EEARL	_SFR_IO8(0x1E)
544
 106               	#define EEARL	_SFR_IO8(0x1E)
534
 107               	#define EEARH	_SFR_IO8(0x1F)
545
 107               	#define EEARH	_SFR_IO8(0x1F)
535
 108               	
546
 108               	
536
 109               	#define UCSRC	_SFR_IO8(0x20)
547
 109               	#define UCSRC	_SFR_IO8(0x20)
537
 110               	#define UBRRH	_SFR_IO8(0x20)
548
 110               	#define UBRRH	_SFR_IO8(0x20)
538
 111               	
549
 111               	
539
 112               	#define WDTCR	_SFR_IO8(0x21)
550
 112               	#define WDTCR	_SFR_IO8(0x21)
540
 113               	#define ASSR	_SFR_IO8(0x22)
551
 113               	#define ASSR	_SFR_IO8(0x22)
541
GAS LISTING /tmp/ccCMjSjd.s 			page 10
-
 
542
 
-
 
543
 
-
 
544
 114               	
552
 114               	
545
 115               	/* Timer 2 */
553
 115               	/* Timer 2 */
546
 116               	#define OCR2	_SFR_IO8(0x23)
554
 116               	#define OCR2	_SFR_IO8(0x23)
547
 117               	#define TCNT2	_SFR_IO8(0x24)
555
 117               	#define TCNT2	_SFR_IO8(0x24)
548
 118               	#define TCCR2	_SFR_IO8(0x25)
556
 118               	#define TCCR2	_SFR_IO8(0x25)
Line 588... Line 596...
588
 158               	/* 0x3C reserved (OCR0?) */
596
 158               	/* 0x3C reserved (OCR0?) */
589
 159               	
597
 159               	
590
 160               	/* 0x3D..0x3E SP */
598
 160               	/* 0x3D..0x3E SP */
591
 161               	
599
 161               	
592
 162               	/* 0x3F SREG */
600
 162               	/* 0x3F SREG */
-
 
601
GAS LISTING /tmp/ccowxWMg.s 			page 11
-
 
602
 
-
 
603
 
593
 163               	
604
 163               	
594
 164               	/* Interrupt vectors */
605
 164               	/* Interrupt vectors */
595
 165               	
606
 165               	
596
 166               	/* External Interrupt Request 0 */
607
 166               	/* External Interrupt Request 0 */
597
 167               	#define INT0_vect			_VECTOR(1)
608
 167               	#define INT0_vect			_VECTOR(1)
598
 168               	#define SIG_INTERRUPT0			_VECTOR(1)
609
 168               	#define SIG_INTERRUPT0			_VECTOR(1)
599
 169               	
610
 169               	
600
 170               	/* External Interrupt Request 1 */
611
 170               	/* External Interrupt Request 1 */
601
GAS LISTING /tmp/ccCMjSjd.s 			page 11
-
 
602
 
-
 
603
 
-
 
604
 171               	#define INT1_vect			_VECTOR(2)
612
 171               	#define INT1_vect			_VECTOR(2)
605
 172               	#define SIG_INTERRUPT1			_VECTOR(2)
613
 172               	#define SIG_INTERRUPT1			_VECTOR(2)
606
 173               	
614
 173               	
607
 174               	/* Timer/Counter2 Compare Match */
615
 174               	/* Timer/Counter2 Compare Match */
608
 175               	#define TIMER2_COMP_vect		_VECTOR(3)
616
 175               	#define TIMER2_COMP_vect		_VECTOR(3)
Line 648... Line 656...
648
 215               	#define USART_TXC_vect			_VECTOR(13)
656
 215               	#define USART_TXC_vect			_VECTOR(13)
649
 216               	#define SIG_UART_TRANS			_VECTOR(13)
657
 216               	#define SIG_UART_TRANS			_VECTOR(13)
650
 217               	
658
 217               	
651
 218               	/* ADC Conversion Complete */
659
 218               	/* ADC Conversion Complete */
652
 219               	#define ADC_vect			_VECTOR(14)
660
 219               	#define ADC_vect			_VECTOR(14)
-
 
661
GAS LISTING /tmp/ccowxWMg.s 			page 12
-
 
662
 
-
 
663
 
653
 220               	#define SIG_ADC				_VECTOR(14)
664
 220               	#define SIG_ADC				_VECTOR(14)
654
 221               	
665
 221               	
655
 222               	/* EEPROM Ready */
666
 222               	/* EEPROM Ready */
656
 223               	#define EE_RDY_vect			_VECTOR(15)
667
 223               	#define EE_RDY_vect			_VECTOR(15)
657
 224               	#define SIG_EEPROM_READY		_VECTOR(15)
668
 224               	#define SIG_EEPROM_READY		_VECTOR(15)
658
 225               	
669
 225               	
659
 226               	/* Analog Comparator */
670
 226               	/* Analog Comparator */
660
 227               	#define ANA_COMP_vect			_VECTOR(16)
671
 227               	#define ANA_COMP_vect			_VECTOR(16)
661
GAS LISTING /tmp/ccCMjSjd.s 			page 12
-
 
662
 
-
 
663
 
-
 
664
 228               	#define SIG_COMPARATOR			_VECTOR(16)
672
 228               	#define SIG_COMPARATOR			_VECTOR(16)
665
 229               	
673
 229               	
666
 230               	/* 2-wire Serial Interface */
674
 230               	/* 2-wire Serial Interface */
667
 231               	#define TWI_vect			_VECTOR(17)
675
 231               	#define TWI_vect			_VECTOR(17)
668
 232               	#define SIG_2WIRE_SERIAL		_VECTOR(17)
676
 232               	#define SIG_2WIRE_SERIAL		_VECTOR(17)
Line 689... Line 697...
689
 253               	#define OCIE2	7
697
 253               	#define OCIE2	7
690
 254               	#define TOIE2	6
698
 254               	#define TOIE2	6
691
 255               	#define TICIE1	5
699
 255               	#define TICIE1	5
692
 256               	#define OCIE1A	4
700
 256               	#define OCIE1A	4
693
 257               	#define OCIE1B	3
701
 257               	#define OCIE1B	3
-
 
702
 258               	#define TOIE1	2
-
 
703
 259               	/* bit 1 reserved (OCIE0?) */
-
 
704
 260               	#define TOIE0	0
-
 
705
 261               	
-
 
706
 262               	/* TIFR */
-
 
707
 263               	#define OCF2	7
-
 
708
 264               	#define TOV2	6
-
 
709
 265               	#define ICF1	5
694
 257               	#elif defined (__AVR_ATmega48__)
710
 265               	#elif defined (__AVR_ATmega48__)
695
 258               	#  include <avr/iom48.h>
711
 266               	#  include <avr/iom48.h>
696
 259               	#elif defined (__AVR_ATmega88__)
712
 267               	#elif defined (__AVR_ATmega88__)
697
 260               	#  include <avr/iom88.h>
713
 268               	#  include <avr/iom88.h>
698
 261               	#elif defined (__AVR_ATmega8515__)
714
 269               	#elif defined (__AVR_ATmega8515__)
699
 262               	#  include <avr/iom8515.h>
715
 270               	#  include <avr/iom8515.h>
700
 263               	#elif defined (__AVR_ATmega8535__)
716
 271               	#elif defined (__AVR_ATmega8535__)
701
 264               	#  include <avr/iom8535.h>
717
 272               	#  include <avr/iom8535.h>
702
 265               	#elif defined (__AVR_AT90S8535__)
718
 273               	#elif defined (__AVR_AT90S8535__)
703
 266               	#  include <avr/io8535.h>
719
 274               	#  include <avr/io8535.h>
704
 267               	#elif defined (__AVR_AT90C8534__)
720
 275               	#elif defined (__AVR_AT90C8534__)
-
 
721
GAS LISTING /tmp/ccowxWMg.s 			page 13
-
 
722
 
-
 
723
 
705
 268               	#  include <avr/io8534.h>
724
 276               	#  include <avr/io8534.h>
706
 269               	#elif defined (__AVR_AT90S8515__)
725
 277               	#elif defined (__AVR_AT90S8515__)
707
 270               	#  include <avr/io8515.h>
726
 278               	#  include <avr/io8515.h>
708
 271               	#elif defined (__AVR_AT90S4434__)
727
 279               	#elif defined (__AVR_AT90S4434__)
709
 272               	#  include <avr/io4434.h>
728
 280               	#  include <avr/io4434.h>
710
 273               	#elif defined (__AVR_AT90S4433__)
729
 281               	#elif defined (__AVR_AT90S4433__)
711
 274               	#  include <avr/io4433.h>
730
 282               	#  include <avr/io4433.h>
712
 275               	#elif defined (__AVR_AT90S4414__)
731
 283               	#elif defined (__AVR_AT90S4414__)
713
 276               	#  include <avr/io4414.h>
732
 284               	#  include <avr/io4414.h>
714
 277               	#elif defined (__AVR_ATtiny22__)
733
 285               	#elif defined (__AVR_ATtiny22__)
715
 278               	#  include <avr/iotn22.h>
734
 286               	#  include <avr/iotn22.h>
716
 279               	#elif defined (__AVR_ATtiny26__)
735
 287               	#elif defined (__AVR_ATtiny26__)
717
 280               	#  include <avr/iotn26.h>
736
 288               	#  include <avr/iotn26.h>
718
 281               	#elif defined (__AVR_AT90S2343__)
737
 289               	#elif defined (__AVR_AT90S2343__)
719
 282               	#  include <avr/io2343.h>
738
 290               	#  include <avr/io2343.h>
720
 283               	#elif defined (__AVR_AT90S2333__)
739
 291               	#elif defined (__AVR_AT90S2333__)
721
GAS LISTING /tmp/ccCMjSjd.s 			page 13
-
 
722
 
-
 
723
 
-
 
724
 284               	#  include <avr/io2333.h>
740
 292               	#  include <avr/io2333.h>
725
 285               	#elif defined (__AVR_AT90S2323__)
741
 293               	#elif defined (__AVR_AT90S2323__)
726
 286               	#  include <avr/io2323.h>
742
 294               	#  include <avr/io2323.h>
727
 287               	#elif defined (__AVR_AT90S2313__)
743
 295               	#elif defined (__AVR_AT90S2313__)
728
 288               	#  include <avr/io2313.h>
744
 296               	#  include <avr/io2313.h>
729
 289               	#elif defined (__AVR_ATtiny2313__)
745
 297               	#elif defined (__AVR_ATtiny2313__)
730
 290               	#  include <avr/iotn2313.h>
746
 298               	#  include <avr/iotn2313.h>
731
 291               	#elif defined (__AVR_ATtiny13__)
747
 299               	#elif defined (__AVR_ATtiny13__)
732
 292               	#  include <avr/iotn13.h>
748
 300               	#  include <avr/iotn13.h>
733
 293               	#elif defined (__AVR_ATtiny25__)
749
 301               	#elif defined (__AVR_ATtiny25__)
734
 294               	#  include <avr/iotn25.h>
750
 302               	#  include <avr/iotn25.h>
735
 295               	#elif defined (__AVR_ATtiny45__)
751
 303               	#elif defined (__AVR_ATtiny45__)
736
 296               	#  include <avr/iotn45.h>
752
 304               	#  include <avr/iotn45.h>
737
 297               	#elif defined (__AVR_ATtiny85__)
753
 305               	#elif defined (__AVR_ATtiny85__)
738
 298               	#  include <avr/iotn85.h>
754
 306               	#  include <avr/iotn85.h>
739
 299               	#elif defined (__AVR_ATtiny24__)
755
 307               	#elif defined (__AVR_ATtiny24__)
740
 300               	#  include <avr/iotn24.h>
756
 308               	#  include <avr/iotn24.h>
741
 301               	#elif defined (__AVR_ATtiny44__)
757
 309               	#elif defined (__AVR_ATtiny44__)
742
 302               	#  include <avr/iotn44.h>
758
 310               	#  include <avr/iotn44.h>
743
 303               	#elif defined (__AVR_ATtiny84__)
759
 311               	#elif defined (__AVR_ATtiny84__)
744
 304               	#  include <avr/iotn84.h>
760
 312               	#  include <avr/iotn84.h>
745
 305               	#elif defined (__AVR_ATtiny261__)
761
 313               	#elif defined (__AVR_ATtiny261__)
746
 306               	#  include <avr/iotn261.h>
762
 314               	#  include <avr/iotn261.h>
747
 307               	#elif defined (__AVR_ATtiny461__)
763
 315               	#elif defined (__AVR_ATtiny461__)
748
 308               	#  include <avr/iotn461.h>
764
 316               	#  include <avr/iotn461.h>
749
 309               	#elif defined (__AVR_ATtiny861__)
765
 317               	#elif defined (__AVR_ATtiny861__)
750
 310               	#  include <avr/iotn861.h>
766
 318               	#  include <avr/iotn861.h>
751
 311               	/* avr1: the following only supported for assembler programs */
767
 319               	/* avr1: the following only supported for assembler programs */
752
 312               	#elif defined (__AVR_ATtiny28__)
768
 320               	#elif defined (__AVR_ATtiny28__)
753
 313               	#  include <avr/iotn28.h>
769
 321               	#  include <avr/iotn28.h>
754
 314               	#elif defined (__AVR_AT90S1200__)
770
 322               	#elif defined (__AVR_AT90S1200__)
755
 315               	#  include <avr/io1200.h>
771
 323               	#  include <avr/io1200.h>
756
 316               	#elif defined (__AVR_ATtiny15__)
772
 324               	#elif defined (__AVR_ATtiny15__)
757
 317               	#  include <avr/iotn15.h>
773
 325               	#  include <avr/iotn15.h>
758
 318               	#elif defined (__AVR_ATtiny12__)
774
 326               	#elif defined (__AVR_ATtiny12__)
759
 319               	#  include <avr/iotn12.h>
775
 327               	#  include <avr/iotn12.h>
760
 320               	#elif defined (__AVR_ATtiny11__)
776
 328               	#elif defined (__AVR_ATtiny11__)
761
 321               	#  include <avr/iotn11.h>
777
 329               	#  include <avr/iotn11.h>
762
 322               	#else
778
 330               	#else
763
 323               	#  if !defined(__COMPILING_AVR_LIBC__)
779
 331               	#  if !defined(__COMPILING_AVR_LIBC__)
764
 324               	#    warning "device type not defined"
780
 332               	#    warning "device type not defined"
-
 
781
GAS LISTING /tmp/ccowxWMg.s 			page 14
-
 
782
 
-
 
783
 
765
 325               	#  endif
784
 333               	#  endif
766
 326               	#endif
785
 334               	#endif
767
 327               	
786
 335               	
768
 328               	#include <avr/portpins.h>
787
 336               	#include <avr/portpins.h>
769
   1               	/* Copyright (c) 2003  Theodore A. Roth
788
   1               	/* Copyright (c) 2003  Theodore A. Roth
770
   2               	   All rights reserved.
789
   2               	   All rights reserved.
771
   3               	
790
   3               	
772
   4               	   Redistribution and use in source and binary forms, with or without
791
   4               	   Redistribution and use in source and binary forms, with or without
773
   5               	   modification, are permitted provided that the following conditions are met:
792
   5               	   modification, are permitted provided that the following conditions are met:
Line 776... Line 795...
776
   8               	     notice, this list of conditions and the following disclaimer.
795
   8               	     notice, this list of conditions and the following disclaimer.
777
   9               	
796
   9               	
778
  10               	   * Redistributions in binary form must reproduce the above copyright
797
  10               	   * Redistributions in binary form must reproduce the above copyright
779
  11               	     notice, this list of conditions and the following disclaimer in
798
  11               	     notice, this list of conditions and the following disclaimer in
780
  12               	     the documentation and/or other materials provided with the
799
  12               	     the documentation and/or other materials provided with the
781
GAS LISTING /tmp/ccCMjSjd.s 			page 14
-
 
782
 
-
 
783
 
-
 
784
  13               	     distribution.
800
  13               	     distribution.
785
  14               	
801
  14               	
786
  15               	   * Neither the name of the copyright holders nor the names of
802
  15               	   * Neither the name of the copyright holders nor the names of
787
  16               	     contributors may be used to endorse or promote products derived
803
  16               	     contributors may be used to endorse or promote products derived
788
  17               	     from this software without specific prior written permission.
804
  17               	     from this software without specific prior written permission.
Line 820... Line 836...
820
  49               	#define    PORT3        3
836
  49               	#define    PORT3        3
821
  50               	#define    PORT2        2
837
  50               	#define    PORT2        2
822
  51               	#define    PORT1        1
838
  51               	#define    PORT1        1
823
  52               	#define    PORT0        0
839
  52               	#define    PORT0        0
824
  53               	
840
  53               	
-
 
841
GAS LISTING /tmp/ccowxWMg.s 			page 15
-
 
842
 
-
 
843
 
825
  54               	/* Port Data Direction Register (generic) */
844
  54               	/* Port Data Direction Register (generic) */
826
  55               	#define    DD7          7
845
  55               	#define    DD7          7
827
  56               	#define    DD6          6
846
  56               	#define    DD6          6
828
  57               	#define    DD5          5
847
  57               	#define    DD5          5
829
  58               	#define    DD4          4
848
  58               	#define    DD4          4
Line 836... Line 855...
836
  65               	#define    PIN7         7
855
  65               	#define    PIN7         7
837
  66               	#define    PIN6         6
856
  66               	#define    PIN6         6
838
  67               	#define    PIN5         5
857
  67               	#define    PIN5         5
839
  68               	#define    PIN4         4
858
  68               	#define    PIN4         4
840
  69               	#define    PIN3         3
859
  69               	#define    PIN3         3
841
GAS LISTING /tmp/ccCMjSjd.s 			page 15
-
 
842
 
-
 
843
 
-
 
844
  70               	#define    PIN2         2
860
  70               	#define    PIN2         2
845
  71               	#define    PIN1         1
861
  71               	#define    PIN1         1
846
  72               	#define    PIN0         0
862
  72               	#define    PIN0         0
847
  73               	
863
  73               	
848
  74               	/* Define PORTxn values for all possible port pins. */
864
  74               	/* Define PORTxn values for all possible port pins. */
Line 880... Line 896...
880
 106               	#  define PORTB0 PB0
896
 106               	#  define PORTB0 PB0
881
 107               	#endif
897
 107               	#endif
882
 108               	#if defined(PB1)
898
 108               	#if defined(PB1)
883
 109               	#  define PORTB1 PB1
899
 109               	#  define PORTB1 PB1
884
 110               	#endif
900
 110               	#endif
-
 
901
GAS LISTING /tmp/ccowxWMg.s 			page 16
-
 
902
 
-
 
903
 
885
 111               	#if defined(PB2)
904
 111               	#if defined(PB2)
886
 112               	#  define PORTB2 PB2
905
 112               	#  define PORTB2 PB2
887
 113               	#endif
906
 113               	#endif
888
 114               	#if defined(PB3)
907
 114               	#if defined(PB3)
889
 115               	#  define PORTB3 PB3
908
 115               	#  define PORTB3 PB3
Line 896... Line 915...
896
 122               	#endif
915
 122               	#endif
897
 123               	#if defined(PB6)
916
 123               	#if defined(PB6)
898
 124               	#  define PORTB6 PB6
917
 124               	#  define PORTB6 PB6
899
 125               	#endif
918
 125               	#endif
900
 126               	#if defined(PB7)
919
 126               	#if defined(PB7)
901
GAS LISTING /tmp/ccCMjSjd.s 			page 16
-
 
902
 
-
 
903
 
-
 
904
 127               	#  define PORTB7 PB7
920
 127               	#  define PORTB7 PB7
905
 128               	#endif
921
 128               	#endif
906
 129               	
922
 129               	
907
 130               	/* PORT C */
923
 130               	/* PORT C */
908
 131               	
924
 131               	
Line 940... Line 956...
940
 163               	#  define PORTD1 PD1
956
 163               	#  define PORTD1 PD1
941
 164               	#endif
957
 164               	#endif
942
 165               	#if defined(PD2)
958
 165               	#if defined(PD2)
943
 166               	#  define PORTD2 PD2
959
 166               	#  define PORTD2 PD2
944
 167               	#endif
960
 167               	#endif
-
 
961
GAS LISTING /tmp/ccowxWMg.s 			page 17
-
 
962
 
-
 
963
 
945
 168               	#if defined(PD3)
964
 168               	#if defined(PD3)
946
 169               	#  define PORTD3 PD3
965
 169               	#  define PORTD3 PD3
947
 170               	#endif
966
 170               	#endif
948
 171               	#if defined(PD4)
967
 171               	#if defined(PD4)
949
 172               	#  define PORTD4 PD4
968
 172               	#  define PORTD4 PD4
Line 956... Line 975...
956
 179               	#endif
975
 179               	#endif
957
 180               	#if defined(PD7)
976
 180               	#if defined(PD7)
958
 181               	#  define PORTD7 PD7
977
 181               	#  define PORTD7 PD7
959
 182               	#endif
978
 182               	#endif
960
 183               	
979
 183               	
961
GAS LISTING /tmp/ccCMjSjd.s 			page 17
-
 
962
 
-
 
963
 
-
 
964
 184               	/* PORT E */
980
 184               	/* PORT E */
965
 185               	
981
 185               	
966
 186               	#if defined(PE0)
982
 186               	#if defined(PE0)
967
 187               	#  define PORTE0 PE0
983
 187               	#  define PORTE0 PE0
968
 188               	#endif
984
 188               	#endif
Line 1000... Line 1016...
1000
 220               	#  define PORTF2 PF2
1016
 220               	#  define PORTF2 PF2
1001
 221               	#endif
1017
 221               	#endif
1002
 222               	#if defined(PF3)
1018
 222               	#if defined(PF3)
1003
 223               	#  define PORTF3 PF3
1019
 223               	#  define PORTF3 PF3
1004
 224               	#endif
1020
 224               	#endif
-
 
1021
GAS LISTING /tmp/ccowxWMg.s 			page 18
-
 
1022
 
-
 
1023
 
1005
 225               	#if defined(PF4)
1024
 225               	#if defined(PF4)
1006
 226               	#  define PORTF4 PF4
1025
 226               	#  define PORTF4 PF4
1007
 227               	#endif
1026
 227               	#endif
1008
 228               	#if defined(PF5)
1027
 228               	#if defined(PF5)
1009
 229               	#  define PORTF5 PF5
1028
 229               	#  define PORTF5 PF5
Line 1016... Line 1035...
1016
 236               	#endif
1035
 236               	#endif
1017
 237               	
1036
 237               	
1018
 238               	/* PORT G */
1037
 238               	/* PORT G */
1019
 239               	
1038
 239               	
1020
 240               	#if defined(PG0)
1039
 240               	#if defined(PG0)
1021
GAS LISTING /tmp/ccCMjSjd.s 			page 18
-
 
1022
 
-
 
1023
 
-
 
1024
 241               	#  define PORTG0 PG0
1040
 241               	#  define PORTG0 PG0
1025
 242               	#endif
1041
 242               	#endif
1026
 243               	#if defined(PG1)
1042
 243               	#if defined(PG1)
1027
 244               	#  define PORTG1 PG1
1043
 244               	#  define PORTG1 PG1
1028
 245               	#endif
1044
 245               	#endif
Line 1060... Line 1076...
1060
 277               	#  define PORTH3 PH3
1076
 277               	#  define PORTH3 PH3
1061
 278               	#endif
1077
 278               	#endif
1062
 279               	#if defined(PH4)
1078
 279               	#if defined(PH4)
1063
 280               	#  define PORTH4 PH4
1079
 280               	#  define PORTH4 PH4
1064
 281               	#endif
1080
 281               	#endif
-
 
1081
GAS LISTING /tmp/ccowxWMg.s 			page 19
-
 
1082
 
-
 
1083
 
1065
 282               	#if defined(PH5)
1084
 282               	#if defined(PH5)
1066
 283               	#  define PORTH5 PH5
1085
 283               	#  define PORTH5 PH5
1067
 284               	#endif
1086
 284               	#endif
1068
 285               	#if defined(PH6)
1087
 285               	#if defined(PH6)
1069
 286               	#  define PORTH6 PH6
1088
 286               	#  define PORTH6 PH6
Line 1076... Line 1095...
1076
 293               	
1095
 293               	
1077
 294               	#if defined(PJ0)
1096
 294               	#if defined(PJ0)
1078
 295               	#  define PORTJ0 PJ0
1097
 295               	#  define PORTJ0 PJ0
1079
 296               	#endif
1098
 296               	#endif
1080
 297               	#if defined(PJ1)
1099
 297               	#if defined(PJ1)
1081
GAS LISTING /tmp/ccCMjSjd.s 			page 19
-
 
1082
 
-
 
1083
 
-
 
1084
 298               	#  define PORTJ1 PJ1
1100
 298               	#  define PORTJ1 PJ1
1085
 299               	#endif
1101
 299               	#endif
1086
 300               	#if defined(PJ2)
1102
 300               	#if defined(PJ2)
1087
 301               	#  define PORTJ2 PJ2
1103
 301               	#  define PORTJ2 PJ2
1088
 302               	#endif
1104
 302               	#endif
Line 1111... Line 1127...
1111
 325               	#  define PORTK1 PK1
1127
 325               	#  define PORTK1 PK1
1112
 326               	#endif
1128
 326               	#endif
1113
 327               	#if defined(PK2)
1129
 327               	#if defined(PK2)
1114
 328               	#  define PORTK2 PK2
1130
 328               	#  define PORTK2 PK2
1115
 329               	#endif
1131
 329               	#endif
1116
 329               	
1132
 330               	#if defined(PK3)
1117
 330               	#if __AVR_ARCH__ != 1
1133
 331               	#  define PORTK3 PK3
1118
 331               	#  if XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__)
1134
 332               	#endif
1119
 332               	#    undef SP
1135
 333               	#if defined(PK4)
1120
 333               	#    define SP     _SFR_IO8(0x3D)
1136
 334               	#  define PORTK4 PK4
1121
 334               	#    undef SPH
1137
 335               	#endif
1122
 335               	#  endif
1138
 336               	#if defined(PK5)
1123
 336               	#endif
1139
 337               	#  define PORTK5 PK5
1124
 337               	
1140
 337               	
-
 
1141
GAS LISTING /tmp/ccowxWMg.s 			page 20
-
 
1142
 
-
 
1143
 
-
 
1144
 338               	#if __AVR_ARCH__ != 1
-
 
1145
 339               	#  if XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__)
-
 
1146
 340               	#    undef SP
-
 
1147
 341               	#    define SP     _SFR_IO8(0x3D)
-
 
1148
 342               	#    undef SPH
-
 
1149
 343               	#  endif
-
 
1150
 344               	#endif
-
 
1151
 345               	
1125
 338               	#include <avr/version.h>
1152
 346               	#include <avr/version.h>
1126
   1               	/* Copyright (c) 2005, Joerg Wunsch                               -*- c -*-
1153
   1               	/* Copyright (c) 2005, Joerg Wunsch                               -*- c -*-
1127
   2               	   All rights reserved.
1154
   2               	   All rights reserved.
1128
   3               	
1155
   3               	
1129
   4               	   Redistribution and use in source and binary forms, with or without
1156
   4               	   Redistribution and use in source and binary forms, with or without
1130
   5               	   modification, are permitted provided that the following conditions are met:
1157
   5               	   modification, are permitted provided that the following conditions are met:
Line 1136... Line 1163...
1136
  11               	     notice, this list of conditions and the following disclaimer in
1163
  11               	     notice, this list of conditions and the following disclaimer in
1137
  12               	     the documentation and/or other materials provided with the
1164
  12               	     the documentation and/or other materials provided with the
1138
  13               	     distribution.
1165
  13               	     distribution.
1139
  14               	
1166
  14               	
1140
  15               	   * Neither the name of the copyright holders nor the names of
1167
  15               	   * Neither the name of the copyright holders nor the names of
1141
GAS LISTING /tmp/ccCMjSjd.s 			page 20
-
 
1142
 
-
 
1143
 
-
 
1144
  16               	     contributors may be used to endorse or promote products derived
1168
  16               	     contributors may be used to endorse or promote products derived
1145
  17               	     from this software without specific prior written permission.
1169
  17               	     from this software without specific prior written permission.
1146
  18               	
1170
  18               	
1147
  19               	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1171
  19               	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1148
  20               	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1172
  20               	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Line 1172... Line 1196...
1172
  44               	
1196
  44               	
1173
  45               	    This file will also be included by \c <avr/io.h>.  That way,
1197
  45               	    This file will also be included by \c <avr/io.h>.  That way,
1174
  46               	    portable tests can be implemented using \c <avr/io.h> that can be
1198
  46               	    portable tests can be implemented using \c <avr/io.h> that can be
1175
  47               	    used in code that wants to remain backwards-compatible to library
1199
  47               	    used in code that wants to remain backwards-compatible to library
1176
  48               	    versions prior to the date when the library version API had been
1200
  48               	    versions prior to the date when the library version API had been
-
 
1201
GAS LISTING /tmp/ccowxWMg.s 			page 21
-
 
1202
 
-
 
1203
 
1177
  49               	    added, as referenced but undefined C preprocessor macros
1204
  49               	    added, as referenced but undefined C preprocessor macros
1178
  50               	    automatically evaluate to 0.
1205
  50               	    automatically evaluate to 0.
1179
  51               	*/
1206
  51               	*/
1180
  52               	
1207
  52               	
1181
  53               	#ifndef _AVR_VERSION_H_
1208
  53               	#ifndef _AVR_VERSION_H_
1182
  54               	#define _AVR_VERSION_H_
1209
  54               	#define _AVR_VERSION_H_
1183
  55               	
1210
  55               	
1184
  56               	/** \ingroup avr_version
1211
  56               	/** \ingroup avr_version
1185
  57               	    String literal representation of the current library version. */
1212
  57               	    String literal representation of the current library version. */
1186
  58               	#define __AVR_LIBC_VERSION_STRING__ "1.4.4"
1213
  58               	#define __AVR_LIBC_VERSION_STRING__ "1.4.5"
1187
  59               	
1214
  59               	
1188
  60               	/** \ingroup avr_version
1215
  60               	/** \ingroup avr_version
1189
  61               	    Numerical representation of the current library version.
1216
  61               	    Numerical representation of the current library version.
1190
  62               	
1217
  62               	
1191
  63               	    In the numerical representation, the major number is multiplied by
1218
  63               	    In the numerical representation, the major number is multiplied by
1192
  64               	    10000, the minor number by 100, and all three parts are then
1219
  64               	    10000, the minor number by 100, and all three parts are then
1193
  65               	    added.  It is intented to provide a monotonically increasing
1220
  65               	    added.  It is intented to provide a monotonically increasing
1194
  66               	    numerical value that can easily be used in numerical checks.
1221
  66               	    numerical value that can easily be used in numerical checks.
1195
  67               	 */
1222
  67               	 */
1196
  68               	#define __AVR_LIBC_VERSION__        10404UL
1223
  68               	#define __AVR_LIBC_VERSION__        10405UL
1197
  69               	
1224
  69               	
1198
  70               	/** \ingroup avr_version
1225
  70               	/** \ingroup avr_version
1199
  71               	    String literal representation of the release date. */
1226
  71               	    String literal representation of the release date. */
1200
  72               	#define __AVR_LIBC_DATE_STRING__    "20060420"
1227
  72               	#define __AVR_LIBC_DATE_STRING__    "20061009"
1201
GAS LISTING /tmp/ccCMjSjd.s 			page 21
-
 
1202
 
-
 
1203
 
-
 
1204
  73               	
1228
  73               	
1205
  74               	/** \ingroup avr_version
1229
  74               	/** \ingroup avr_version
1206
  75               	    Numerical representation of the release date. */
1230
  75               	    Numerical representation of the release date. */
1207
  76               	#define __AVR_LIBC_DATE_            20060420UL
1231
  76               	#define __AVR_LIBC_DATE_            20061009UL
1208
  77               	
1232
  77               	
1209
  78               	/** \ingroup avr_version
1233
  78               	/** \ingroup avr_version
1210
  79               	    Library major version number. */
1234
  79               	    Library major version number. */
1211
  80               	#define __AVR_LIBC_MAJOR__          1
1235
  80               	#define __AVR_LIBC_MAJOR__          1
1212
  81               	
1236
  81               	
Line 1214... Line 1238...
1214
  83               	    Library minor version number. */
1238
  83               	    Library minor version number. */
1215
  84               	#define __AVR_LIBC_MINOR__          4
1239
  84               	#define __AVR_LIBC_MINOR__          4
1216
  85               	
1240
  85               	
1217
  86               	/** \ingroup avr_version
1241
  86               	/** \ingroup avr_version
1218
  87               	    Library revision number. */
1242
  87               	    Library revision number. */
1219
  88               	#define __AVR_LIBC_REVISION__       4
1243
  88               	#define __AVR_LIBC_REVISION__       5
1220
  89               	
1244
  89               	
1221
  90               	#endif /* _AVR_VERSION_H_ */
1245
  90               	#endif /* _AVR_VERSION_H_ */
1222
  91               	...
1246
  91               	...
1223
 339               	
1247
 347               	
1224
  54               	#include "Events.h"
1248
  54               	#include "Events.h"
1225
   1               	#ifndef EVENTS_H
1249
   1               	#ifndef EVENTS_H
1226
   2               	#define EVENTS_H
1250
   2               	#define EVENTS_H
1227
   3               	
1251
   3               	
1228
   4               	/*
1252
   4               	/*
Line 1232... Line 1256...
1232
   8               	
1256
   8               	
1233
   9               	    This program is free software; you can redistribute it and/or
1257
   9               	    This program is free software; you can redistribute it and/or
1234
  10               	    modify it under the terms of the GNU General Public
1258
  10               	    modify it under the terms of the GNU General Public
1235
  11               	    License as published by the Free Software Foundation; either
1259
  11               	    License as published by the Free Software Foundation; either
1236
  12               	    version 2 of the License, or (at your option) any later version.
1260
  12               	    version 2 of the License, or (at your option) any later version.
-
 
1261
GAS LISTING /tmp/ccowxWMg.s 			page 22
-
 
1262
 
-
 
1263
 
1237
  13               	
1264
  13               	
1238
  14               	    This program is distributed in the hope that it will be useful,
1265
  14               	    This program is distributed in the hope that it will be useful,
1239
  15               	    but WITHOUT ANY WARRANTY; without even the implied warranty of
1266
  15               	    but WITHOUT ANY WARRANTY; without even the implied warranty of
1240
  16               	    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1267
  16               	    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1241
  17               	    General Public License for more details.
1268
  17               	    General Public License for more details.
Line 1256... Line 1283...
1256
  32               		Module Auth: John Orlando
1283
  32               		Module Auth: John Orlando
1257
  33               		
1284
  33               		
1258
  34               		Description: This file provides the external interface
1285
  34               		Description: This file provides the external interface
1259
  35               		to the events that can be published/processed in the
1286
  35               		to the events that can be published/processed in the
1260
  36               		system.  It is specifically by itself (and nothing
1287
  36               		system.  It is specifically by itself (and nothing
1261
GAS LISTING /tmp/ccCMjSjd.s 			page 22
-
 
1262
 
-
 
1263
 
-
 
1264
  37               		else should be defined in here) so that both .c and
1288
  37               		else should be defined in here) so that both .c and
1265
  38               		.S (assembly) files can include this file without
1289
  38               		.S (assembly) files can include this file without
1266
  39               		a problem.
1290
  39               		a problem.
1267
  40               	    
1291
  40               	    
1268
  41               	    Revision History:
1292
  41               	    Revision History:
Line 1292... Line 1316...
1292
  64               	#define RB_PORT						_SFR_IO_ADDR(PINB)  
1316
  64               	#define RB_PORT						_SFR_IO_ADDR(PINB)  
1293
  65               	#define PIXEL_RUN_START_INITIAL     0x50     	; This value causes our pixel counter (TCNT1)
1317
  65               	#define PIXEL_RUN_START_INITIAL     0x50     	; This value causes our pixel counter (TCNT1)
1294
  66               													; to overflow after 176 (horizontal) pixels
1318
  66               													; to overflow after 176 (horizontal) pixels
1295
  67               	
1319
  67               	
1296
  68               	#define RED_MEM_OFFSET				0x00
1320
  68               	#define RED_MEM_OFFSET				0x00
-
 
1321
GAS LISTING /tmp/ccowxWMg.s 			page 23
-
 
1322
 
-
 
1323
 
1297
  69               	#define GREEN_MEM_OFFSET			0x10
1324
  69               	#define GREEN_MEM_OFFSET			0x10
1298
  70               	#define BLUE_MEM_OFFSET				0x20
1325
  70               	#define BLUE_MEM_OFFSET				0x20
1299
  71               	
1326
  71               	
1300
  72               	; A pixelBlock is defined as a contiguous group of 4 pixels that are combined 
1327
  72               	; A pixelBlock is defined as a contiguous group of 4 pixels that are combined 
1301
  73               	; together to form a specific color.  Typically, this is formed by sampling a
1328
  73               	; together to form a specific color.  Typically, this is formed by sampling a
Line 1316... Line 1343...
1316
  88               	;    |  |--this is sampled
1343
  88               	;    |  |--this is sampled
1317
  89               	;    |--this is sampled
1344
  89               	;    |--this is sampled
1318
  90               	
1345
  90               	
1319
  91               	; As pixel blocks are sampled, the red, green, and blue values are
1346
  91               	; As pixel blocks are sampled, the red, green, and blue values are
1320
  92               	; used to index into their respective color maps.  The color maps
1347
  92               	; used to index into their respective color maps.  The color maps
1321
GAS LISTING /tmp/ccCMjSjd.s 			page 23
-
 
1322
 
-
 
1323
 
-
 
1324
  93               	; return values that can be logically ANDed together so that a 
1348
  93               	; return values that can be logically ANDed together so that a 
1325
  94               	; particular RGB triplet will result in a single bit being set
1349
  94               	; particular RGB triplet will result in a single bit being set
1326
  95               	; after the AND operation.  This single bit indicates which color
1350
  95               	; after the AND operation.  This single bit indicates which color
1327
  96               	; the RGB triplet represents.  It is also possible for no bits to
1351
  96               	; the RGB triplet represents.  It is also possible for no bits to
1328
  97               	; be set after the AND process, indicating that the RGB triplet
1352
  97               	; be set after the AND process, indicating that the RGB triplet
Line 1352... Line 1376...
1352
 121               	lastColor     		= 18
1376
 121               	lastColor     		= 18
1353
 122               	tmp1				= 19	; be sure to not use tmp1 and color simultaneously
1377
 122               	tmp1				= 19	; be sure to not use tmp1 and color simultaneously
1354
 123               	tmp2				= 20
1378
 123               	tmp2				= 20
1355
 124               	color           	= 19
1379
 124               	color           	= 19
1356
 125               	greenData       	= 20
1380
 125               	greenData       	= 20
-
 
1381
GAS LISTING /tmp/ccowxWMg.s 			page 24
-
 
1382
 
-
 
1383
 
1357
 126               	blueData        	= 21
1384
 126               	blueData        	= 21
1358
 127               	colorMapLow	  		= 22
1385
 127               	colorMapLow	  		= 22
1359
 128               	colorMapHigh		= 23
1386
 128               	colorMapHigh		= 23
1360
 129               	prevLineBuffLow  	= 22  	; overlaps with memLookupLow (but orthogonal)
1387
 129               	prevLineBuffLow  	= 22  	; overlaps with memLookupLow (but orthogonal)
1361
 130               	prevLineBuffHigh	= 23	; overlaps with memLookupHigh (but orthogonal)
1388
 130               	prevLineBuffHigh	= 23	; overlaps with memLookupHigh (but orthogonal)
Line 1376... Line 1403...
1376
 145               			.global SIG_OVERFLOW1
1403
 145               			.global SIG_OVERFLOW1
1377
 146               			
1404
 146               			
1378
 147               	;*****************************************************************		
1405
 147               	;*****************************************************************		
1379
 148               	;   	Function Name: CamIntAsm_waitForNewTrackingFrame
1406
 148               	;   	Function Name: CamIntAsm_waitForNewTrackingFrame
1380
 149               	;       Function Description: This function is responsible for
1407
 149               	;       Function Description: This function is responsible for
1381
GAS LISTING /tmp/ccCMjSjd.s 			page 24
-
 
1382
 
-
 
1383
 
-
 
1384
 150               	;       going to sleep until a new frame begins (indicated by
1408
 150               	;       going to sleep until a new frame begins (indicated by
1385
 151               	;    	VSYNC transitioning from low to high.  This will wake
1409
 151               	;    	VSYNC transitioning from low to high.  This will wake
1386
 152               	;       the "VSYNC sleep" up and allow it to continue with 
1410
 152               	;       the "VSYNC sleep" up and allow it to continue with 
1387
 153               	;       the acquireLine function, where the system waits for
1411
 153               	;       the acquireLine function, where the system waits for
1388
 154               	;       an "HREF sleep" that we use to synchronize with the
1412
 154               	;       an "HREF sleep" that we use to synchronize with the
Line 1412... Line 1436...
1412
 178               	
1436
 178               	
1413
 179               	CamIntAsm_acquireTrackingLine:
1437
 179               	CamIntAsm_acquireTrackingLine:
1414
 180:CamInterfaceAsm.S **** 		brts	_cleanUp
1438
 180:CamInterfaceAsm.S **** 		brts	_cleanUp
1415
 181               			;sbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
1439
 181               			;sbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
1416
 182               			;cbi		_SFR_IO_ADDR(PORTD),PD6
1440
 182               			;cbi		_SFR_IO_ADDR(PORTD),PD6
-
 
1441
GAS LISTING /tmp/ccowxWMg.s 			page 25
-
 
1442
 
-
 
1443
 
1417
 183               	        
1444
 183               	        
1418
 184:CamInterfaceAsm.S ****         in      tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually
1445
 184:CamInterfaceAsm.S ****         in      tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually
1419
 185:CamInterfaceAsm.S ****         ori     tmp1, 0x07                 ; feed Timer1
1446
 185:CamInterfaceAsm.S ****         ori     tmp1, 0x07                 ; feed Timer1
1420
 186:CamInterfaceAsm.S ****         out     _SFR_IO_ADDR(TCCR1B),tmp1 
1447
 186:CamInterfaceAsm.S ****         out     _SFR_IO_ADDR(TCCR1B),tmp1 
1421
 187               											; The line is about to start...		
1448
 187               											; The line is about to start...		
Line 1436... Line 1463...
1436
 202:CamInterfaceAsm.S **** 		in		tmp1, _SFR_IO_ADDR(TIMSK)			; enable TIMER1 to start counting
1463
 202:CamInterfaceAsm.S **** 		in		tmp1, _SFR_IO_ADDR(TIMSK)			; enable TIMER1 to start counting
1437
 203:CamInterfaceAsm.S **** 		ori		tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses and interrupt on 
1464
 203:CamInterfaceAsm.S **** 		ori		tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses and interrupt on 
1438
 204:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(TIMSK),tmp1			; overflow
1465
 204:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(TIMSK),tmp1			; overflow
1439
 205               			
1466
 205               			
1440
 206:CamInterfaceAsm.S **** 		ldi 	tmp1,PIXEL_RUN_START_INITIAL	; set up the TCNT1 to overflow (and
1467
 206:CamInterfaceAsm.S **** 		ldi 	tmp1,PIXEL_RUN_START_INITIAL	; set up the TCNT1 to overflow (and
1441
GAS LISTING /tmp/ccCMjSjd.s 			page 25
-
 
1442
 
-
 
1443
 
-
 
1444
 207:CamInterfaceAsm.S **** 		ldi 	tmp2,0xFF 						; interrupts) after 176 pixels		
1468
 207:CamInterfaceAsm.S **** 		ldi 	tmp2,0xFF 						; interrupts) after 176 pixels		
1445
 208:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
1469
 208:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
1446
 209:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1L),tmp1				
1470
 209:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1L),tmp1				
1447
 210               			
1471
 210               			
1448
 211:CamInterfaceAsm.S **** 		mov		YL,colorMapLow		
1472
 211:CamInterfaceAsm.S **** 		mov		YL,colorMapLow		
Line 1472... Line 1496...
1472
 235               			
1496
 235               			
1473
 236               		; A couple of NOPs are needed here to sync up the pixel data...the number (2)
1497
 236               		; A couple of NOPs are needed here to sync up the pixel data...the number (2)
1474
 237               		; of NOPs was determined emperically by trial and error.
1498
 237               		; of NOPs was determined emperically by trial and error.
1475
 238:CamInterfaceAsm.S **** 		nop
1499
 238:CamInterfaceAsm.S **** 		nop
1476
 239:CamInterfaceAsm.S **** 		nop
1500
 239:CamInterfaceAsm.S **** 		nop
-
 
1501
GAS LISTING /tmp/ccowxWMg.s 			page 26
-
 
1502
 
-
 
1503
 
1477
 240               	_acquirePixelBlock:							;							Clock Cycle Count
1504
 240               	_acquirePixelBlock:							;							Clock Cycle Count
1478
 241:CamInterfaceAsm.S **** 		in		ZL,RB_PORT         			; sample the red value (PINB)		(1)
1505
 241:CamInterfaceAsm.S **** 		in		ZL,RB_PORT         			; sample the red value (PINB)		(1)
1479
 242:CamInterfaceAsm.S **** 		in		YL,G_PORT         			; sample the green value (PINC)		(1)
1506
 242:CamInterfaceAsm.S **** 		in		YL,G_PORT         			; sample the green value (PINC)		(1)
1480
 243:CamInterfaceAsm.S **** 		andi	YL,0x0F            			; clear the high nibble				(1)
1507
 243:CamInterfaceAsm.S **** 		andi	YL,0x0F            			; clear the high nibble				(1)
1481
 244:CamInterfaceAsm.S **** 		ldd		color,Z+RED_MEM_OFFSET  	; lookup the red membership			(2)
1508
 244:CamInterfaceAsm.S **** 		ldd		color,Z+RED_MEM_OFFSET  	; lookup the red membership			(2)
Line 1496... Line 1523...
1496
 259               			
1523
 259               			
1497
 260               			; Toggle the debug line to indicate a color change
1524
 260               			; Toggle the debug line to indicate a color change
1498
 261:CamInterfaceAsm.S **** 		sbi     _SFR_IO_ADDR(PORTD),PD6
1525
 261:CamInterfaceAsm.S **** 		sbi     _SFR_IO_ADDR(PORTD),PD6
1499
 262:CamInterfaceAsm.S **** 		nop
1526
 262:CamInterfaceAsm.S **** 		nop
1500
 263:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6
1527
 263:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6
1501
GAS LISTING /tmp/ccCMjSjd.s 			page 26
-
 
1502
 
-
 
1503
 
-
 
1504
 264               			
1528
 264               			
1505
 265:CamInterfaceAsm.S **** 		mov		tmp2,pixelRunStart				; get the count value of the
1529
 265:CamInterfaceAsm.S **** 		mov		tmp2,pixelRunStart				; get the count value of the
1506
 266               													; current pixel run
1530
 266               													; current pixel run
1507
 267:CamInterfaceAsm.S **** 		in		pixelCount,_SFR_IO_ADDR(TCNT1L)	; get the current TCNT1 value 
1531
 267:CamInterfaceAsm.S **** 		in		pixelCount,_SFR_IO_ADDR(TCNT1L)	; get the current TCNT1 value 
1508
 268:CamInterfaceAsm.S **** 		mov   	pixelRunStart,pixelCount		; reload pixelRunStart for the
1532
 268:CamInterfaceAsm.S **** 		mov   	pixelRunStart,pixelCount		; reload pixelRunStart for the
Line 1532... Line 1556...
1532
 292               	_cleanUpDumpLine:		
1556
 292               	_cleanUpDumpLine:		
1533
 293               			; NOTE: If serial data is received, to interrupt the tracking of a line, we'll
1557
 293               			; NOTE: If serial data is received, to interrupt the tracking of a line, we'll
1534
 294               			; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the
1558
 294               			; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the
1535
 295               			; line's processing...however, the PCLK will keep on ticking for the rest of
1559
 295               			; line's processing...however, the PCLK will keep on ticking for the rest of
1536
 296               			; the frame/line, which will cause the TCNT to eventually overflow and
1560
 296               			; the frame/line, which will cause the TCNT to eventually overflow and
-
 
1561
GAS LISTING /tmp/ccowxWMg.s 			page 27
-
 
1562
 
-
 
1563
 
1537
 297               			; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event.  We don't want
1564
 297               			; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event.  We don't want
1538
 298               			; this, so we need to actually turn off the PCLK counting each time we exit
1565
 298               			; this, so we need to actually turn off the PCLK counting each time we exit
1539
 299               			; this loop, and only turn it on when we begin acquiring lines....
1566
 299               			; this loop, and only turn it on when we begin acquiring lines....
1540
 300               	        ; NOT NEEDED FOR NOW...
1567
 300               	        ; NOT NEEDED FOR NOW...
1541
 301               			;in		tmp1, _SFR_IO_ADDR(TIMSK)			; disable TIMER1 to stop counting
1568
 301               			;in		tmp1, _SFR_IO_ADDR(TIMSK)			; disable TIMER1 to stop counting
Line 1556... Line 1583...
1556
 316               	_exit:
1583
 316               	_exit:
1557
 317:CamInterfaceAsm.S **** 		ret
1584
 317:CamInterfaceAsm.S **** 		ret
1558
 318               			
1585
 318               			
1559
 319               	;*****************************************************************		
1586
 319               	;*****************************************************************		
1560
 320               	;   	Function Name: CamIntAsm_waitForNewDumpFrame
1587
 320               	;   	Function Name: CamIntAsm_waitForNewDumpFrame
1561
GAS LISTING /tmp/ccCMjSjd.s 			page 27
-
 
1562
 
-
 
1563
 
-
 
1564
 321               	;       Function Description: This function is responsible for
1588
 321               	;       Function Description: This function is responsible for
1565
 322               	;       going to sleep until a new frame begins (indicated by
1589
 322               	;       going to sleep until a new frame begins (indicated by
1566
 323               	;    	VSYNC transitioning from low to high.  This will wake
1590
 323               	;    	VSYNC transitioning from low to high.  This will wake
1567
 324               	;       the "VSYNC sleep" up and allow it to continue with 
1591
 324               	;       the "VSYNC sleep" up and allow it to continue with 
1568
 325               	;       acquiring a line of pixel data to dump out to the UI.
1592
 325               	;       acquiring a line of pixel data to dump out to the UI.
Line 1592... Line 1616...
1592
 349               			
1616
 349               			
1593
 350:CamInterfaceAsm.S **** 		mov   	XH,currLineBuffHigh    	; Load the pointer to the current line
1617
 350:CamInterfaceAsm.S **** 		mov   	XH,currLineBuffHigh    	; Load the pointer to the current line
1594
 351:CamInterfaceAsm.S **** 		mov		XL,currLineBuffLow		; buffer into the X pointer regs
1618
 351:CamInterfaceAsm.S **** 		mov		XL,currLineBuffLow		; buffer into the X pointer regs
1595
 352               	
1619
 352               	
1596
 353:CamInterfaceAsm.S **** 		mov		YH,prevLineBuffHigh		; Load the pointer to the previous line
1620
 353:CamInterfaceAsm.S **** 		mov		YH,prevLineBuffHigh		; Load the pointer to the previous line
-
 
1621
GAS LISTING /tmp/ccowxWMg.s 			page 28
-
 
1622
 
-
 
1623
 
1597
 354:CamInterfaceAsm.S **** 		mov		YL,prevLineBuffLow  	; buffer into the Y pointer regs
1624
 354:CamInterfaceAsm.S **** 		mov		YL,prevLineBuffLow  	; buffer into the Y pointer regs
1598
 355               			
1625
 355               			
1599
 356:CamInterfaceAsm.S **** 		ldi 	tmp1,PIXEL_RUN_START_INITIAL	; set up the TCNT1 to overflow (and
1626
 356:CamInterfaceAsm.S **** 		ldi 	tmp1,PIXEL_RUN_START_INITIAL	; set up the TCNT1 to overflow (and
1600
 357:CamInterfaceAsm.S **** 		ldi 	tmp2,0xFF 						; interrupts) after 176 pixels		
1627
 357:CamInterfaceAsm.S **** 		ldi 	tmp2,0xFF 						; interrupts) after 176 pixels		
1601
 358:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
1628
 358:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
Line 1616... Line 1643...
1616
 373:CamInterfaceAsm.S **** 		ori 	tmp1, HREF_INTERRUPT_ENABLE_MASK
1643
 373:CamInterfaceAsm.S **** 		ori 	tmp1, HREF_INTERRUPT_ENABLE_MASK
1617
 374:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(GICR), tmp1
1644
 374:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(GICR), tmp1
1618
 375               			
1645
 375               			
1619
 376               	;*******************************************************************************************
1646
 376               	;*******************************************************************************************
1620
 377               	;   Dump Frame handler 
1647
 377               	;   Dump Frame handler 
1621
GAS LISTING /tmp/ccCMjSjd.s 			page 28
-
 
1622
 
-
 
1623
 
-
 
1624
 378               	;*******************************************************************************************		
1648
 378               	;*******************************************************************************************		
1625
 379               			
1649
 379               			
1626
 380               	_dumpFrame:		
1650
 380               	_dumpFrame:		
1627
 381:CamInterfaceAsm.S **** 		sbi		_SFR_IO_ADDR(PORTD),PD6
1651
 381:CamInterfaceAsm.S **** 		sbi		_SFR_IO_ADDR(PORTD),PD6
1628
 382:CamInterfaceAsm.S **** 		sleep   ; ...And we wait...
1652
 382:CamInterfaceAsm.S **** 		sleep   ; ...And we wait...
Line 1652... Line 1676...
1652
 406               											;									___________
1676
 406               											;									___________
1653
 407               											;									8 cycles normally
1677
 407               											;									8 cycles normally
1654
 408               																				
1678
 408               																				
1655
 409               			; if we make it here, it means the T flag is set, and we must have been interrupted
1679
 409               			; if we make it here, it means the T flag is set, and we must have been interrupted
1656
 410               			; so we need to exit (what if we were interrupted for serial? should we disable it?)
1680
 410               			; so we need to exit (what if we were interrupted for serial? should we disable it?)
-
 
1681
GAS LISTING /tmp/ccowxWMg.s 			page 29
-
 
1682
 
-
 
1683
 
1657
 411:CamInterfaceAsm.S **** 		rjmp	_cleanUpDumpLine
1684
 411:CamInterfaceAsm.S **** 		rjmp	_cleanUpDumpLine
1658
 412               	
1685
 412               	
1659
 413               	;***********************************************************
1686
 413               	;***********************************************************
1660
 414               	;	Function Name: <interrupt handler for External Interrupt0> 
1687
 414               	;	Function Name: <interrupt handler for External Interrupt0> 
1661
 415               	;	Function Description: This function is responsible
1688
 415               	;	Function Description: This function is responsible
Line 1676... Line 1703...
1676
 430               	;	for handling a falling edge on the Ext Interrupt 1.  This
1703
 430               	;	for handling a falling edge on the Ext Interrupt 1.  This
1677
 431               	;	routine simply returns, since we just want to wake up
1704
 431               	;	routine simply returns, since we just want to wake up
1678
 432               	;	whenever the HREF transitions (meaning the pixels 
1705
 432               	;	whenever the HREF transitions (meaning the pixels 
1679
 433               	;	are starting after VSYNC transitioned, and we need to
1706
 433               	;	are starting after VSYNC transitioned, and we need to
1680
 434               	; 	start acquiring the pixel blocks
1707
 434               	; 	start acquiring the pixel blocks
1681
GAS LISTING /tmp/ccCMjSjd.s 			page 29
-
 
1682
 
-
 
1683
 
-
 
1684
 435               	;	Inputs:  none
1708
 435               	;	Inputs:  none
1685
 436               	;	Outputs: none
1709
 436               	;	Outputs: none
1686
 437               	;***********************************************************	
1710
 437               	;***********************************************************	
1687
 438               	SIG_INTERRUPT1:
1711
 438               	SIG_INTERRUPT1:
1688
 439               	; This will wake us up when HREF transitions high...we just want to return
1712
 439               	; This will wake us up when HREF transitions high...we just want to return
Line 1712... Line 1736...
1712
 463               			
1736
 463               			
1713
 464               	;***********************************************************
1737
 464               	;***********************************************************
1714
 465               	;	Function Name: <interrupt handler for Timer1 overflow>
1738
 465               	;	Function Name: <interrupt handler for Timer1 overflow>
1715
 466               	;	Function Description: This function is responsible
1739
 466               	;	Function Description: This function is responsible
1716
 467               	;	for handling the Timer1 overflow (hooked up to indicate
1740
 467               	;	for handling the Timer1 overflow (hooked up to indicate
-
 
1741
GAS LISTING /tmp/ccowxWMg.s 			page 30
-
 
1742
 
-
 
1743
 
1717
 468               	;	when we have reached the end of a line of pixel data,
1744
 468               	;	when we have reached the end of a line of pixel data,
1718
 469               	;	since PCLK is hooked up to overflow TCNT1 after 176 
1745
 469               	;	since PCLK is hooked up to overflow TCNT1 after 176 
1719
 470               	;	pixels).  This routine generates an acquire line complete
1746
 470               	;	pixels).  This routine generates an acquire line complete
1720
 471               	;	event in the fastEventBitmask, which is streamlined for
1747
 471               	;	event in the fastEventBitmask, which is streamlined for
1721
 472               	;	efficiency reasons.
1748
 472               	;	efficiency reasons.
Line 1735... Line 1762...
1735
 486               	        .global __vector_default              
1762
 486               	        .global __vector_default              
1736
 487               	__vector_default:
1763
 487               	__vector_default:
1737
 488:CamInterfaceAsm.S ****         reti
1764
 488:CamInterfaceAsm.S ****         reti
1738
 489               	
1765
 489               	
1739
 490               	        .end
1766
 490               	        .end
1740
GAS LISTING /tmp/ccCMjSjd.s 			page 30
1767
GAS LISTING /tmp/ccowxWMg.s 			page 31
1741
 
1768
 
1742
 
1769
 
1743
DEFINED SYMBOLS
1770
DEFINED SYMBOLS
1744
                            *ABS*:00000000 CamInterfaceAsm.S
1771
                            *ABS*:00000000 CamInterfaceAsm.S
1745
   CamInterfaceAsm.S:119    *ABS*:00000010 pixelCount
1772
   CamInterfaceAsm.S:119    *ABS*:00000010 pixelCount