Line -... |
Line 1... |
- |
|
1 |
/* |
1 |
#include <18F4550.h> |
2 |
#include <18F4550.h> |
2 |
#device adc=8 |
- |
|
3 |
|
3 |
|
4 |
#FUSES NOWDT //No Watch Dog Timer |
4 |
#FUSES NOWDT //No Watch Dog Timer |
5 |
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale |
5 |
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale |
6 |
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD) |
6 |
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD) |
7 |
#FUSES NOPROTECT //Code not protected from reading |
7 |
#FUSES NOPROTECT //Code not protected from reading |
Line 28... |
Line 28... |
28 |
#FUSES PLL12 //Divide By 12(48MHz oscillator input) |
28 |
#FUSES PLL12 //Divide By 12(48MHz oscillator input) |
29 |
#FUSES CPUDIV1 //System Clock by 1 |
29 |
#FUSES CPUDIV1 //System Clock by 1 |
30 |
#FUSES USBDIV //USB clock source comes from PLL divide by 2 |
30 |
#FUSES USBDIV //USB clock source comes from PLL divide by 2 |
31 |
#FUSES VREGEN //USB voltage regulator enabled |
31 |
#FUSES VREGEN //USB voltage regulator enabled |
32 |
#FUSES ICPRT //ICPRT enabled |
32 |
#FUSES ICPRT //ICPRT enabled |
- |
|
33 |
*/ |
- |
|
34 |
|
- |
|
35 |
#include <16F887.h> |
- |
|
36 |
#device adc=8 |
- |
|
37 |
|
- |
|
38 |
#FUSES NOWDT //No Watch Dog Timer |
- |
|
39 |
#FUSES HS //Internal RC Osc |
- |
|
40 |
#FUSES NOPUT //No Power Up Timer |
- |
|
41 |
#FUSES MCLR //Master Clear pin enabled |
- |
|
42 |
#FUSES NOPROTECT //Code not protected from reading |
- |
|
43 |
#FUSES NOCPD //No EE protection |
- |
|
44 |
#FUSES NOBROWNOUT //No brownout reset |
- |
|
45 |
#FUSES IESO //Internal External Switch Over mode enabled |
- |
|
46 |
#FUSES FCMEN //Fail-safe clock monitor enabled |
- |
|
47 |
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
- |
|
48 |
#FUSES NODEBUG //No Debug mode for ICD |
- |
|
49 |
#FUSES NOWRT //Program memory not write protected |
- |
|
50 |
#FUSES BORV40 //Brownout reset at 4.0V |
- |
|
51 |
|
- |
|
52 |
|
33 |
|
53 |
|
34 |
#use delay(clock=20000000) |
54 |
#use delay(clock=20000000) |
35 |
#use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8) |
55 |
#use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8) |
36 |
|
56 |
|
37 |
#define TDC_ENABLE PIN_B3 //enable pin for SPI communication with TDC |
57 |
#define TDC_ENABLE PIN_B3 //enable pin for SPI communication with TDC |