User manual
ECE 477 Final Report Spring 2004
data=rx_buffer1[rx_rd_index1];
if (++rx_rd_index1 == RX_BUFFER_SIZE1) rx_rd_index1=0;
#asm("cli")
--rx_counter1;
#asm("sei")
return data;
}
#pragma used-
// Write a character to the USART1 Transmitter
#pragma used+
void putchar1(char c)
{
while ((UCSR1A & DATA_REGISTER_EMPTY)==0);
UDR1=c;
}
#pragma used-
// Declare your global variables here
int lineh[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x01, 0x01, 0x01 };
int linel[] = { 0x00, 0x16, 0x2C, 0x42, 0x58, 0x6E, 0x84, 0x9A, 0xB0, 0xC6,
0xDC, 0xF2, 0x08, 0x1E, 0x34, 0x4A };
int button_press = 0;
void write_LCD(int Ao, int LCD_in)
{
PORTD.5 = Ao; // Ao
delay_us(0x01);
PORTD.6 = 0; // _Wr
PORTD.7 = 1; // _Rd
PORTC = LCD_in;
delay_us(1);
PORTD.6 = 1; // _Wr
PORTD.7 = 1; // _Rd
delay_us(1);
return;
}
void main(void)
{
// Declare your local variables here
int i, j, checksum;
char input[25];
// Crystal Oscillator division factor: 1
CLKPR=0x80;
CLKPR=0x00;
// Input/Output Ports initialization
// Port A initialization
// Func0=In Func1=In Func2=In Func3=Out Func4=In Func5=In Func6=In Func7=In
// State0=T State1=T State2=T State3=0 State4=T State5=T State6=T State7=T
PORTA=0x08;
DDRA=0x08;
// Port B initialization
// Func0=In Func1=In Func2=In Func3=In Func4=In Func5=In Func6=In Func7=In
// State0=T State1=T State2=T State3=T State4=T State5=T State6=T State7=T
F-10