last day (15 days later) » 

14:56
0
Q: Atmega328 standalone not working unless Pin1 connected to Arduino RESET

AndreiMusatI'm new into this domain field. My principal occupation is as a .NET developer. I'm trying to do a personal project in which a AtMega328 takes some output from a scale using HX711 and sends a SMS via SIM800L GSM module. Before creating the whole module I tested each part separately with Arduino a...

Are you sure you connect the button correctly? the button switch should be normal-open (and only close when press it). Are you happened to connect it as normal-close?
The simple circuit (with pull-up resistor and a button for pulling Reset low), like in your topmost breadboard, should just work. Make sure you have not rotated the button by 90 degrees (permanently connecting Reset to ground).
What working by connecting to Arduino is because the FDTI chip on the Arduino generate a DTR signal trough a capacity that temporarily pull down the RESET pin for USB boatload.
Where are your bypass capacitors? Not having those can cause some weird problems. As a rule of thumb, I use a 10µF and a 0.1µF capacitor, between Vcc and GND, as close the the MCU as possible.
@StarCat, it's wired correct, i tested the button pins with multimeter to see continuity
@hcheung, I know that, the switch is normally open and when pressed it closes the power connection
14:56
@AndreiMusat, I agree with Gerben that it's probably a good idea to put a 100nF bypass capacitor between pins 7 and 8 of the ATMega328. The current Reset circuit should work fine without external "help". It's possible that your fuses were programmed incorrectly but that should not have happened (and still does not explain why your ATMega only resets when connected to the Arduino Uno board).
@Gerben, in this case what kind of caps should i use, ceramic caps? Also, is there any specific order how shall I wire them near VCC-GND of Atmega? Leaving this aside, I have another LM2596, shall I use it as a first power regulator, then power atmega and the other Lmb2596 which i'm using for SIM800?
I don't understand, what exactly isn't working here. Is your program on the Atmega not running? How do you know, that it doesn't run at all? Or is the Atmega not resetting, when you press the button? Or do you have problems with programming the Atmega (I guess you are doing it through the Arduino as ISP)?
@chrisl, the Atmega is not running, reset on atmega does nothing, except the fact that is powering off the additional led that I connected. I connected the RX and TX pins into Arduino whitout Atmega328 to do Serial monitoring on the Standalone PCB, it doesn't do anything. The moment i wire Arduino_RESET with PIN1 on ATmega it starts working
So you have somewhere an LED, that is not shown in your wiring diagram, connected to a digital output pin, which you - I guess - blink with the standard blink sketch? And the blinking only starts, when you connect both resets together?
@chrisl, the LED is connected directly to Atmega_REST_button(VCC and GND pins). It's alywas ON, IF i press the button then it goes OFF, the normal behaviour. The problem is that ATMEGA doesnt execute the code that I uploaded. With the button attached to the PCB I cannot even upload a sketch to Atmega. As soo nas I desolder the reset button the upload and Serial Monitoring are working again. With the button desoldered, the program only executes if Arduino_RESET is connected to PIN1
14:56
What is the "Atmega_REST_button(VCC and GND pins)"? Have you connected the LED to the RESET pin? Please insert the LED into your wiring diagram.
@chrisl, tomorrow, I will upload a new picture
@AndreiMusat I'd go for ceramic (at least for the 0.1µF), as they have a lower ESR. Not sure what you mean with order, but you put the lowest value closest to the MCU. I wouldn't add another LM2596. You could choose to run the ATMega at 3.3V instead of 5V, but then you'd need to use a slower crystal. I don't think there is any real advantage here to run at 3.3V instead of 5V.
Also, are you still working on a breadboard, or do you use the custom PCB? As the PCB doesn't even have a pullup resistor on the RESET pin.
@Gerben, what do you mean by thtat, it's marked on the photo with R1. A simple 10K resistor. Do I need to user other type of resistor?
Later Edit, I designed a new PCB schema to be in 2 layers. I have a question, from where shall I put GND and VCC to ResetButton/PIN1, Before or after decoupling caps?
Please try to remove the LED from the reset pin. The voltage over the LED (which is the same as the voltage on the reset pin) will not be 5V. It will be equal to the forward bias of the LED.
@chrisl, thank you from this piece of information, but my question remains, from where should i power the PIN1, before or after the decoupling caps?
14:56
I would say after, but that's not critical I think. Does the program run now, where you disconnected the LED?
I don't know at the moment, I'm at work, I will desolder the led when I get home
 
3 hours later…
18:10
@chrisl, @Gerben, @StarCat, @hcheung, Topic solved. I didn't have too many types of capacitors in my closet. The only ones I have are 10uF. I put one as close as possible near Atmega and solved the issue. Thank you very much

last day (15 days later) »