I am a little bit confused, that's why I decided it's best to ask the pros.
I'd like to reduce current consumption of my uC/pcb. First of all, after more reading, I plan to reduce it by dropping the external crystal oscilator (16Mhz, CKOPT on). I believe that 8Mhz or maybe even 4Mhz, supplied by internal oscilator are going to be enough. The 3% errors that I read about might be acceptable.
However, I have read about different power modes which allow to shut down different parts (like ADC/USART etc.)
The problem is that the board is made for sensor monitoring and therefore uses the ADC and sends the data over USART. I was wandering wether I could make a reading every 1 sec and "sleep" in between (eventually even shutting down the ADC while sleeping).
The board can also receive commands via USART (regarding the channels to monitor and the sampling frequency). So, I think there is no way you shut down USART and still be able to receive an USART interrupt right?
I really don't know for which sleep mode to go, and not sure how to do it. Your advice will be most welcome.
If you'd like me to post code, I don't have anything against it. Anyway, the system does this:
-periodical readings of specified ADC channels (period is established using a TIMER interrupt)
-USART transmission of the read values right after the reading is done
-USART receiving of commands (interrupt)to set samplig sequence (affects timer compare value), and monitored channels
- storage of settings in EEPROM right after USART comand is received and applied.
- loading of settings from EEPROM when (re)booting.
The software system uses short interrupts which set flags and these flags are checked in the main, infinite loop. Only if a flag is set will things happen (like ADC readings, USART reading etc).
I find it to be a decent system architecture, but please consider that this is my first ever program for uC.
Taking measures to also reduce power consumption would make it much better. Please advice.