Project

General

Profile

Revision 649

The bay board library now compiles, usb communication has been verified. Next commit I will add the source, makefile, and hex for the bootloader. The main.c in charging_bay/main.c now has something I'm working on to be able to switch to bootloader by pushing the button

View differences:

serial.c
26 26

  
27 27
/**
28 28
 * @file serial.c
29
 * @brief Serial Input and Output
29
 * @brief Serial Input and Output for Bayboard
30 30
 *
31 31
 * Implementation of functions for serial input and output.
32 32
 *
......
48 48
void usb_init() {
49 49
  //Set baud rate
50 50
  // - 115200 (both wired and wireless) is UBRR=8, U2X=1
51
  // - 9600 is U2X =1, UBRR = 107.
51
  // - 9600 is U2X =1, UBRR = 103.
52 52
#if (USB_BAUD == 115200)
53
  UBRR0H = 0x00;
54
  UBRR0L = 8;
53
  UBRR0 = 8;
55 54
  UCSR0A |= _BV(U2X0);
56 55
#elif (USB_BAUD == 9600)
57
  UBRR0H = 0x00;
58
  UBRR0L = 103;
56
  UBRR0 = 103;
59 57
  UCSR0A |= _BV(U2X0);
60 58
#else //Baud rate is defined in the header file, we should not get here
61 59
  return;
......
82 80
void xbee_init() {
83 81
  //Set baud rate
84 82
  // - 115200 (both wired and wireless) is UBRR=8, U2X=1
85
  // - 9600 is U2X =1, UBRR = 107.
83
  // - 9600 is U2X =1, UBRR = 103.
86 84
#if (XBEE_BAUD == 115200)
87
  UBRR1H = 0x00;
88
  UBRR1L = 8;
85
  UBRR1 = 8;
89 86
  UCSR1A |= _BV(U2X1);
90 87
#elif (XBEE_BAUD == 9600)
91
  UBRR1H = 0x00;
92
  UBRR1L = 103;
88
  UBRR1 = 103;
93 89
  UCSR1A |= _BV(U2X1);
94 90
#else //Baud rate is defined in the header file, we should not get here
95 91
  return;

Also available in: Unified diff