Issues getting setup to work consistently

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First let me apologize for this lengthy set of questions but I plan to make a WIKI when I figure this all out so that others won't have to search through all the forums that I have already done. I'm having trouble with the AVR Studio software using it to establish connection via ISP to an Atmel ATTiny45. Here is a description of the set-up including the connections and a schematic. I'm using a windows 7 operating system that is 64 bit, an AVR Dragon, a repurposed computer power supply that is supplying an external target with a reliable 5 volts, a standard USB cable for the connection between the Dragon and the computer, and finally some pre-made 6" M/F jumper wires from Sparkfun to create the ISP cable linking the Dragon to the external target which has been placed in a standard bread board. The exact version of the AVR Studio is (version 4.18 build 700), this is due to the fact that I read a previous forum that was titled [url= https://www.avrfreaks.net/index.p... Doesn't work Dragon [SOLVED] wiring problem [/url] and posted on Nov 9,2010 which stated that the problem that I'm having was resolved by not including SP3 for AVR Studio. This did not help in my case though but I see no reason to go back to SP3 because the problem existed with that installed as well. The ISP connections were obtained for the ATTiny45 from the following directory: AVR Studio4/help/AVR Tools user guide/AVR Dragon user guide/introduction/device support. This showed the HVPP, dw(debugWIRE), and ISP wiring set-ups. My schematic was as follows:

The code that was used was just to do the simple LED blink program and I was able to put this on the chip when the programming mode worked once.

 #include 

int main(void)
{
  // Set Port B pins as all outputs
  DDRB = 0xff;

  // Set all Port B pins as HIGH
  PORTB = 0xff;

  return 1;
}

I have done nothing to the connections or the circuit and am now unable to get the Dragon to go into programming mode. As discussed in the forum that I have already mentioned earlier I'm only able to get the test set-up to go into programming mode very inconsistently which leads me to believe that I'm doing something fundamentally wrong with the connection set-up between the Dragon and the chip or maybe my operating system is causing an issue. I've seen the following information in the help as well about the fuse bits availability in the different programming modes.

I have the greyed out box that also includes the red question mark in the bottom corner. If I'm not mistaken when I'm in ISP programming mode for the Dragon, I should see a grey out box that means that I'm prevented from accidentally messing up the chip by incorrectly programming the fuse bite for the SPIEN but there should not be a red question mark meaning the chip can't read the fuse bit either. Is this correct logic or not? I'm wondering if this is why I have so much trouble getting the programmer to enter programming mode. Also I've verified that I have the correct voltage being seen by the dragon in order for it function correctly. I'm using the internal oscillator on the ATTiny45 with the factory settings that have it at 8MHz with a divisor of 8 taking it down to a 1MHz clock with the longest available start-up. This means that the fuse bits would be set as follows.

This image was taken from http://www.engbedded.com/fusecalc/ , and verified by looking at the full PDF of the ATTiny45 datasheet in the relevant sections. I know that I'm suppose to set the ISP in AVR Studio to be ¼ the clock frequency and have placed that value at all of the values that fall under that ¼ value stipulation to no avail. I also noticed that the I have no way to get the AVR Studio to not automatically try to establish the programming mode when I go to the fuse tab as hex values 0xff, 0xff, 0xff for the low, high, and extended when first trying to establish connection. When I go to the fuse bit tab right after establishing a good connection to the dragon I always have the ISP mode help window pop up immediately saying the usual helpful hints suggestions. After this initial failure is when I change the values so that they are correctly matching the value of the fuses seen above. Is there any way to prevent this from occurring when I use the AVR chip icon or the con chip icon in the AVR Studio environment? Or does it not matter if this initial incorrect value is attempting to program. It seems to always fail but I'm curious how I'm getting the red question mark in the SPIEN box when I don't see it in other peoples screen shots in other forum post. I initially had this problem with an ATMega328P and found a forum that said that parallel programming could not be done using the dragon even though it states in the Atmel site and in AVR Studio that it is possible. So I switched to the ATTiny45 in order to forgo having to parallel program the 328P and find out that it isn't possible to reset the fuses which I assumed was causing the programming mode failure with my dragon. The ATTiny45 is now giving me the same problem and although I haven't read anything about it not being able to support parallel programming with the dragon, I would rather solve this mystery without having to go down that route. So any help would be greatly appreciated. Please let me know if I left anything out in this description and I'll get back with you immediately with the details. Thanks again.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The normal, and simple, test for verifying programmer connectivity is to repeatedly, and successfully, read the chip signature bytes...and do endless tweaking until you can :)

What happens if you try that?

...and you have a problem with your code - you should never return from main() in an AVR (put a "while (1){}" at the end so you go into an infinite loop) and the definition is normally "void main(void)" to match this. But that's probably not your immediate problem...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to AVRFreaks.
I must have just developed ADD (attention deficit disorder) or I have regressed to a being a y gener. I just don't seem to be able to get my head around that post! I haven't figured out what the issue is.

Quote:
First let me apologize for this lengthy set of questions

Preemptive apology accepted, but a concise statement of issue would be better.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?