[SOLVED]Atmega 328P reset to start



  • Hello

    I just get a Atmega 328P in DIL package. It was configured with external 16Mhz clock.

    I set up it with internal 8mhz and minicore bootloader with Arduino IDE and Arduino as ISP
    Here is the configuration I used
    conf2.png
    Burning the bootloader works well. I follow this guide for wiring, and I add a led on D13 with a 1k resistor to GND.

    After burning the bootloader, the led was blinking as usual. I was happy 🙂

    But, after that, I unplug the arduino as ISP, the clock source, and replug only power source. The led was not blinking anymore. 😠

    I replug the arduino as ISP (not the clock), and use AVRDUDESS to read fuse, and miracle the led restart to blink 😁
    Here is the fuses readed
    conf.png
    I unplug everything again, and replug only power source ... no blink 😳 . And I don't know why, I try to send reset (GND to Reset Pin), and blink started.

    I've tested it and retested it, the led don't start to blink until I send reset.

    Any ideas of why I need to reset to start the arduino ? Is there any fuse or lock that configure it ? Something I miss ?

    Thank you for your help



  • Did you check the voltage on the reset pin? Might be a faulty pullup connection on the reset pin, if your circuit is on a breadboard.



  • Hello

    I have 4.8V on the reset pin (directly mesured on the DIL package). I use a 10k pullup resistor.
    The atmega was on a single board with uno bootloader before. It was working great, and the reset pin was not connected at all (only vcc/gnd/D2/D4 and clock where connected before I put it on the breadborard)

    I've tried with 10k resistor, without resistor (reset floating), with caps. Always the same thing



  • @barrydou said in Atmega 328P reset to start:

    Hello

    I just get a Atmega 328P in DIL package. It was configured with external 16Mhz clock.

    I set up it with internal 8mhz and minicore bootloader with Arduino IDE and Arduino as ISP

    Whne you burn MiniCore does the led flash TWICE every second? You said the LED was flashing "as usual" - thatis normally ONE blink per second.

    You do have an externa crystal (16MHz as you said) connected for the ATmega?
    The Atmega need external crystal for programming sketch...



  • @skywatch
    Yes after flashing MiniCore, the led flash twice per second.
    If I keep only VCC, GND, pullup on Reset and the led on D13, I unplug / replug the power => Nothing, until I force a reset (GND on Reset pin)
    When I force, the led flash twice per second (even without clock, but the fuses are set to 8Mhz Internal)



  • @barrydou said in Atmega 328P reset to start:

    @skywatch
    Yes after flashing MiniCore, the led flash twice per second.

    That is good!

    If I keep only VCC, GND, pullup on Reset and the led on D13, I unplug / replug the power => Nothing, until I force a reset (GND on Reset pin)

    How are you removing the power and for how long? Try 30 seconds before reconnect.....

    When I force, the led flash twice per second (even without clock, but the fuses are set to 8Mhz Internal)

    That is contradictory - it is not 'without clock' if the fuses are set to 8MHx internal - it has 8MHz internal clock running.....OR maybe I mis-understand?



  • @skywatch said in Atmega 328P reset to start:

    @barrydou said in Atmega 328P reset to start:

    @skywatch
    Yes after flashing MiniCore, the led flash twice per second.

    That is good!

    If I keep only VCC, GND, pullup on Reset and the led on D13, I unplug / replug the power => Nothing, until I force a reset (GND on Reset pin)

    How are you removing the power and for how long? Try 30 seconds before reconnect.....

    I unplug the vcc dupond cable from breadboard (beetween power source and breadboard). And I plug it again.
    Before this message, I unplug during a few seconds. I try 1 minute now, it's the same.

    When I force, the led flash twice per second (even without clock, but the fuses are set to 8Mhz Internal)

    That is contradictory - it is not 'without clock' if the fuses are set to 8MHx internal - it has 8MHz internal clock running.....OR maybe I mis-understand?

    Sorry, I mean without external clock. I remove external Quartz and Caps just after flashing the minicore



  • @barrydou Intereting - I have flashed MiniCore with 8MHz internal, loaded the sketch, removed the xtal and it works as expected.... So no clue what is different with your experience...



  • I've just found it !

    I added a 100nf caps between VCC and GND, just near pin 7 and 8, like documented on the MiniCore github page.
    https://github.com/MCUdude/MiniCore => DIP-28 package ATmega8/48/88/168/328

    And now, it's work as expected. I just plug VCC and GND, and the led blink twice per second.

    Don't know why, but it's OK 😀

    Thank you for all your ideas



  • @barrydou Well done, good job!

    When in doubt, read the manual! - Easy in hindsight, isn't it? 😉



  • @skywatch Yes ... RTFM ... So simple 😁





Suggested Topics

63
Online

11.4k
Users

11.1k
Topics

112.6k
Posts