ATMEGA 168PA PIN CHANGE Interrupt PCINT18

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does Pin Change Interrupt PCINT18 (enabled) wakeup the micro controller from Power Down Mode ?

This topic has a solution.
Last Edited: Tue. Feb 21, 2017 - 06:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there really a chip called ATmega128PA ?

 

There is an ATmega128A - however it only has INT0..INT7. There are no PCINTs (pin change).

 

There is an ATmega1284P (up to the 64K chip there is even ATmega644PA but as far as I know there is no "PA" version of the 128 K chip) - the 1284P has pin change interrupts. If this is the chip you mean then in the chapter on sleep there is:

 

 

That shows that Pin Change can be used as a wakeup source in all sleep modes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry It is not ATmega 128PA it is Atmega 168PA.

Last Edited: Fri. Feb 17, 2017 - 05:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry It is not ATmega 128PA it is Atmega 168PA.

What does the datasheet say?

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes sir, Data Sheet says that Pin change interrupt wake up the micro controller from power down mode. But I got doubt because ,

the following table says that the Pin change interrupt can wake up the micro controller from idle mode also.

But in page no 94 , it is saying that pin change interrupt cannot wakeup the micro controller from idle mode.

 

Like the above example I have a doubt that did i miss anything from data sheet about that PIN  PD2 (PCINT18/INT0) which has both INT0 and PCINT18. Actually we are using that pin PD2 as wakeup source and we would like to use pin change interrupt instead of INT0 because as mentioned below the table only level interrupt can wakeup the micro controller. Could you please again confirm that PD2 (PCINT18) pin change interrupt can wakeup the micro controller from power down mode.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Raja Koteswara Rao wrote:
it is saying that pin change interrupt cannot wakeup
"Cannot"?? I suggest you read that AGAIN. The text says:

 

"This implies that these interrupts CAN be used for waking"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is IDLE mode also an sleep mode ? Does this mode require wakeup signal ? If requires which wakeup sources can wakeup the micro controller ?

 

What does the below statements implies?

 

The Pin Change Interrupt Request 2 (PCI2) will trigger if any enabled PCINT[23:16] pin toggles. The Pin
Change Interrupt Request 1 (PCI1) will trigger if any enabled PCINT[14:8] pin toggles. The Pin Change
Interrupt Request 0 (PCI0) will trigger if any enabled PCINT[7:0] pin toggles. The PCMSK2, PCMSK1 and
PCMSK0 Registers control which pins contribute to the pin change interrupts. Pin change interrupts on
PCINT are detected asynchronously. This implies that these interrupts can be used for waking the part
also from sleep modes other than Idle mode.

The External Interrupts can be triggered by a falling or rising edge or a low level. This is set up as
indicated in the specification for the External Interrupt Control Register A (EICRA). When the External
Interrupts are enabled and are configured as level triggered, the interrupts will trigger as long as the pin is
held low. Note that recognition of falling or rising edge interrupts on INT requires the presence of an I/O
clock. Low level interrupt on INT is detected asynchronously. This implies that this interrupt can be used
for waking the part also from sleep modes other than Idle mode.
The I/O clock is halted in all sleep modes
except Idle mode.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh I see what you mean - that is an error. The table is definitive - PCINTs can wake it from any sleep mode.

 

(as a quick experiment will no doubt prove to you! ;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much for solving my issue.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Oh I see what you mean - that is an error.

I don't see that as an error.  In Idle, the clock is still running so asynchronous operation isn't needed. 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess - but it kind of depends how you read it. Like OP I'd just read that entire sentence as if it were saying that PCINT was not available as a wakeup from Idle.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

I guess - but it kind of depends how you read it. Like OP I'd just read that entire sentence as if it were saying that PCINT was not available as a wakeup from Idle.

There is the "also" in there.

 

I'm not a grammarian.  The chart is pretty straightforward.  Indeed, to add more context the sentence in question seems to me to be a follow-on to the description of Idle and other modes in the Power Management and Sleep Modes chapter, which speaks of which clocks are active and what interrupts can be asynchronous.  If one happened to read/study that chapter first and then work on the paragraph in question I don't see any conflict.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see, yes it is a bit of an awkward sentence.  Were I an Atmel Microchip technical writer, I might have said:

This implies that these interrupts can be used for waking the part not only from Idle mode, but also from sleep modes without an active clock.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]