Changeset 6390cc3 in avrstuff for libs/usart/usart.c


Ignore:
Timestamp:
Sep 24, 2017, 7:39:05 PM (7 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
6c47e45
Parents:
9a9d5d0
git-author:
Adrien Destugues <pulkomandy@…> (24/09/2017 17:13:58)
git-committer:
Adrien Destugues <pulkomandy@…> (24/09/2017 19:39:05)
Message:

chiptest: Start to hack on ATmega128 and STK500 devboard.

  • Set the proper clock for it (generated by the STK500 master MCU, did

not get crystal working reliably yet)

  • Instead of just 'H', generate the whole alphabet for more action!
  • Use ATmega128 since that's what happens to be seated on my board for

now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libs/usart/usart.c

    r9a9d5d0 r6390cc3  
    66#ifndef BAUD
    77        #error You must define BAUD to use libuart.
     8#endif
     9
     10#ifdef __AVR_ATmega128__
     11// FIXME there are two USARTs in this case and we should be able to drive either
     12#define UBRRH UBRR0H
     13#define UBRRL UBRR0L
     14#define UCSRA UCSR0A
     15#define UCSRC UCSR0C
     16#define UCSRB UCSR0B
     17#define UDR   UDR0
    818#endif
    919
     
    2939#ifdef __AVR_ATtiny2313__
    3040        UCSRC = (1 << UCSZ1) | (1 << UCSZ0);
     41#elif defined __AVR_ATmega128__
     42        UCSRC = (3 << UCSZ0);
    3143#else
    3244        UCSRC = (1 << URSEL) | (3 << UCSZ0);
Note: See TracChangeset for help on using the changeset viewer.