Author Topic: Atmega lock up  (Read 8180 times)

0 Members and 1 Guest are viewing this topic.

Offline tim510Topic starter

  • Contributor
  • Posts: 13
Atmega lock up
« on: July 12, 2012, 03:54:56 pm »
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.
 

Offline hlavac

  • Frequent Contributor
  • **
  • Posts: 536
  • Country: cz
Re: Atmega lock up
« Reply #1 on: July 12, 2012, 05:17:14 pm »
My guess would be serial bootloader kicking in after reset.
Good enough is the enemy of the best.
 

Offline Erwin Ried

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Atmega lock up
« Reply #2 on: July 12, 2012, 07:59:54 pm »
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.

For 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
My website: http://ried.cl
 

Offline tim510Topic starter

  • Contributor
  • Posts: 13
Re: Atmega lock up
« Reply #3 on: July 12, 2012, 10:17:45 pm »
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.
 

Offline tim510Topic starter

  • Contributor
  • Posts: 13
Re: Atmega lock up
« Reply #4 on: July 12, 2012, 10:51:09 pm »
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.
 

Offline Erwin Ried

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Atmega lock up
« Reply #5 on: July 12, 2012, 11:40:58 pm »
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.

Well, 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 communication

Bootloader is the code that runs first, and allows you to program the board without ISP
My website: http://ried.cl
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Atmega lock up
« Reply #6 on: July 13, 2012, 12:48:15 am »
Just an idea...

The ATMEGA128's   RXD0 pin is right next to the PEN pin.
Quote
PEN is a programming enable pin for the SPI Serial Programming mode, and is internally pulled
high . By holding this pin low during a Power-on Reset, the device will enter the SPI Serial Programming
mode. PEN has no function during normal operation.

If 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.
« Last Edit: July 13, 2012, 01:24:33 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline tim510Topic starter

  • Contributor
  • Posts: 13
Re: Atmega lock up
« Reply #7 on: July 13, 2012, 02:12:13 am »
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 respectively
http://i5.photobucket.com/albums/y174/tim510/AVRminiV31.png
http://i5.photobucket.com/albums/y174/tim510/TinyTrack4tnc.png

*Edit: I put the same photo twice sorry
« Last Edit: July 13, 2012, 05:00:21 am by tim510 »
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Atmega lock up
« Reply #8 on: July 13, 2012, 02:27:28 am »
Connected to VCC is fine
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline tim510Topic starter

  • Contributor
  • Posts: 13
Re: Atmega lock up
« Reply #9 on: July 18, 2012, 02:16:56 pm »
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?

 

Offline Torrentula

  • Regular Contributor
  • *
  • Posts: 91
  • Country: de
    • My blog
Re: Atmega lock up
« Reply #10 on: July 19, 2012, 07:23:35 am »
Well you at least don't have issues with he 5V rail because it stays stable :)

Do 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.
 

Offline tim510Topic starter

  • Contributor
  • Posts: 13
Re: Atmega lock up
« Reply #11 on: July 19, 2012, 08:17:05 pm »
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:
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf