Go Down

Topic: Help in programming the Atmega1284 with maniacbug-mighty-1284p. (Read 27378 times) previous topic - next topic

CrossRoads

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
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

leo72


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

ROTFL  :smiley-yell:

Quote

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 ;)

leo72


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

;)

EDIT:
link doesn't work  :P

CrossRoads

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  :smiley-red:
I can design, I just can't surf 8)

http://www.atmel.com/images/doc2521.pdf
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

cyclegadget

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:
Code: [Select]
Binary sketch size: 28,640 bytes (of a 130,048 byte maximum)

Estimated used SRAM memory: 2,352 bytes
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

oric_dan

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?

oric_dan

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




CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

cyclegadget


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.
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

retrolefty


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


oric_dan

#55
Jan 19, 2013, 08:01 pm Last Edit: Jan 19, 2013, 08:04 pm by oric_dan Reason: 1
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?


cyclegadget


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: [Select]
[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]
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

retrolefty


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?




Code: [Select]

#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

oric_dan

#58
Jan 19, 2013, 08:21 pm Last Edit: Jan 19, 2013, 08:25 pm by oric_dan Reason: 1
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.

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

retrolefty


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.

Quote
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 35-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.


Very very unlikely in my opinion. The 'official' IDE distrubution has never directly supported 3rd party boards not designed and/or sold by the arduino people. And if they did they would end up owning all future support changes needed (bootloader upgrades, library upgrades, etc, to support the 'non-standard' chip), so it's really wishing for what isn't really possible. The have done a great job for making the IDE easily 'expandable' by having the user's sketch folder/hardware folder allow for adding 3rd party board support, and that goes a long way at making future IDE version upgrades less painful (but not 100% I think) then in the days when one had to replace or modify the files inside the main IDE core folders.

Lefty


Go Up