User manual
ECE 477 Final Report Spring 2004
// USART1 Transmitter: On
// USART1 Mode: Asynchronous
// USART1 Baud rate: 9600
UCSR1A=0x00;
UCSR1B=0x98;
UCSR1C=0x86;
UBRR1H=0x00;
UBRR1L=0x33;
/*
// USART0 initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART0 Receiver: On
// USART0 Transmitter: On
// USART0 Mode: Asynchronous
// USART0 Baud rate: 4800
UCSR0A=0x00;
UCSR0B=0x98;
UCSR0C=0x86;
UBRR0H=0x00;
UBRR0L=0x67;
// USART1 initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART1 Receiver: On
// USART1 Transmitter: On
// USART1 Mode: Asynchronous
// USART1 Baud rate: 4800
UCSR1A=0x00;
UCSR1B=0x98;
UCSR1C=0x86;
UBRR1H=0x00;
UBRR1L=0x67;
*/
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
// Analog Comparator Output: Off
ACSR=0x80;
// Global enable interrupts
#asm("sei")
OSCCAL = 0x5c;
while (1)
{
/* If rx_counter0 == 23 and rx_buffer_overflow0 == 0 then full
packet received from PC. Computer checksum for packet and transmit to
remote. */
if (rx_counter0 == 23) { //&& rx_buffer_overflow0 == 0) {
//Use get_char 24 times and xor bytes to compute checksum
//Transmit byte as you xor
//Transmit checksum
checksum = 0x0;
for (i = 0; i < 24; i++) {
F-6