Atmega lock up - Page 1
Forum section: electronics / general

author: tim510
author_rank: Contributor
timestamp: July 12, 2012, 03:54:56 pm
content: Hey guys,I'm working with an AVRminiV3.1 development board and a Tiny Track 4 tnc board. The microcontroller will lock up when I connect the two boards together. Not sure if it's a hardware setting/configuration or a code issue...The connections are 5 volts, ground, Tx(output pin of atmeage128) and Rx( input pin to atmega 128). The way that this has been worked around is if the Rx pin is initially high, right when the microcontroller is powered on. This is the only thing that works. I have tried using a pullup resistor to that pin but it will not work unless it's a straight short to 5 volts...What can be going wrong with this input pin to the microcontroller?Thanks.

author: hlavac
author_rank: Frequent Contributor
timestamp: July 12, 2012, 05:17:14 pm
content: My guess would be serial bootloader kicking in after reset.

author: Erwin Ried
author_rank: Regular Contributor
timestamp: July 12, 2012, 07:59:54 pm
content: Quote from: tim510 on July 12, 2012, 03:54:56 pmFor only serial data you don't need to share the 5V power, the bootloader issue it is a good guess, maybe the pins you are using affect the reset pin status

author: tim510
author_rank: Contributor
timestamp: July 12, 2012, 10:17:45 pm
content: I'm sharing the 5 volt pin to power the Tiny Track 4 tnc board by using one of the 5 volt port pins. Is this something not recommended?Is reset something that is initialized when powered on?Thanks for the info on bootloader, I will look into it as I have no clue what that is.

author: tim510
author_rank: Contributor
timestamp: July 12, 2012, 10:51:09 pm
content: Something I didn't mention is that the Tiny Track 4 tnc is using an atmega 644 and it's directly connected to the atmega 128 using RS232.

author: Erwin Ried
author_rank: Regular Contributor
timestamp: July 12, 2012, 11:40:58 pm
content: Quote from: tim510 on July 12, 2012, 10:17:45 pmWell, was just a guess, can you post a picture about your setup? I was telling you about sharing the 5V just because if the 2 boards where independently energized, the 5v line is not needed in the serial communicationBootloader is the code that runs first, and allows you to program the board without ISP

author: Psi
author_rank: Super Contributor
timestamp: July 13, 2012, 12:48:15 am
content: Just an idea...The ATMEGA128's RXD0 pin is right next to the PEN pin.QuoteIf PEN is shorted to RX somehow (solder bridge etc.) you might get odd issues where pen is pulled low by RX and it enters programming mode when you don't want that.Your work around of pulling RX high would stop this from occurring so is consistence with this kind of issue.So i'd get your DMM and make sure PEN isn't connected to anything or shorted to any nearby pins.

author: tim510
author_rank: Contributor
timestamp: July 13, 2012, 02:12:13 am
content: Hey Psi thanks for your input.I checked out the PEN pin but there is no connection to the Rx pin. I did find out that it is directly connected to Vcc pin though...I have attached the atmega 128 devboard reference and the Tiny Track 4 (TT4) schematic. The pictures show the pins that have been connected. On the TT4 the max232 chip has been removed. The max232 pin 13 and 14 are shorted to pins 11 and 12 respectively. Pin 13 and 14 are directly connected to pins (TXD0/PDO) PE1 and RXD0/(PDI) PE0 respectivelyhttp://i5.photobucket.com/albums/y174/tim510/AVRminiV31.pnghttp://i5.photobucket.com/albums/y174/tim510/TinyTrack4tnc.png*Edit: I put the same photo twice sorry

author: Psi
author_rank: Super Contributor
timestamp: July 13, 2012, 02:27:28 am
content: Connected to VCC is fine

author: tim510
author_rank: Contributor
timestamp: July 18, 2012, 02:16:56 pm
content: So I probed the pins with a scope and found captured the following when it is powered on:Input A and input B are Rx pin and 5 Volts respectively.Notice how the Rx pin sends some type of signal.This occurs within 15ms of powering on.Could this be an indication that it is going into the bootloader?Can timing be an issue here since the uCs are running on different clock frequencies?

author: Torrentula
author_rank: Regular Contributor
timestamp: July 19, 2012, 07:23:35 am
content: Well you at least don't have issues with he 5V rail because it stays stableDo you power on both boards at the same time? Do you have an idea when the data is being transmitted from the ATmega128 to the TT4?Timing can be an issue, depending on what frequency the ATmega644 is running at. If it's running at 16MHz it should be fine with a symbolrate up to 57600 baud.

author: tim510
author_rank: Contributor
timestamp: July 19, 2012, 08:17:05 pm
content: Yah, I'm power both boards at the same time. The Atmega644 is the one that transfers data within the first 15-20ms of powering on. Atmega128 has a 14MHz crystal and the Atmega644 has a 20MHz crystal.I reverted to the original TT4 board so I used the DB9 connection to the development board and I get the same lock up.The following is the schematic of the dev board DB9 serial connection P2:Here is the TT4 schematic showing its serial connection J2: