I'm currently working on a project where I am writing to an LCD display using the ATmega128 micro. I have been unsuccessful at getting the LCD display to work, and I am suspecting that it is my delay functinos that are causing hte problem. Is there anything wrong with my initialization of the timer/counter or delay function?
//Initialization of timer/counter
void counter_init()
{
TCCR1A = 0X00;
TCCR1B = 0x04;
}
//Delay function
void delay(double cycle)
{
TCNT1 = 0;
while(cycle >= TCNT1);
{
}
}