/Designs/Measuring_instruments/RMDS01A/SW/timemark/main.c
0,0 → 1,86
#include "main.h"
 
#define LED1 PIN_E0 // RMC
#define LED2 PIN_E1 // 10s
#define LED3 PIN_E2 // PPS
#define LED4 PIN_A5 // Fix
 
#define SYNC_OUTPUT PIN_A0
 
int1 sync;
int8 sec;
 
// Interrupt from B0
#int_EXT
void EXT_isr(void)
{
if (sync==1)
{
output_high(SYNC_OUTPUT);
output_toggle(LED2);
delay_us(5);
output_low(SYNC_OUTPUT);
sync=0;
}
output_toggle(LED3);
}
 
 
void main()
{
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_wdt(WDT_2304MS|WDT_DIV_16);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
 
 
output_low(SYNC_OUTPUT);
output_high(LED1);
output_high(LED2);
output_high(LED3);
 
sync=0;
 
enable_interrupts(INT_EXT);
enable_interrupts(GLOBAL);
 
while(true)
{
while (getch()!='$');
if (getch()!='G') continue;
if (getch()!='P') continue;
if (getch()!='R') continue;
if (getch()!='M') continue;
if (getch()!='C') continue;
if (getch()!=',') continue;
getch();
getch();
getch();
getch();
getch();
output_toggle(LED1);
sec=getch();
if ((sec=='9')) {sync=1; continue;}
getch();
getch();
getch();
getch();
// getch(); GPS01A ma A na 18. znaku, ne na 19.
if ('A'!=getch())
{
output_high(LED4); // Neni FIX
if (sec=='0') {sync=1;} // Extra click hlasi chybu
}
else
{
output_low(LED4);
}
}
 
}
/Designs/Measuring_instruments/RMDS01A/SW/timemark/main.hex
0,0 → 1,48
:1000000000308A004E280000FF00030E8301A1008B
:100010000A08A0008A010408A2007708A300780853
:10002000A4007908A5007A08A600831383120B1E8A
:100030001B288B182C28220884002308F70024088A
:10004000F8002508F9002608FA0020088A00210E89
:100050008300FF0E7F0E09008A110A122F28271C29
:100060004528831605108312051483168910023063
:100070008312890664000230F700F70B3D28402800
:1000800083160510831205102710831609110430FA
:10009000831289068B108A110A121B28840183138C
:1000A0001F3083058316031787110C300313990043
:1000B000A230980090308312980083160317090825
:1000C000C039890003131F129F12003003178800E4
:1000D0008312870188018901FF300313A900831669
:1000E00003170908C039890003131F129F1200303B
:1000F00003178800831203131F139F1383169F1384
:1001000083121F149412A9122908831687008312E0
:1001100029162908831687008312A9112908831636
:100120008700013083129400003083169400010888
:10013000C7390838810001308312031785000F305A
:10014000F700031381018130840083130008F03924
:100150000738800064000008F739F719F039770490
:10016000800090010030F800920000308316920069
:100170008312291529088316870083129701831695
:100180009B019C0101309D008312031787018801A8
:1001900089018316031305108312051083160910B5
:1001A0008312091483168910831289148316091186
:1001B0008312091527100B16C0308B0464008C1EA7
:1001C000DE281A08243C031DDE2864008C1EE52866
:1001D0001A08473C031DDE2864008C1EEC281A0810
:1001E000503C031DDE2864008C1EF3281A08523C84
:1001F000031DDE2864008C1EFA281A084D3C031DDE
:10020000DE2864008C1E01291A08433C031DDE28E9
:1002100064008C1E08291A082C3C031DDE2864008B
:100220008C1E0F291A0864008C1E13291A086400FA
:100230008C1E17291A0864008C1E1B291A086400DA
:100240008C1E1F291A088316091001308312890693
:1002500064008C1E28291A08A8002808393C031DB0
:1002600033292714DE2864008C1E33291A08640001
:100270008C1E37291A0864008C1E3B291A0864005A
:100280008C1E3F291A0864008C1E43291A08413C21
:100290000319532983168512831285162808303CCA
:1002A0000319271457298316851283128512DE2815
:0202B0006300E9
:04400E00EA2CFF3F5A
:00000001FF
;PIC16F887
;CRC=3FA8 CREATED="12-VI-13 23:09"
/Designs/Measuring_instruments/RMDS01A/SW/timemark/main.pjt
0,0 → 1,28
[PROJECT]
Target=main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
Processor=0x887F
[main]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
[mru-list]
1=main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Opened Files]
1=main.c
2=
3=16F887.h
4=
[Target Data]
OptionString=-p +FM
FileList=Z:\home\kaklik\svnMLAB\Designs\HAM Constructions\SDRX01B\SW\timemark\main.c
[Units]
Count=1
1=main (main)
/Designs/Measuring_instruments/RMDS01A/SW/timemark/main.h
0,0 → 1,20
#include <16F887.h>
#device adc=8
 
#FUSES WDT //Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES PUT //Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOCPD //No EE protection
#FUSES NOBROWNOUT //No brownout reset
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOWRT //Program memory not write protected
#FUSES BORV40 //Brownout reset at 4.0V
 
#use delay(clock=8000000,RESTART_WDT)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt)
 
/Designs/Measuring_instruments/RMDS01A/SW/timemark/readme.txt
0,0 → 1,0
Program pro PIC18F4550 pro nacitani PPS impulsu z GPS.