Rev 31 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 31 | Rev 32 | ||
|---|---|---|---|
| 1 | /********************************************************************* |
1 | /********************************************************************* |
| 2 | * |
2 | * |
| 3 | * Compiler specific |
3 | * Compiler specific |
| 4 | * |
4 | * |
| 5 | ********************************************************************* |
5 | ********************************************************************* |
| 6 | * FileName: compiler.h |
6 | * FileName: compiler.h |
| 7 | * |
7 | * |
| 8 | * Author Date Comment |
8 | * Author Date Comment |
| 9 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
9 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 | * Johan Böhlin 21-10-06 Original (Rev 1.0) |
10 | * Johan Böhlin 21-10-06 Original (Rev 1.0) |
| 11 | ********************************************************************/ |
11 | ********************************************************************/ |
| 12 | 12 | ||
| 13 | #ifndef COMPILER_H |
13 | #ifndef COMPILER_H |
| 14 | #define COMPILER_H |
14 | #define COMPILER_H |
| 15 | 15 | ||
| 16 | #include <p18cxxx.h> |
16 | #include <p18cxxx.h> |
| 17 | #define CLOCK_FREQ (40000000) // Hz |
17 | #define CLOCK_FREQ (40000000) // Hz |
| 18 | #define INSTR_FREQ (CLOCK_FREQ/4) |
18 | #define INSTR_FREQ (CLOCK_FREQ/4) |
| 19 | #define CLOCK_FOSC (40) // MHz |
19 | #define CLOCK_FOSC (40) // MHz |
| 20 | 20 | ||
| 21 | #define UART_BAUD_RATE (19200) // bps |
21 | #define UART_BAUD_RATE (19200) // bps |
| 22 | 22 | ||
| 23 | #define SPBRG_VAL ( ((INSTR_FREQ/UART_BAUD_RATE)/16) - 1) |
23 | #define SPBRG_VAL ( ((INSTR_FREQ/UART_BAUD_RATE)/16) - 1) |
| 24 | 24 | ||
| 25 | #if (SPBRG_VAL > 255) |
25 | #if (SPBRG_VAL > 255) |
| 26 | #error "Calculated SPBRG value is out of range for currnet CLOCK_FREQ." |
26 | #error "Calculated SPBRG value is out of range for currnet CLOCK_FREQ." |
| 27 | #endif |
27 | #endif |
| 28 | 28 | ||
| 29 | #define LED0_TRIS (TRISCbits.TRISC1) |
29 | #define LED0_TRIS (TRISCbits.TRISC1) |
| 30 | #define LED0_IO (PORTCbits.RC1) |
30 | #define LED0_IO (PORTCbits.RC1) |
| 31 | 31 | ||
| 32 | #define UART_START_BYTE 253 |
32 | #define UART_START_BYTE 253 |
| 33 | #define UART_END_BYTE 250 |
33 | #define UART_END_BYTE 250 |
| 34 | 34 | ||
| - | 35 | #define UART_READ_TIMEOUT 30000 |
|
| 35 | 36 | ||
| 36 | #endif //compiler.h |
37 | #endif //compiler.h |
| 37 | 38 | ||