void LCD_init(void)
{
LCD_DATA_DDR|=LCD_DATA;
LCD_EN_DDR|=LCD_EN;
LCD_RS_DDR|=LCD_RS;
LCD_RW_DDR|=LCD_RW;
LCD_RW_PORT&=~LCD_RW; //RW=0
LCD_write_command(0x28);
#if 0
LCD_en_write();
delay_nus(40);
LCD_write_command(0x28);
LCD_write_command(0x0c);
LCD_write_command(0x01);
delay_nms(2);
#endif
}
void init_devices(void)
{
//stop errant interrupts until set up
CLI(); //disable all interrupts
port_init();
timer0_init();
LCD_init();
time1_init();
time2_init();
INT_init();
TIMSK |= BIT(2);
TIMSK |= BIT(0);
TIMSK |= BIT(6);
SEI(); //re-enable interrupts
//all peripherals are now initialized
}
void main(void)
{
int counter = 0;
int i;
int stop_count = 0;
//MCUCSR &= ~BIT(4);
MCUCSR |= BIT(7);
MCUCSR |= BIT(7);
//vInitEeprom();
uart0_init();
init_devices();
//EECR |= BIT(EERIE);
DUTY1=50;
DUTY2=50;
addr = 1;
while (1)
{
delay_ms (10);
}
}