// TricklePower Mode ein- und ausschalten static uint8_t __attribute__ ((progmem)) st_msg[] = {0xA0,0xA2}; // Start Message // Trickle Power static uint8_t __attribute__ ((progmem)) tp_1s_msg[] = { 0x00,0x09, 0x97,0,0, 1,0x2C, 0,0,0x01,0x2C, 0x00,0xF1}; // 0,3s EIN; 1s Cycle (etwa 70mA) static uint8_t __attribute__ ((progmem)) tp_10s_msg[] = { 0x00,0x09, 0x97,0,0, 0,0x32, 0,0,0x01,0xF4, 0x01,0xBE}; // 0,5s EIN; 10s Cycle (etwa 10mA) // Set Low Power Acquisition Parameters - Message ID 167 static uint8_t __attribute__ ((progmem)) lp_para_msg[] = { 0x00,0x0F, 0xA7, 0x00,0x1B,0x77,0x40, 0x00,0x01,0xD4,0xC0, 0,0,0,0x3C, 0,0, 0x03,0x4A}; // MaxOffTime = 30min; MaxSearchTime = 2min; Adaptive TricklePower = off // Advanced Power Management - Message ID 53 //static uint8_t __attribute__ ((progmem)) lp_apm_msg[] = { // 0x00,0x0C, 0x35, 1,0,0x0A,0,3,7,0,0,1,2,0, 0x00,0x4D}; // APM = on; Cycle = 10s; 5% duty cycle static uint8_t __attribute__ ((progmem)) lp_apm_msg[] = { 0x00,0x0C, 0x35, 1,0,0x0A,0,3,7,0,0,0x0A,2,0, 0x00,0x56}; // APM = on; Cycle = 10s; 50% duty cycle // NMEA static uint8_t __attribute__ ((progmem)) nmea_msg[] = { 0x00,0x18, 0x81,2, 1,1,0,1,1,1,5,1,1,1,0,1,0,1,0,0,0,1,0,0,0x4B,0, 0x00,0xDE}; // zu NMEA umschalten (19,2 kBaud) static uint8_t __attribute__ ((progmem)) end_msg[] = {0xB0,0xB3}; // End-Message void GPS_NMEA(void) { uint8_t i; // nach NMEA rückschalten ... for(i=0; i<2; i++) uart_putc(pgm_read_byte(&st_msg[i])); for(i=0; i<28; i++) uart_putc(pgm_read_byte(&nmea_msg[i])); for(i=0; i<2; i++) uart_putc(pgm_read_byte(&end_msg[i])); } void GPS_TricklePower(uint8_t wie) { uint8_t i; // nach SiRF Binär umschalten ... uart_puts("$PSRF100,0,19200,8,1,0*39\r\n"); _delay_ms(200); // TricklePower einstellen ... for(i=0; i<2; i++) uart_putc(pgm_read_byte(&st_msg[i])); if(wie == 1) for(i=0; i<13; i++) uart_putc(pgm_read_byte(&tp_1s_msg[i])); else if(wie == 2) for(i=0; i<13; i++) uart_putc(pgm_read_byte(&tp_10s_msg[i])); for(i=0; i<2; i++) uart_putc(pgm_read_byte(&end_msg[i])); // Adaptive TricklePower off ... for(i=0; i<2; i++) uart_putc(pgm_read_byte(&st_msg[i])); for(i=0; i<19; i++) uart_putc(pgm_read_byte(&lp_para_msg[i])); for(i=0; i<2; i++) uart_putc(pgm_read_byte(&end_msg[i])); _delay_ms(200); // Advanced Power Management on ... for(i=0; i<2; i++) uart_putc(pgm_read_byte(&st_msg[i])); for(i=0; i<16; i++) uart_putc(pgm_read_byte(&lp_apm_msg[i])); for(i=0; i<2; i++) uart_putc(pgm_read_byte(&end_msg[i])); _delay_ms(200); // warten GPS_NMEA(); // nach NMEA rückschalten // uart_puts("$PSRF107,0,200,500*3A\r\n"); // 500ms ON, 20% Duty Cyle }