Yahoo Groups archive

AVR-Chat

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

Message

RE: [AVR-Chat] How to handle PCINT8-11 on ATMEGA644P

2010-04-10 by Ivan Vernot

Hello Roman,

I think your problem is you need to use the PINB reg not the PORTB.
Try

unsigned char x = PINB;

Please let us know how you get on
Regards,

Ivan Vernot


> -----Original Message-----
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
> Behalf Of ?????????? ????? ??????????
> Sent: Sunday, 11 April 2010 3:04 AM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] How to handle PCINT8-11 on ATMEGA644P
> 
> Hello!
> I build project on AVRStudio 4.16 and WinAVR.
> I try handle  high level on PCINT8-11.
> 
> PORTB=0x00;
> DDRB=0xF0;
> 
> EICRA=0x02;
> EIMSK=0x01;
> EIFR=0x01;
> PCMSK1=0x0F;
> PCICR=0x02;
> PCIFR=0x02;
> 
> ISR(PCINT1_vect)
> {
>   unsigned char x = PORTB;
>   if ((x & Bit(0)) == 1)
>   {
>      ...
>   }
>   if ((x & Bit(1)) == 1)
>   {
>     ...
>   }
>   if ((x & Bit(2)) == 1)
>   {
>     ...
>   }
>   if ((x & Bit(3)) == 0)
>   {
>      ...
>   }
> }
> 
> It doesn't work.
> Any idea?
> 
> --
> Best regards,
> Roman Antoshchenkov
> mailto:djantoxa@rambler.ru
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
>

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.