/Designs/GPSnavigator/SW/GPS/GPS.aps
1,0 → 0,0
<AVRStudio><MANAGEMENT><ProjectName>GPS</ProjectName><Created>30-Jun-2008 09:31:04</Created><LastEdit>12-Aug-2008 13:34:22</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Jun-2008 09:31:04</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\GPS.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>c:\projekts\ATMEL_SW\ATMEGA644P\GPS\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>nmea_scan.c</SOURCEFILE><SOURCEFILE>lcd.c</SOURCEFILE><HEADERFILE>GPS.h</HEADERFILE><HEADERFILE>nmea_scan.h</HEADERFILE><HEADERFILE>lcd.h</HEADERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega644p</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>GPS.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS><OPTION><FILE>GPS.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>nmea_scan.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS><LIB>libm.a</LIB><LIB>libprintf_flt.a</LIB></LIBS><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=7372800UL -O1 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS>-Wl,-u,vfprintf</LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20071221\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20071221\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>GPS.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>GPS.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>nmea_scan.c</FileName><Status>1</Status></File00002></Files><Workspace><File00000><Position>192 71 1282 740</Position><LineCol>85 13</LineCol><State>Maximized</State></File00000><File00001><Position>230 117 1063 589</Position><LineCol>83 11</LineCol></File00001><File00002><Position>189 69 1279 711</Position><LineCol>272 0</LineCol></File00002></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
<AVRStudio><MANAGEMENT><ProjectName>GPS</ProjectName><Created>30-Jun-2008 09:31:04</Created><LastEdit>10-May-2009 00:17:39</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>30-Jun-2008 09:31:04</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\GPS.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\atmel\ATMEGA644P\home\GPS\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET></CURRENT_TARGET><CURRENT_PART></CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM></COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>nmea_scan.c</SOURCEFILE><SOURCEFILE>lcd.c</SOURCEFILE><HEADERFILE>GPS.h</HEADERFILE><HEADERFILE>nmea_scan.h</HEADERFILE><HEADERFILE>lcd.h</HEADERFILE><OTHERFILE>default\GPS.lss</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega644p</PART><HEX>1</HEX><LIST>1</LIST><MAP>0</MAP><OUTPUTFILENAME>GPS.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS><OPTION><FILE>GPS.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>nmea_scan.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS><LIB>libm.a</LIB><LIB>libprintf_flt.a</LIB></LIBS><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=7372800UL -O1 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS>-Wl,-u,vfprintf</LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20090313\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20090313\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/><sort sorted="0" column="0" ordername="0" orderaddress="0" ordergroup="0"/></IOView><Files><File00000><FileId>00000</FileId><FileName>GPS.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>GPS.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>nmea_scan.c</FileName><Status>1</Status></File00002></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
/Designs/GPSnavigator/SW/GPS/GPS.c
2,7 → 2,7
demo for LCD NOKIA5110 and MCP9800 and GPS modul
 
CPU ATMEGA644P
fcpu = 1MHz
fcpu = 7372800
 
!! define PIN,PORT,DDR for IOpin !!
*/
11,9 → 11,23
//************************************************************************
// defines
 
#define POINTNAME " DOMOV"
#define MY_LAT 48*60+57.7647
#define MY_LON 14*60+28.0836
 
/*
// 50°7'38.768"N, 13°32'43.132"E
#define POINTNAME " ORACOV"
#define MY_LAT 50*60+7.64613
#define MY_LON 13*60+32.7189
*/
/*
// 50°7'38.768"N, 13°32'43.132"E
#define POINTNAME " ZAMEK"
#define MY_LAT 50*60+6.191
#define MY_LON 13*60+32.118
*/
 
#define KEY_TIME_DEAD 5 //cca 50ms 8*5
//#define KEY_TIME_START_REPEAT 100 //cca 1s
//#define KEY_TIME_REPEAT 20 //cca 240ms
33,7 → 47,7
#define CLOCK5S 255;
#define CLOCK50MS 5
 
#define DEBUG
//#define DEBUG
 
//************************************************************************
//including
167,6 → 181,9
UCSR0B = _BV(RXCIE0) | _BV(RXEN0) | _BV(TXEN0);
 
//*** USART1 *** RX PD2, TX PD3 PC
DDRD |= _BV(PD3);
PORTD &= (~(_BV(PD3)));
 
#ifndef DEBUG
UBRR1 = 95;
#else
173,7 → 190,7
UBRR1 = 3;
#endif
//UCSR0A =
UCSR1B = _BV(RXCIE1) | _BV(RXEN0) | _BV(TXEN1);
UCSR1B = _BV(RXCIE1) | _BV(RXEN1) | _BV(TXEN1);
 
//*** ADC ***
ADMUX = _BV(REFS1) | _BV(MUX0);
255,6 → 272,7
 
