Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Interupt Ttiny

2009-04-20 by Jim Wagner

On Apr 19, 2009, at 6:18 PM, Guido Helmstetter wrote:

>
>
> Hi from newby
> In the GIMSK data page it says "activity on the pin will cause  
> interupt even if INT0 is configured as output".
> My program  is counting to a preset number and then goes to sleep,  
> until woken up by pushing INT0 (pullup 10K).
>
> Two thing happen when DDRB PB2 as input. then the led is not on  
> (cause of the querie, well I like it to be on),  switch works fine  
> goes back to the routine and to sleep etc.
> When DDRB as output then it works like GIMSK was set PCIE, interupt  
> happens on level change PB2. (PCMSK is not set).
>
> Question is : Can chip be woken up with the INT0 pin, all leds  
> functioning. Do I have to use the RESET pin instead?
> Is there a clash in the GIMSK register when all set as output.
>
> This is my initialization:
>
> ldi temp,1<<INT0
> out GIMSK,temp
> ldi temp, 1<<CS02 | 1<<CS00
> out TCCR0B, temp
>  ldi temp, 1<<ISC00   ;level change on pin
> out MCUCR, temp
>
> ldi temp, 0xff
>  out DDRB, temp
>  ser temp
>  out PORTB,temp   ;set Port
> sei
>
> The new Internet Explorer 8 optimised for Yahoo!7: Faster, Safer,  
> Easier.
>
> [Non-text portions of this message have been removed]
>
>
> 
It is basically very bad to try to apply an input (which a switch IS)  
to a pin that is set as an output!

The statement you quote refers to the fact that IF one of those pins  
has an enabled interrupt, the interrupt will be triggered even if it  
is configured as an output and you cause the output level to change by  
program action. This is NOT the case with many interrupt inputs.

Jim Wagner
Oregon Research Electronics

[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.