Subversion Repositories Projects

Rev

Rev 902 | Rev 1437 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 902 Rev 932
Line 22... Line 22...
22
#include <avr/io.h>
22
#include <avr/io.h>
23
#include <avr/interrupt.h>
23
#include <avr/interrupt.h>
24
#include <util/delay.h>
24
#include <util/delay.h>
25
#include "usart0.h"
25
#include "usart0.h"
26
 
26
 
-
 
27
#ifdef SERIALDEBUGDRAW
-
 
28
#define USART0ENABLE 1
-
 
29
#endif
27
#ifdef ANTENNATRACKTEST 
30
#ifdef ANTENNATRACKTEST
-
 
31
#define USART0ENABLE 1
-
 
32
#endif
-
 
33
 
-
 
34
 
-
 
35
 
-
 
36
#ifdef USART0ENABLE
28
 
37
 
29
 
38
 
30
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
39
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
31
 
40
 
32
 
41
 
Line 44... Line 53...
44
    // Enable receiver and transmitter; enable RX interrupt
53
    // Enable receiver and transmitter; enable RX interrupt
45
    UCSR0B = (1 << RXEN0) | (1 << TXEN0) | (1 << RXCIE0);
54
    UCSR0B = (1 << RXEN0) | (1 << TXEN0) | (1 << RXCIE0);
46
 
55
 
47
    //asynchronous 8N1
56
    //asynchronous 8N1
48
    UCSR0C = (1 << URSEL0) | (3 << UCSZ00);
57
    UCSR0C = (1 << URSEL0) | (3 << UCSZ00);
-
 
58
 
-
 
59
 
-
 
60
    DDRD |= (1 << DDD1); // set TXD pin as output
-
 
61
    PORTD &= ~(1 << PORTD1); // disable pullup on TXD pin
49
}
62
}
50
 
63
 
51
 
64
 
52
/**
65
/**
53
 * send a single <character> through usart1
66
 * send a single <character> through usart1
Line 99... Line 112...
99
 
112
 
100
 
113
 
101
 
114
 
102
#endif
115
#endif
103
 
116
 
104
#endif // ANTENNATRACKTEST 
117
#endif // USART0ENABLE