I was using an external 16MHz clock. But now I am able to use the internal 8MHz clock.
I will explain it in detail so others may benefit from it.
I was trying to execute the commands I saw from tutorials online For example,
avrdude -c usbtiny -p m328p -U efuse:w:0x07:m
When I tried pasting this in my Command Prompt application, it failed.
Thanks to using the verbose script while uploading, as suggested by @b707 , I could see what commands are being used by avrdude, (see image).
I simply copy-pasted the avrdude commands in my notes when uploading multiple sketches and observed a pattern. There was an essential command line that kept repeating no matter what program tried to upload. I called it the "Essential Bit". Which for me looked as follows:
C:\Users\FlexGuest\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\FlexGuest\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200
Note: This is specific to my use case with Arduino Mega 2560 as ISP to program a bare ATMEGA328P chip on the breadboard connected to my PC. It will be different for other individuals.
Then I copy-pasted this Essential Bit before every command I wanted to execute from the tutorials. Below are some examples
For brown-out disable from this forum:
avrdude -c usbtiny -p m328p -U efuse:w:0x07:m
became
C:\Users\FlexGuest\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\FlexGuest\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -U efuse:w:0x07:m
For using Internal 8MHz clock from the same forum:
avrdude -c usbtiny -p m328p -U lfuse:w:0xE2:m
became
C:\Users\FlexGuest\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\FlexGuest\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -U lfuse:w:0xE2:m
Note: I had burned the bootloader of my ATMEGA328P to that of 'Arduino Pro or Pro Mini' at '3.3V 8MHz' using Mega 2560 as ISP through Arduino IDE. This was done before executing commands in Command Prompt. Not sure if that changes anything.
Hope it helps all.
Kind regards,
Raj