Revision 547
EXPLOSION! aka the boards are now testable and hopefully won't explode next time.
ConstantCharging.c currently has the frequency hack
the two data files are real battery tests
ConstantCharging.c | ||
---|---|---|
1 | 1 |
#include <avr/io.h> |
2 |
#include <avr/io.h> |
|
3 | 2 |
#include <avr/interrupt.h> |
4 | 3 |
#include <avr/sleep.h> |
5 | 4 |
#include "ring_buffer.h" |
... | ... | |
23 | 22 |
#define SW0 PA6 |
24 | 23 |
#define HOMING_PIN PA7 |
25 | 24 |
|
26 |
#define DEBUG 1 |
|
27 |
#define USE_I2C 1
|
|
25 |
#define DEBUG 1 //enable I2C outputs of form time, OCR, current, voltage, temp
|
|
26 |
#define USE_I2C 0
|
|
28 | 27 |
|
29 | 28 |
|
30 | 29 |
#define MAX_T 300 |
... | ... | |
455 | 454 |
|
456 | 455 |
/* Trickle Charge */ |
457 | 456 |
if(status==1) |
458 |
OCR1B = 128;
|
|
457 |
OCR1B = 206;
|
|
459 | 458 |
} |
460 | 459 |
/* NO CONTACT */ |
461 | 460 |
else |
... | ... | |
564 | 563 |
i2c_init(); |
565 | 564 |
i2c_putpacket(0x01,"I2C init'd on ARCHS\r\n", 21); |
566 | 565 |
delay_ms(500); |
566 |
#else |
|
567 |
#if DEBUG |
|
568 |
i2c_init(); |
|
569 |
#endif |
|
567 | 570 |
#endif |
568 | 571 |
|
569 | 572 |
|
... | ... | |
740 | 743 |
{ |
741 | 744 |
wait(2); //wait a bit so we know the ouput gets set (which happens at timer = 0) |
742 | 745 |
|
743 |
TCNT1 = 0;//156; // start out at 156. Now OCR1B - 156 = duty cycle
|
|
746 |
TCNT1 = 156; // start out at 156. Now OCR1B - 156 = duty cycle |
|
744 | 747 |
} |
745 | 748 |
|
746 | 749 |
ISR(PCINT_vect){;} //so the interrupt doesnt go to the reset vector |
Also available in: Unified diff