Subversion Repositories svnkaklik

Rev

Rev 409 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 409 Rev 410
1
/*
1
/*
2
    Copyright (C) 2004    John Orlando
2
    Copyright (C) 2004    John Orlando
3
    
3
    
4
   AVRcam: a small real-time image processing engine.
4
   AVRcam: a small real-time image processing engine.
5
 
5
 
6
    This program is free software; you can redistribute it and/or
6
    This program is free software; you can redistribute it and/or
7
    modify it under the terms of the GNU General Public
7
    modify it under the terms of the GNU General Public
8
    License as published by the Free Software Foundation; either
8
    License as published by the Free Software Foundation; either
9
    version 2 of the License, or (at your option) any later version.
9
    version 2 of the License, or (at your option) any later version.
10
 
10
 
11
    This program is distributed in the hope that it will be useful,
11
    This program is distributed in the hope that it will be useful,
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
    General Public License for more details.
14
    General Public License for more details.
15
 
15
 
16
    You should have received a copy of the GNU General Public
16
    You should have received a copy of the GNU General Public
17
    License along with this program; if not, write to the Free Software
17
    License along with this program; if not, write to the Free Software
18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 
19
 
20
   For more information on the AVRcam, please contact:
20
   For more information on the AVRcam, please contact:
21
 
21
 
22
   john@jrobot.net
22
   john@jrobot.net
23
 
23
 
24
   or go to www.jrobot.net for more details regarding the system.
24
   or go to www.jrobot.net for more details regarding the system.
25
*/
25
*/
26
/***********************************************************
26
/***********************************************************
27
	Module Name: DebugInterface.c
27
	Module Name: DebugInterface.c
28
	Module Date: 04/15/2004
28
	Module Date: 04/15/2004
29
	Module Auth: John Orlando
29
	Module Auth: John Orlando
30
	
30
	
31
	Description: This module is responsible for providing a
31
	Description: This module is responsible for providing a
32
	debug interface to the system.  Currently, the only
32
	debug interface to the system.  Currently, the only
33
	debugging that is available is through the on-board
33
	debugging that is available is through the on-board
34
	UART (which is used by the main application as well) in
34
	UART (which is used by the main application as well) in
35
	addition to the LED hooked up at PORTD bit 6.
35
	addition to the LED hooked up at PORTD bit 6.
36
    
36
    
37
    Revision History:
37
    Revision History:
38
    Date        Rel Ver.    Notes
38
    Date        Rel Ver.    Notes
39
    4/10/2004      0.1     Module created
39
    4/10/2004      0.1     Module created
40
    6/30/2004      1.0     Initial release for Circuit Cellar
40
    6/30/2004      1.0     Initial release for Circuit Cellar
41
                           contest.
41
                           contest.
42
***********************************************************/
42
***********************************************************/
43
 
43
 
44
/*	Includes */
44
/*	Includes */
45
#include "CommonDefs.h"
45
#include "CommonDefs.h"
46
#include "UartInterface.h"
46
#include "UartInterface.h"
47
#include "Utility.h"
47
#include "Utility.h"
48
 
48
 
49
/*  Local Variables */
49
/*  Local Variables */
50
 
50
 
51
/* 	Local Structures and Typedefs */
51
/* 	Local Structures and Typedefs */
52
 
52
 
53
/*  Extern Variables */
53
/*  Extern Variables */
54
 
54
 
55
/*  Definitions */
55
/*  Definitions */
56
 
56
 
57
/***********************************************************
57
/***********************************************************
58
	Function Name: DebugInt_init
58
	Function Name: DebugInt_init
59
	Function Description: This function is responsible for
59
	Function Description: This function is responsible for
60
	initializing the debug module.  It sets up the debug LED
60
	initializing the debug module.  It sets up the debug LED
61
	as well as any other debugging that will be done.  The 
61
	as well as any other debugging that will be done.  The 
62
    LED blinks four times, which indicates to the user
62
    LED blinks four times, which indicates to the user
63
    that the system is available for re-programming if 
63
    that the system is available for re-programming if 
64
    necessary.  This works because the data lines on the
64
    necessary.  This works because the data lines on the
65
    OV6620 are still tri-stated at this point, but won't
65
    OV6620 are still tri-stated at this point, but won't
66
    be for long after this function returns.
66
    be for long after this function returns.
67
	Inputs:  none
67
	Inputs:  none
68
	Outputs: none
68
	Outputs: none
69
***********************************************************/	
69
***********************************************************/	
70
void DebugInt_init(void)
70
void DebugInt_init(void)
71
{
71
{
72
	/* set PortD pin6 for output */
72
	/* set PortD pin6 for output */
73
	DDRD  |= 0x40;
73
	DDRD  |= 0x40;
74
	/* turn on LED */
74
	/* turn on LED */
75
	PORTD |= 0x40;
75
	PORTD |= 0x40;
76
    Utility_delay(500);
76
    Utility_delay(500);
77
    PORTD &= 0xBF;
77
    PORTD &= 0xBF;
78
    Utility_delay(500);
78
    Utility_delay(500);
79
    PORTD |= 0x40;
79
    PORTD |= 0x40;
80
    Utility_delay(500);
80
    Utility_delay(500);
81
    PORTD &= 0xBF;
81
    PORTD &= 0xBF;
82
    Utility_delay(500);
82
    Utility_delay(500);
83
    PORTD |= 0x40;
83
    PORTD |= 0x40;
84
    Utility_delay(500);
84
    Utility_delay(500);
85
    PORTD &= 0xBF;
85
    PORTD &= 0xBF;
86
    Utility_delay(500);
86
    Utility_delay(500);
87
    PORTD |= 0x40;
87
    PORTD |= 0x40;
88
}
88
}
89
 
89