[Icc-avr] Interrupt Help Please (Happy New Year)

Andrew andrew_166 at msn.com
Thu Jan 3 12:37:30 PST 2008


Hi john,

i should have read that section in the datahseet kinda sick of looking at it 
though.

my sleep function is now as follows and i still have the same probelm: -

void sleep(void)
{
DF_Deep_Power_Down(); // Put DataFlash one in deep sleep
DF_Deep_Power_Down_2 (); // Put DataFlash two in deep sleep

TCCR1B = 0x00; // Stop timer
TIMSK1 = 0x00; // Disable Timer Intterupts

DDRB = 0x00; // Tri-State PORTB
DDRC = 0x00; // Tri-State PORTC
DDRD = 0x00; // Tri-State PORTD
PORTB = 0x00; // Make Sure the port is not pulled-up
PORTC = 0x00; // Make Sure the port is not pulled-up
PORTD = 0x00; // Make Sure the port is not pulled-up

SPCR = 0x00; // Power Down the SPI
UCSRB = 0x00; // Power Down The USART

REGCR = 0x01; // Disable the USB Regulator
RTC_POWER_OFF // Turn the Power too the RTC OFF (PORTD4)

EICRA = 0x08; // Change INT1 Pin Interrupt to Falling Edge (INT1)

PRR1 = 0x81; // Turn Off the USB and USART using the power reduction 
register

SMCR = 0; // Clear SMCR Register
SMCR = 0x05; // Configure Sleep Register for Deep Sleep
asm("sleep"); // Put Processor into Deep Sleep

}



7.12uA in sleep -> when the USB has never been connected to the system

120uA sometimes goes to 490uA in sleep mode -> after the USB has been 
connected once.



I have no idea why my sleep function funcrtions this way i guess more 
datasheet reading joy, could just leave the sleep mode and get on with the 
rest of the code and go for a bigger batttery :)



Andy

----- Original Message ----- 
From: "John Baraclough" <j_baraclough at zetnet.co.uk>
To: "Discussion list for ICCAVR and ICCtiny Users. You do NOT need 
tosubscribe to icc-announce if you are a member of this." 
<icc-avr at imagecraft.com>
Sent: Thursday, January 03, 2008 6:21 PM
Subject: Re: [Icc-avr] Interrupt Help Please (Happy New Year)


> Almost, but not quite. You need to do something with MCUCR as well. You 
> should read paragraph 11.2.3 on page 69 of the data sheet to find out 
> more.
>
> John
>
>
> Andrew wrote:
>> Hi
>>
>> How does one tri-state all the inputs?
>>
>> is this correct?
>>
>> PORTD = 0x00;
>> DDRD  = 0xFF;
>>
>> Andy
>>
>
> _______________________________________________
> Icc-avr mailing list
> Icc-avr at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-avr
> 



More information about the Icc-avr mailing list