mega128 Port G question

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

Hi all.

I am using a mega128 (NO mega103 compatibility mode). I have a few SPI slaves to connect but also want to use the Timer/Counter0 pin (and later maybe Time/Counter1 pins) on port B so the plan is to use port G (pins 3+4 at the moment) for the chip select signals (they would otherwise remain unused and we all hate to waste precious I/O pins, don't we ;) )

I think I remember something about the port G being "slower" than the other "full" ports but my forum search foo has failed on me. Or maybe it was even another port on one of the other AVR chips that I am thinking of... Don't remember it, sorry.

The chip runs at 7.3728 MHz and the SPI clock is set to 115.2 KHz (f/64), so sending one Byte takes roughly 70 us. Is that too fast for the port G logic?

I could as well just wire it all up and test it but it would be great if one of the fellow freaks could point me to the right documentation on that.

Thanks,

Ingo

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

Quote:
I think I remember something about the port G being "slower" than the other "full" ports but my forum search foo has failed on me

Never heard that before. Wonder what they meant by that?

But I guess there is a small truth in it. PORTF and PORTG registers (and DDRG, PING, DDRF) are outside of the 0x00..0x3F I/O address range so can only be accessed with STS and not OUT which, therefore, costs a cycle more. All other PORT registers are in range of IN/OUT (and so is PINF in fact)