Port A and external clocks on tiny2313

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

Hi all,

I was wondering if it was possible to use port pin PA1 (on the XTAL2 line) on a tiny2313 while it is being driven on XTAL1 by an external clock.

The datasheet for the Mega168 says you can do that.
(pg. 77: "XTAL2: Chip clock Oscillator pin 2. ... When external clock is connected to XTAL1 this pin can be used as an I/O pin.")

The datasheet for the tiny2313 doesn't mention it.
(pgs. 26, 52)

Anyone tried this on a tiny2313?
Did it work?

S.

edited to fix Mega number. I meant 168, not 163

Last Edited: Fri. Feb 19, 2010 - 12:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes. You get XTAL2.

If you use an internal clock you get both XTAL pins.

Just try it and see.

David.

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

Hi David.

Close, but not quite what I wanted. I have to use an external clock because the internal one isn't fast enough (I'm running very close to 20MHz) and I wanted to use PA1 as generic I/O.

Does that work?

S.

PS - The external clock is a full-can oscillator, so I don't need Xtal2. S.

PPS - By 'am' and 'is' I mean 'I'm designing a system that wants to... S.

edited to add Post-postscript

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

Quote:
I have to use an external clock because the internal one isn't fast enough (I'm running very close to 20MHz) and I wanted to use PA1 as generic I/O.

Does that work?


Yes, read the section on "External Clock" in the "System Clock and Clock Options" section.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
Quote:
I have to use an external clock because the internal one isn't fast enough (I'm running very close to 20MHz) and I wanted to use PA1 as generic I/O.

Does that work?


Yes, read the section on "External Clock" in the "System Clock and Clock Options" section.

Hi Steve,

I did.

It quite specifically says that XTAL2 should be NC ("No Connect") when in the External Clock Drive Configuration (see Fig. 13).

This is true in both my original version of the spec sheet (rev. 2543F) and in the latest available from atmel.com (rev. 2543J).

In the specs for the Mega168 it does mention, under 'Alternate Port functions' that you can do this. It also shows in the equivalent figure that the Xtal2 pin is also a port pin. This is why I thought a tiny2313 might be able to do the same. But in no 2313 spec can I find this mentioned.

What am I missing?

S.

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

PS - In the original message, I meant 168. 163 is something else. S.

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

Aha. It does say you can in the 2313 A (!) spec, but not in the 2313 'not A' spec...

Can a 2313 NOT A do it?

S.

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

PS - And I still can't find it mentioned under 'External Clock'. It's mentioned under 'Alternate Port Functions' again. S.

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

It is far easier to just try it yourself.

I put a Tiny2313-20PU (signature 1E 91 0A) in the STK500.

[Edit} I had Int/Ext the wrong way round.
With Int 8MHz clock, I have PA0, PA1 flashing LEDs
With Ext 8MHz clock, I have PA1 flashing.

I do not have a Tiny2313A, but I would assume it does the same.

Note that you must use the AUX (weirdos) header to find PA0, PA1 on the STK500 since their main function is XT1, XT2 pins.

David.

Last Edited: Fri. Feb 19, 2010 - 04:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi David,

Yeah, you are correct in that trying it would have been simpler, but I managed to smoke my STK500 awhile back through incompatible power jumper settings. I was about to start breadboarding anyhow - But I thought I should ask if anyone knew the answer before trying.

Thank you very much for going through the effort of actually testing it.

The spec sheet for the 'A' version chip explicitly says you can.

S.

Edit: Postscript deleted. :)