-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a AtMega328p from another Arduino device #20
Comments
Thanks for the useful material, this doc do the same thing in another approach https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoToBreadboard/ |
Or from the comments inside the source code
|
I was upload without set fuse nor use minicore to set internal clock but just sodering chip on this board, |
I had my boards assembled with the Atmega already on them. Is there a way to do what GreatScott did in his video with a function generator? I can not seem to be able to get the bootloader to sync. Is it only possible to do it with an external clock or taking one from an existing Arduino? |
You need to follow the setup at above to enable built-in clock.
For your circumstance, you need a external clock to do this setup work. after that, you won't need external clock. |
So after some research, I found how to set the 328p fuse to use the internal clock in case you want to repurpose an Arduino with a suitable chip like a lilypad, or nano or something similar. You need to set this fuse back to factory because Arduinos by default get switched to an external clock instead of it's internal one.
You will need to hook up the Arduino on the ICSP headers, and use another Arduino programmed as an Arduino as ISP to program the target 328p board.
And you need to set the fuse prior to de-soldering the chip from the Arduino to use in the solder reflow plate. Otherwise you will not be able to program it from the ICSP headers once on the solder reflow plate.
Using this command you can set the fuse to tell the Arduino to use the internal clock:
~/AppData/Local/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino18/bin/avrdude.exe \ -PCOM8 \ -v \ -patmega328p \ -cstk500v1 \ -PCOM8 \ -b19200 \ -C avrdude.conf \ -U lfuse:w:0xF2:m
The command broken down:
# The COM port where the Arduino as ISP can be found -PCOM8
# Verbose output -v
# The target chip -patmega328p
# The programmer avr should use -cstk500v1
# The baud rate as set in the Arduino as ISP sketch uploaded to the programming Arduino -b19200
# The avrdude.conf, this may not be in the same directory as the command. -C avrdude.conf
# The action to perform, in this case we are setting the LFUSE to `0xF2` by writing the value to configure the 328p to use the internal clock. -U lfuse:w:0xF2:m
Hope this helps someone.
A great video explaining this, and what got me to an answer:
https://www.youtube.com/watch?v=Q2DakPocvfs
The text was updated successfully, but these errors were encountered: