Hi
I have a standard Atmega328P 28 pin which is all going great on 3.3v @ 8MHz and goes into deep sleep of 0.002mA.
So I want to put the program into a 28MI size chip.
- First loaded program and the CPU, ran very slow. Think it is set to standard clock at 1MHz
- Load bootloader into 28MI
- Program runs, but sleep is 0.188mA
I think it might have something to do with the hardware in Arduino see below, but I am unsure.
Also I have pasted the sleep code FYI
Thanks in advance
James
unoat8.name=Arduino Uno Targeted for 8 MHz
unoat8.upload.protocol=arduino
unoat8.upload.maximum_size=30256
unoat8.upload.speed=57600
unoat8.bootloader.low_fuses=0xff
unoat8.bootloader.high_fuses=0xde
unoat8.bootloader.extended_fuses=0x05
unoat8.bootloader.path=optiboot
unoat8.bootloader.file=optiboot_atmega328.hex
unoat8.bootloader.unlock_bits=0x3F
unoat8.bootloader.lock_bits=0x0F
unoat8.build.mcu=atmega328p
unoat8.build.f_cpu=8000000L
unoat8.build.core=arduino
unoat8.build.variant=standard
void CPU_Sleep()
{
Serial.end(); // Shut down serial port
MCUCR = bit (BODS) | bit (BODSE);
MCUCR = bit (BODS);
PRR = 0xff; // Power reduction mode
sleep.pwrDownMode(); //set sleep mode, deeeeeep sleeep
sleep.sleepInterrupt(1,FALLING); //sleep intill....INT starts falling LOW, eg a new TAG is touched or switch to ground
// WAKE up from change in interrupt, either by TAG or button going on
PRR = 0x00; // Set up
Serial.begin(9600); // Set up serial port
}