Help in programming the Atmega1284 with maniacbug-mighty-1284p.

It was a passing comment by one (or a couple of) avrfreaks poster that apparently sought out ATMEL's help, he was told effectively to clean up his circuit layout.

This probably explains why Bob's boards "don't" show the problem.

oric_dan(333):

It was a passing comment by one (or a couple of) avrfreaks poster that apparently sought out ATMEL's help, he was told effectively to clean up his circuit layout.

This probably explains why Bob's boards "don't" show the problem.

That could very well be and I will add or subtract from that speculation when my 1284P chip finally arrives. :smiley:

Lefty

tack:
Uploading small sketches is fine. I can load the blink sketch via serial every time. It only manifests with larger sketches, even 20k sort of size.

In my tests, the synch problems manifest both with small (Blink) o large sketches. Simply, without RC filter the chip doesnt' respond to the data sent through the serial line.

retrolefty:
It was a passing comment by one (or a couple of) avrfreaks poster that apparently sought out ATMEL's help, he was told effectively to clean up his circuit layout.

Uhm. this has a sense for me. Since today, I've only tested the 1284P on a breadboard because I didn't want to make a board for the serial programming using the bootloader if I wasn't SURE that I could do that to upload a sketch.

Uhm. this has a sense for me. Since today, I've only tested the 1284P on a breadboard because I didn't want to make a board for the serial programming using the bootloader if I wasn't SURE that I could do that to upload a sketch.

Well that leaves you in a catch 22 situation doesn't it? :smiley:

So maybe make provisions in your PCB to install a resistor/cap filter near the RX0 pin and just don't install the components and jumper around them with a wire jumper or a 'zero' ohm resistor if testing proves they are not required with whatever layout you end up using.

Lefty

The only times I have trouble with serial downloading is when I accidentally leave the DTR cap off, or forget to burn the bootloader first. I'm slowly getting better about that! :grin:

CrossRoads:
The only times I have trouble with serial downloading is when I accidentally leave the DTR cap off, or forget to burn the bootloader first. I'm slowly getting better about that! :grin:

So OK fess up. Did you purposely do some 'special' PCB layout for the clock/RX0 lines on your 1284P boards being aware of the possible problems of noise interactions with serial communications? Or did you just get lucky. :smiley:

Lefty

In one of my earliest design postings here, someone like Grumpy_Mike mentioned that it was good practice to not have signals going under the crystal.
When I wirewrap cards, the crystal is right next to the xtal pins also, with no wires crossing them.
This also goes along with Atmel's Design Consideration app note, see Section 5.
Being an electrical engineer who designed for the defense industry, I know how to follow good design practices.

"Atmel AVR042: AVR Hardware Design Considerations" Rev. 2521K-AVR-03/11

AtmelAVR042 AVR Design Considerations.pdf (236 KB)

retrolefty:
Well that leaves you in a catch 22 situation doesn't it? :smiley:

ROTFL :stuck_out_tongue_closed_eyes:

So maybe make provisions in your PCB to install a resistor/cap filter near the RX0 pin and just don't install the components and jumper around them with a wire jumper or a 'zero' ohm resistor if testing proves they are not required with whatever layout you end up using.

Good solution :wink:

CrossRoads:
Being an electrical engineer who designed for the defense industry, I know how to follow good design practices.

:wink:

EDIT:
link doesn't work :stuck_out_tongue:

Link works, its a forum wide problem. No downloads are working.

Just figured out why I couldn't find an online link earlier - I was searching at maxim-ic.com for it :blush:
I can design, I just can't surf 8)

I am using one of CrossRoad's Bobuino boards for a project of mine. I have loaded variations of my sketch about 50+ times with no problems. The date code is 1050.

Sketch size currently is:

Binary sketch size: 28,640 bytes (of a 130,048 byte maximum)

Estimated used SRAM memory: 2,352 bytes

cyclegadget, how did you get it to display SRAM memory usage?

How does one tell the datecode? Is it stamped on the chip under the p/n, like where
mine says 1216?

I have a bit more of information. First off, I've been reading through the interminably
long thread "ATmega1284P: End to End using 1.0 IDE", and there were gazillions of sketch
uploading and other problems over there, fuse settings/whatever. Was anything finally
resolved, or just a bunch of suggestions proferred?

http://arduino.cc/forum/index.php/topic,80483

My bit of information is, I've been uploading good-sized 32KByte sketches to my 1284 by
the bushload, using IDE 1.0 and 1.3, and using both FTDI cable and FTDI Friend, and not
seen even a single glitch.

I do have the 1284, and not the 1284P, chip programmed with the Bobuino variant of
maniacbug's v4.5 optiboot.

Secondly, my board here is a hacked proto typing shield with a lot of soldered wires and
a lot of wirewraps. In fact, the connection to the RX0 pin is a 3" long wirewrap wire
that I have now purposely strung "between" the crystal pins, just to try and inject some
extra noise onto RX0.

