I need some help to undestand somthing
firstly Im using MIKROC PRO FOR AVR
the LCD wich is using has no drive IC, thats mean I have to drive it directly
so /i tried to init all registers (datasheet)
but I dont know what I have to to more ^_^
thank you
Code: Select all
void InitChip ()
{
ADCSRA = 0x00; /// ADC is turned off.
MCUCR |= (1<<PUD); /// disable pull-up resistor
ADCSRB |= (1<<ACME); /// ADC is switched off
}
Code: Select all
void Init_GPIO ()
{
/// set all pins as outputs here
PORTA = 0x00; DDRA = 0xFF;
PORTB = 0x00; DDRB = 0xFF;
PORTC = 0x00; DDRC = 0xFF;
PORTD = 0x00; DDRD = 0xFF;
PORTE = 0x00; DDRE = 0xFF;
PORTF = 0x00; DDRF = 0xFF;
PORTG = 0x00; DDRG = 0xFF;
}
LCD INIT
Code: Select all
void Init_LCD ()
{
/// be sure to reset all LCD registers
LCDCRA = 0x00;
LCDCRB = 0x00;
LCDFRR = 0x00;
LCDCCR = 0x00;
LCDCRA |= (1<<LCDEN); /// LCD Enable 7
LCDCRA &= ~(1<<LCDAB); /// LCD Low Power Waveform 6
LCDCRA &= ~(1<<LCDIF); /// LCD Interrupt Flag 4
LCDCRA |= (1<<LCDIE); /// LCD Interrupt Enable 3
LCDCRA |= (1<<LCDBL); /// LCD Blanking 0 L
LCDCRB &= ~(1<<LCDCS); /// LCD Clock Select 7
LCDCRB &= ~(1<<LCD2B); /// LCD 1/2 Bias Select (1 1/2 --- 0 1/3) 6
LCDCRB |= (0x30); /// COM0:3
LCDCRB |= (0x03); /// SEG0:18 = 19
LCDFRR |= (0x60); /// clkLCD/2048
LCDFRR |= (0x01); /// 128Hz
LCDCCR |= (0xA0); /// 850us
LCDCCR &= ~(0x0F); /// 2.60V
PRR &= ~(1<<PRLCD); /// the LCD controller ON.
}
Code: Select all
void LCD_ISR () iv IVT_ADDR_LCD ics ICS_AUTO
{
}
void main ()
{
InitChip ();
Init_GPIO ();
void Init_LCD ();
while (1)
{
}
}