Project

General

Profile

Revision 399f7d1b

ID399f7d1bbc8102e5b1859f12ce0a1ec7daeb821d
Parent 887b4a1a
Child c2b64420

Added by Thomas Mullins over 11 years ago

Changed sonar/bom timer to 64 prescalar

Also fixed bug in the bom's timer usage, where it depended on an integer
overflow that was no longer occuring due to the higher F_CPU.

View differences:

scout_avr/src/range.cpp
12 12
 * 
13 13
 * 37.5ms * 8 MHz / 8 prescaler = 37500 max wait
14 14
 * 37.5ms * 16 MHz / 8 prescaler = problem
15
 * 37.5ms * 16 MHz / 64 prescaler = 9375 max wait
15 16
 */
16 17

  
17 18
struct range_t {
......
64 65
  // enable INT2 and INT3
65 66
  EIMSK |= _BV(INT2) | _BV(INT3);
66 67
  
67
  // CS1 = 2, 1/8 prescaler
68
  // CS1 = 3, 1/64 prescaler
68 69
  // if this is changed, remember to change recv_edge in bom.cpp!
69
  TCCR5B = _BV(CS51);
70
  TCCR5B = _BV(CS50) | _BV(CS51);
70 71

  
71 72
  // set tx as output
72 73
  DDRG |= _BV(DDG1);

Also available in: Unified diff