0

I need to program a ATMega328P on a breadboard, running on an external crystal at 8 MHz.

All of the guides I can find either use the arduino environment and describe a 16 MHz config, or using the 8 MHz internal oscillator - which is too inaccurate for this project.

How do I do this? Configure the chip to run at 8 MHz and upload the program?

Glorfindel
5781 gold badge7 silver badges18 bronze badges
asked Jan 15, 2017 at 16:22
9
  • why don't you use the internal 8Mhz crystal? Commented Jan 15, 2017 at 16:28
  • Because I'm using serial communication with another device - the internal 8Mhz crystal is only rated as accurate within 10% at 25 degrees C. Serial communication tolerates an error of about half this. Commented Jan 15, 2017 at 16:37
  • There is no such thing as an internal 8 MHz crystal, just an 8 MHz RC oscillator. Commented Jan 15, 2017 at 16:42
  • I accept the correction that the on chip device isn't a crystal. Doesn't change the reason I can't use it :) Commented Jan 15, 2017 at 16:45
  • you forgot to ask a question. Commented Jan 15, 2017 at 16:50

1 Answer 1

2

myself as of 3 hours ago.

  1. Get an arduino or similar, install the ArduinoISP sketch
  2. Connect the two as described here.
  3. Change the board to Arduino Pro or Pro Mini, Processor to 3.3V, 8Mhz, Programmer: Arduino as ISP
  4. Hit burn bootloader button
  5. Load up the sketch that you want on the device
  6. Without changing anything, use "Upload using programmer"
  7. Remove arduino, fix wiring changes required to use as programmer

Committed to Electronics Stackexchange for posterity. Or so I can find it when I forget next time...

answered Jan 15, 2017 at 16:22

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.