So, no low-pass filter on RX0, RX0 signal passing in between crystal pins, large 32KB
sketch, and nary an uploading glitch after several dozen burns. So, all in all, ...
no problema. Maybe the moon here is in its happy phase, or because I'm playing
Mozart. ???

oric_dan, yes, 1216 is the data code.

oric_dan:
cyclegadget, how did you get it to display SRAM memory usage?

I use ERW Arduino IDE http://arduino.cc/forum/index.php/topic,118440.0.html

I had to added the Bobuino board .txt file to make it work but, it is a very similar process to the standard Arduino IDE.

Also, I just realized that my chip is a 1284P if that makes a difference on my earlier statements. I know for a fact that I am using the maniacbug bootloader as I installed it myself to make sure I had the latest and greatest bootloader.

CrossRoads:
oric_dan, yes, 1216 is the data code.

And it is usually decoded as year 20(12) and week(16) or possibly batch(16)

Lefty

Thanks in regards the datacode. So I have chips from a fairly recent batch.

Also am using the 1284 rather than 1284P. Maybe it's the 'P' pico-power version that
has the RX0 sensitivity problem, as I figure draping the RX0 line around the xtal pins
like I did should aggravate any noise issues, but uploads are solid. I plan to get some
1284P chips soon to try.

Does anyone know of a very large sketch I could try uploading? For my 32KB sketch, I
just created a humungus initialized data array, clearly far over the RAM size for the
chip.

One other question - there was talk on some of the other threads about Arduino-central
producing a standard pinout for 1284P chips. Is that a possiblility?

Here is a code that I used to test the Uno against the Teensy 3.0. If you make this array larger: float sinanswers[401] and make the two "for" loops larger too, you can make the sketch much bigger. I had to settle on 400 to make it fit the Uno easily enough.
If you like, you can use the other math processes to perform other tasks and make the sketch bigger.

[code]
float sinanswers[401];

unsigned long time1 = 0;
unsigned long time2 = 0;
void setup()
{

  Serial.begin(9600); // USB is always 12 Mbit/sec
  delay(1000);
  Serial.print("Here");
  delay(4000);
  time1 = micros();
  for (int i = 0; i < 400; i++)
  {
    sinanswers[i] = sin(i);

  }
  time2 = micros();

  unsigned long elapsed = time2 - time1;
  for (int i = 0; i < 400; i++)
  {
    Serial.println(sinanswers[i]);
    Serial.print(" ");
    Serial.println(i);
  }

  Serial.print("time elasped = ");
  Serial.print(elapsed);
  Serial.print(" micros");
}

void loop()
{

}

[/code]

oric_dan:
Thanks in regards the datacode. So I have chips from a fairly recent batch.

Also am using the 1284 rather than 1284P. Maybe it's the 'P' pico-power version that
has the RX0 sensitivity problem, as I figure draping the RX0 line around the xtal pins
like I did should aggravate any noise issues, but uploads are solid. I plan to get some
1284P chips soon to try.

Does anyone know of a very large sketch I could try uploading? For my 32KB sketch, I
just created a humungus initialized data array, clearly far over the RAM size for the
chip.

Funny you should ask, I just posted such a sketch yesterday in preping for such a 1284P test. I haven't
worked out the correct value to use for arraysize variable for use with the 1284P but I'm sure with the comments you can work it out close enough. See code below.

One other question - there was talk on some of the other threads about Arduino-central
producing a standard pinout for 1284P chips. Is that a possiblility?

Where was that posted, have a link?

#include <avr/pgmspace.h>   //To store arrays into flash rather then SRAM
// Simple sketch to create large sketch sizes for testing purposes
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

/* 
 Make arraysize = to 1500 for 328P chip, 4000 for 1280P chip?,
 3600 for 644P chip, xxxx for 1284P,  etc.
*/
const int arraysize= 1500;  // value to mostly fill avalible flash capacity

long myInts0[arraysize] PROGMEM = {};  //Store initilized array into flash memory
long myInts1[arraysize] PROGMEM = {};
long myInts2[arraysize] PROGMEM = {};
long myInts3[arraysize] PROGMEM = {};

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT); 
  int i = random(0,arraysize);      // Work around any optimization for constant values
  Serial.print(myInts0[i]);         //  Access some random element so the array can't be optimized away.
  Serial.print(myInts1[i]);         //  Access some random element so the array can't be optimized away.
  Serial.print(myInts2[i]);         //  Access some random element so the array can't be optimized away.
  Serial.print(myInts3[i]);         //  Access some random element so the array can't be optimized away.
}

// the loop routine runs over and over again forever:
void loop() {
  
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Lefty

cyclegadget, I don't think your example sketch will be very big, as the float array is not
initialized. lefty's example should do it, I'm sure.

One other question - there was talk on some of the other threads about Arduino-central
producing a standard pinout for 1284P chips. Is that a possiblility?

Where was that posted, have a link?

There was mention of this in a number of posts of the enormous 39-page thread I linked
to a couple of posts ago. I'm not sure if it was a desire or an actual effort, or what became
of it. The Bobuino pinout is pretty good for UNO-like compatibility, but I wondered if
something was in the brew in officialdom.