// thermo3_skel.c // R. Traylor // 11.15.2011 //Implements a digital themometer with an LM73. //For use with a mega128 board. //Uses interrupts for TWI. //PD0 is SCL. //PD1 is SDA. //10K pullups are present on the board. #include #include #define F_CPU 16000000UL #include #include #include #include "lcd_functions.h" #include "lm73_functions.h" #include "twi_master.h" char lcd_string_array[16]; //holds string for the LCD uint8_t i; //general purpose index //declare the external variables for the lm73 data buffers extern uint8_t ............... extern uint8_t ............... //********************************************************************** // spi_init //Initalizes the SPI port on the mega128. Does not do any further //external device specific initalizations. //********************************************************************* void spi_init(void){ DDRB |= 0x07; //Turn on SS, MOSI, SCLK //mstr mode, sck=clk/2, cycle 1/2 phase, low polarity, MSB 1st, no interrupts SPCR=(1<