/Designs/HAM Constructions/SDRX01B/SW/timemark/main.c
1,16 → 1,12
#include "main.h"
 
#define LED1 PIN_E0 // RMC
#define LED2 PIN_E1 // 10s
#define LED3 PIN_E2 // PPS
#define LED4 PIN_A5 // Fix
#define LED1 PIN_E0
#define LED2 PIN_E1
#define SYNC_OUTPUT PIN_E2
 
#define SYNC_OUTPUT PIN_A0
 
int1 sync;
int8 sec;
 
// Interrupt from B0
#int_EXT
void EXT_isr(void)
{
18,40 → 14,37
{
output_high(SYNC_OUTPUT);
output_toggle(LED2);
delay_us(5);
delay_us(2);
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_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_wdt(WDT_2304MS|WDT_DIV_16);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
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;
 
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(INT_EXT);
enable_interrupts(GLOBAL);
setup_oscillator(OSC_8MHZ|OSC_TIMER1|OSC_31250|OSC_PLL_OFF);
 
while(true)
{
sync=0;
//Example blinking LED program
while(true)
{
while (getch()!='$');
if (getch()!='G') continue;
if (getch()!='P') continue;
66,21 → 59,8
getch();
output_toggle(LED1);
sec=getch();
if ((sec=='9')) {sync=1; continue;}
getch();
getch();
getch();
getch();
getch();
if ('A'!=getch())
{
output_high(LED4); // Neni FIX
if (sec=='0') {sync=1;} // Extra click hlasi chybu
}
else
{
output_low(LED4);
}
}
if ((sec!='9')) continue;
sync=1;
}
 
}
/Designs/HAM Constructions/SDRX01B/SW/timemark/main.h
1,20 → 1,36
#include <16F887.h>
#include <18F4550.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
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES INTRC //Internal RC Osc
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //No brownout reset
#FUSES BORV20 //Brownout reset at 2.0V
#FUSES NOPUT //No Power Up Timer
#FUSES NOCPD //No EE protection
#FUSES STVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES PBADEN //PORTB pins are configured as analog input channels on RESET
#FUSES NOWRTC //configuration not registers write protected
#FUSES NOWRTB //Boot block not write protected
#FUSES NOEBTR //Memory not protected from table reads
#FUSES NOEBTRB //Boot block not protected from table reads
#FUSES NOCPB //No Boot Block code protection
#FUSES MCLR //Master Clear pin enabled
#FUSES LPT1OSC //Timer1 configured for low-power operation
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES PLL1 //No PLL PreScaler
#FUSES CPUDIV1 //No System Clock Postscaler
#FUSES USBDIV //USB clock source comes from PLL divide by 2
#FUSES VREGEN //USB voltage regulator enabled
#FUSES ICPRT //ICPRT enabled
 
#use delay(clock=8000000,RESTART_WDT)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt)
#use delay(clock=8000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
 
/Designs/HAM Constructions/SDRX01B/SW/timemark/main.hex
1,48 → 1,37
: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
:100280008C1E3F291A0864008C1E43291A0864003A
:100290008C1E47291A08413C0319572983168512D9
:1002A000831285162808303C031927145B2983160E
:0A02B000851283128512DE28630018
:04400E00EA2CFF3F5A
:0400000065EF00F0B8
:08000800046ED8CF05F0E0CF33
:1000100006F00001E9CF0CF0EACF07F0E1CF08F0DD
:10002000E2CF09F0D9CF0AF0DACF0BF0F3CF12F01C
:10003000F4CF13F0FACF14F0F5CF15F0F6CF16F099
:10004000F7CF17F000C00EF001C00FF002C010F0A3
:1000500003C011F0F2A830EF00F0F2B257EF00F059
:100060000EC000F00FC001F010C002F011C003F08C
:100070000CC0E9FF07C0EAFF078E08C0E1FF09C016
:10008000E2FF0AC0D9FF0BC0DAFF12C0F3FF13C0B2
:10009000F4FF14C0FAFF15C0F5FF16C0F6FF17C035
:1000A000F7FF045006C0E0FF05C0D8FF100019A0FC
:1000B00009D096948D8496928D7200D000D096943B
:1000C0008D941990F29230EF00F0F86AD09E078E6E
:1000D000EA6AE96A700ED36ED350B8960C0EAF6E12
:1000E000A20EAC6E900EAB6EC150C00B0F09C16E6C
:1000F000070EB46EC150C00B0F09C16EC090C09204
:10010000C094C09EC2809698C69A949E9380939203
:10011000010EC66E000EC76ED190800ED56ECD6AF0
:10012000000ECA6E000ECB6E9484BD6AB76AB66AC2
:10013000070EB46E9250926E060E006E002EFED721
:100140000000B450A19CB56AF288C00EF212710E84
:10015000D36E800E9B6ED35019909EAAFED7AE50E0
:100160002408FBE19EAAFED7AE50470801E0F5D770
:100170009EAAFED7AE50500801E0EFD79EAAFED748
:10018000AE50520801E0E9D79EAAFED7AE504D0806
:1001900001E0E3D79EAAFED7AE50430801E0DDD7C9
:1001A0009EAAFED7AE502C0801E0D7D79EAAFED754
:1001B000AE509EAAFED7AE509EAAFED7AE509EAAC3
:1001C000FED7AE509EAAFED7AE5096908D709EAAD6
:1001D000FED7AECF1AF01A50390801E0BED7198009
:0401E000BCD7030085
:020000040030CA
:0E00000020C9390E0087A1000FC00FE00F408D
:00000001FF
;PIC16F887
;CRC=26A2 CREATED="24-9-12 01:06"
;PIC18F4550
;CRC=262F CREATED="16-9-12 10:31"
/Designs/HAM Constructions/SDRX01B/SW/timemark/main.pjt
1,10 → 1,10
[PROJECT]
Target=C:\Users\kakl\Documents\MLAB\Designs\HAM Constructions\SDRX01B\SW\timemark\main.hex
Target=C:\Users\kakl\Documents\PIC\timemark\main.hex
Development_Mode=
Processor_Text=PIC16F887
Processor_Text=PIC18F4550
ToolSuite=CCS
Processor=0x887F
[C:\Users\kakl\Documents\MLAB\Designs\HAM Constructions\SDRX01B\SW\timemark\main]
Processor=0x4550
[C:\Users\kakl\Documents\PIC\timemark\main]
Type=4
Path=
FileList=
12,15 → 12,15
OptionString=
AdditionalOptionString=
[mru-list]
1=C:\Users\kakl\Documents\MLAB\Designs\HAM Constructions\SDRX01B\SW\timemark\main.c
1=C:\Users\kakl\Documents\PIC\timemark\main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Units]
Link=0
Count=1
1=C:\Users\kakl\Documents\MLAB\Designs\HAM Constructions\SDRX01B\SW\timemark\main
1=C:\Users\kakl\Documents\PIC\timemark\main
[Opened Files]
1=main.c
2=main.h
3=..\..\..\..\..\..\..\..\..\Program Files\PICC\Devices\16F887.h
3=
4=