AVR Bootloader (avrboot cleanup)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3KB

  1. #ifndef _MEGA162_H_
  2. #define _MEGA162_H_
  3. /* Part-Code ISP */
  4. // documented code (AVR109 AppNote) but not supported by AVRProg 1.40
  5. // #define DEVTYPE_ISP 0x62
  6. // fake ATmega16 instead:
  7. #define DEVTYPE_ISP 0x74
  8. /* Part-Code Boot */
  9. // documented code but not supported by AVRProg 1.40
  10. // #define DEVTYPE_BOOT 0x63
  11. // fake ATmega16:
  12. #define DEVTYPE_BOOT 0x75
  13. #define SIG_BYTE1 0x1E
  14. #define SIG_BYTE2 0x94
  15. #define SIG_BYTE3 0x04
  16. #ifndef UART_USE_SECOND
  17. #define UART_BAUD_HIGH UBRR0H
  18. #define UART_BAUD_LOW UBRR0L
  19. #define UART_STATUS UCSR0A
  20. #define UART_TXREADY UDRE0
  21. #define UART_RXREADY RXC0
  22. #define UART_DOUBLE U2X0
  23. #define UART_CTRL UCSR0B
  24. #define UART_CTRL_DATA ((1<<TXEN0) | (1<<RXEN0))
  25. #define UART_CTRL2 UCSR0C
  26. #define UART_CTRL2_DATA ((1<<URSEL0) | (1<<UCSZ01) | (1<<UCSZ00))
  27. #define UART_DATA UDR0
  28. #else
  29. #define UART_BAUD_HIGH UBRR1H
  30. #define UART_BAUD_LOW UBRR1L
  31. #define UART_STATUS UCSR1A
  32. #define UART_TXREADY UDRE1
  33. #define UART_RXREADY RXC1
  34. #define UART_DOUBLE U2X1
  35. #define UART_CTRL UCSR1B
  36. #define UART_CTRL_DATA ((1<<TXEN1) | (1<<RXEN1))
  37. #define UART_CTRL2 UCSR1C
  38. #define UART_CTRL2_DATA ( (1<<URSEL1) | (1<<UCSZ11) | (1<<UCSZ10))
  39. #define UART_DATA UDR1
  40. #endif
  41. #endif // #ifndef _MEGA162_H_