/Designs/Measuring_instruments/AWS01A/SW/PIC16F887/main.c
64,20 → 64,17
{
unsigned int16 seq=0;
 
/* setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1);
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_CLK_OUT);
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
/* setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard
setup_oscillator(OSC_8MHZ);
setup_wdt(WDT_1152MS|WDT_DIV_16);
setup_spi(SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_64);
output_high(CSN_SPI);
// enable_interrupts(INT_TIMER1);
// enable_interrupts(INT_TIMER0);
// enable_interrupts(GLOBAL);
 
*/
delay_ms(100);
87,6 → 84,10
sht_init();
MPL_init(); // get correction coefficients from the sensor
 
// enable_interrupts(INT_TIMER1); // interrupts used for anemometer readings
// enable_interrupts(INT_TIMER0);
// enable_interrupts(GLOBAL);
 
while (TRUE)
{
char output[8]; // Output buffer