ISR(USART1_RX_vect)
{
 
#ifndef DEBUG
UDR0 = UDR1;
#else
270,6 → 288,8
 
ISR(PCINT3_vect)
{
if (USB_PIN) USART_PC_ON;
else USART_PC_OFF;
if (!TL2_INPUT && USB_INPUT)
{
cli();
285,9 → 305,9
}
 
EMPTY_INTERRUPT(INT0_vect)
EMPTY_INTERRUPT(INT2_vect)
EMPTY_INTERRUPT(WDT_vect)
//EMPTY_INTERRUPT(INT0_vect)
//EMPTY_INTERRUPT(INT2_vect)
//EMPTY_INTERRUPT(WDT_vect)
 
//************************************************************************
// delay_ms functions /define fcpu /
885,7 → 905,7
printf("%4.0fm",gps.altitude);
 
gotoxy(7,2);
printf("go home");
printf(POINTNAME);
gotoxy(9,4);
if (temp < 10000)
1198,6 → 1218,7
GPS_OFF;
REF_OFF;
ADC_OFF;
USART_PC_OFF;
delay_ms(1000);
LED_OFF;
N5110_send_command(POWER_DOWN);
1222,6 → 1243,10
if (temp_wiev) temp();
 
}
 
if (USB_PIN) USART_PC_ON;
else USART_PC_OFF;
 
null_variables();
LCD_N5110_INIT();
displ_start();
1324,7 → 1349,8
LCD_N5110_INIT();
 
//set_static_navigation(0);
if (USB_PIN) USART_PC_ON;
else USART_PC_OFF;
stdout = &mystdout;
sei();
/Designs/GPSnavigator/SW/GPS/GPS.h
104,8 → 104,11
#define REF_INIT REF_DDR |= _BV(REF)
 
#define ADC_ON ADCSRA |= _BV(ADEN)
#define ADC_OFF ADCSRA &= ~(_BV(ADEN))
#define ADC_OFF ADCSRA &= ~(_BV(ADEN))
 
#define USART_PC_ON UCSR1B = _BV(RXCIE1) | _BV(RXEN1) | _BV(TXEN1)
#define USART_PC_OFF UCSR1B = 0
 
#define KEY1 0
#define KEY2 1
#define KEY3 2
/Designs/GPSnavigator/SW/GPS/N5110.h
0,0 → 1,91
/* mija 2008
defines for LCD NOKIA5110 (instruction set)
 
CPU ATMEGA16
fcpu = 1MHz
 
!! define PIN,PORT,DDR for IOpin !!
*/
 
#define LCD_WIDTH 84
#define LCD_HEIGHT 48
#define CHAR_WIDTH 6
 
// LCD SW
#define nSCLK PA6
#define nSCLK_PORT PORTA
#define nSCLK_DDR DDRA
 
#define nSDIN PA5
#define nSDIN_PORT PORTA
#define nSDIN_DDR DDRA
 
#define nDC PA4
#define nDC_PORT PORTA
#define nDC_DDR DDRA
 
#define nCS PA3
#define nCS_PORT PORTA
#define nCS_DDR DDRA
 
#define nRESET PA2
#define nRESET_PORT PORTA
#define nRESET_DDR DDRA
 
//interni
#define nSCLK_H nSCLK_PORT |= _BV(nSCLK)
#define nSCLK_L nSCLK_PORT &= (~(_BV(nSCLK)))
#define nSCLK_INIT nSCLK_DDR |= _BV(nSCLK)
 
#define nSDIN_H nSDIN_PORT |= _BV(nSDIN)
#define nSDIN_L nSDIN_PORT &= (~(_BV(nSDIN)))
#define nSDIN_INIT nSDIN_DDR |= _BV(nSDIN)
 
#define nDC_H nDC_PORT |= _BV(nDC)
#define nDC_L nDC_PORT &= (~(_BV(nDC)))
#define nDC_INIT nDC_DDR |= _BV(nDC)
 
#define nCS_H nCS_PORT |= _BV(nCS)
#define nCS_L nCS_PORT &= (~(_BV(nCS)))
#define nCS_INIT nCS_DDR |= _BV(nCS)
 
#define nRESET_H nRESET_PORT |= _BV(nRESET)
#define nRESET_L nRESET_PORT &= (~(_BV(nRESET)))
#define nRESET_INIT nRESET_DDR |= _BV(nRESET)
 
 
// FUNCTION SET
#define ACTIVE_CHIP 0x20
#define POWER_DOWN 0x24
#define H_ADDR 0x20
#define V_ADDR 0x22
#define BASIC_SET 0x20
#define EXTENDED_SET 0x21
 
// BASIC SET
#define DISPLAY_BLANK 0x08
#define DISPLAY_NORMAL 0x0C
#define DISPLAY_ALL_ON 0x09
#define DISPLAY_INV 0x0D
 
#define Y_SET 0x40 // | Y2..Y0
#define X_SET 0x80 // | X6..X0
 
// EXTENDED SET
#define TEMP_COEF 0x04 // | TC1|TC0
#define TEMP_COEF_0 0x04
#define TEMP_COEF_1 0x05
#define TEMP_COEF_2 0x06
#define TEMP_COEF_3 0x07
 
#define BIAS_0 0x10
#define BIAS_1 0x11
#define BIAS_2 0x12
#define BIAS_3 0x13
#define BIAS_4 0x14
#define BIAS_5 0x15
#define BIAS_6 0x16
#define BIAS_7 0x17
 
#define VOP 0x80 // | Vop6..Vop0