Using the XTAL pins for something other than external oscillator?

I am wondering if I can use the XTAL pins for something else then an external oscillator on the atmega328P-PU if I bootload it with the Lillypad bootloader (which uses the inner oscillator). If its possible, what is the pin mapping to it?

Just wondering,
thanks

Hmmm.

What does the datasheet say? Try pages 26 and/ or 83.

I gather these pins can be used as general I/O pins if you disable the oscillator function appropriately in the fuses.

Why you would ever want to do so is another question. :smiley:

E_HVC:
I am wondering if I can use the XTAL pins for something else then an external oscillator on the atmega328P-PU if I bootload it with the Lillypad bootloader (which uses the inner oscillator).

Yes.

PS: If you have a device to write a bootloader then you don't need a bootloader (you can use one if you want but you don't need it).

E_HVC:
If its possible, what is the pin mapping to it?

The datasheet has the pinout of the chip.

Arduinos don't have them connected to the headers on the board, obviously. If you want to use an Arduino Uno (for example) you'd have to remove the crystal then solder wires to the bottom of the board.

Hey sorry for such a long wait on the response. So I do think I can use the xtal pins based on the atmega328 data sheet. My set up is an atmega328P-PU on a breadboard, it does not have an external oscillator. My issue is that im using the arduino IDE for programming it. When I write in the program digitalWrite (13, HIGH) it doesn't turn on pin 14 according to the atmega328 data sheet, it turns on pin 19 according to the atmega data sheet.

It is very easy to find the pin mapping that arduino has used just googling it, but I cant find anything for the xtal pins, probably because almost every uses an external oscillator.

if anyone knows what I would call those XTAL pins in the arduino environment, let me know!

Thanks

I doubt that you can refer to those pins using the Arduino API as nobody ever uses them for IO, certainly not the official boards anyway, so they won't be defined as required for digitalWrite() et al.

Use direct port manipulation.


Rob

Awesome. Thanks, I'll have to research direct port manipulation but that sounds like what I will have to do.