Go Down

Topic: Timming wrong uploading sketch with USBASP Programmer (Read 1 time) previous topic - next topic

salomaocj

I'm trying to upload the sketch in a ATMEGA328P with a USBASP programmer.
Below I´ll describe my procedures:
In a prototype board the following connections in ATMEGA328P was made:
5V - pins 7 and 20
GND - pins 8 and 22
10k resistor to VCC - pin 1
16MHz crystal and 22pF capacitors to GND - pin 9 and 10
USBASP Programmer  - pin 19 (SCK), 18 (MISO), 17 (MOSI), 1 (RESET) and GND
In  Arduino IDE  I did the following selections:
Board - Arduino UNO
Programmer - USBASP
Upload with Programmer
Apparently Sketch has been successfully load but the timing does not work properly, eg. the blinking LED (1s on and 1s off) in the arduino r3 board  is about 10x slower ( 10s on and 10s off) in the prototype board with ATMEGA328P upload by USBASP Programmer.

I tried another alternative, in preferences.txt I copied the following configuration:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

usbasp328.name = [usbasp] ATmega328
usbasp328.upload.using = usbasp
usbasp328.upload.maximum_size = 32768
usbasp328.build.mcu = ATMEGA328P
usbasp328.build.f_cpu = 16000000L
usbasp328.build.core = arduino
usbasp328.build.variant = standard

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
And selected board - [usbasp] ATmega328
The result was the same, the timing was still 10x slower.
How can I solve this problem?

john1993

looks like you forgot to set the fuses so your new chip is running at the factory default of 1mhz instead of arduino 16mhz. easiest way to do this is follow steps for burning bootloader. even if you dont use the bootloader this will set the fuses. or do it with averdude commands, but be very careful, it is #1 way people "brick" their chips.

Go Up