Hi guys,
I have code here which basically does some operands, checks the validity of results and lights up a led sequence and moves onto the next operand in between a delay.
each operand is run x amount of times for integrity.
I am wondering is it feasible to have a sleep routine which puts the atmega328 to sleep after each operand is done, and to wake up and do the next operand etc.. ie: replace the delays with a sleep routine.?
I can use a wdt/interrupt etc to wake it up i assume?
I am interested in doing a power consumption comparison between case a/ and case b/.
thanks for listening.
I have code here which basically does some operands, checks the validity of results and lights up a led sequence and moves onto the next operand in between a delay.
each operand is run x amount of times for integrity.
I am wondering is it feasible to have a sleep routine which puts the atmega328 to sleep after each operand is done, and to wake up and do the next operand etc.. ie: replace the delays with a sleep routine.?
I can use a wdt/interrupt etc to wake it up i assume?
I am interested in doing a power consumption comparison between case a/ and case b/.
thanks for listening.
Rich (BB code):
int main (void)
{
int repeat = 0;
//SetSystemClockPrescaler(2);
while(1) // repeat all functions 3 x times
{
for(repeat = 0; repeat < 4; repeat++){
array(); // run array function
_delay_ms(3000);
reset_d();
}
for(repeat = 0; repeat < 3; repeat++){
pwm_led(); // run PWM Led function
_delay_ms(3000);
reset_d();
}
for(repeat = 0; repeat < 3; repeat++){
maths(); // run Math function
_delay_ms(3000);
reset_d();
}
for(repeat = 0; repeat < 3; repeat++){
simpsons(); // run simpson algorithm
_delay_ms(3000);
reset_d();
}
for(repeat = 0; repeat < 3; repeat++){
newton_sqrt(20); // run newton rhapson for square root of 20
_delay_ms(3000);
reset_d();
}
// sleep_mode();
}
return (1);
}