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

Yep, I burned 1284 non-P also, and had to follow exactly the same procedure in regards
changing the device signature back and forth. I'm not sure why it uploads sketches to
1284 non-P using the 1284P signature.

its a bootloader thing

Hello dude,
I'm testing Mighty 1284p 16MHz Optiboot with Arduino IDE v1.0. I use FTDI usb-serial converter to upload the sketch. when I upload the following sketch, the maximum value of "arraysize" is 4070 while led blinking?

#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= 7700;  // 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
}

And 'avrsize' is showing the usage...

AVR Memory Usage
----------------
Device: atmega1284p

Program:  127366 bytes (97.2% Full)
(.text + .data + .bootloader)

Data:        427 bytes (2.6% Full)
(.data + .bss + .noinit)

I can upload sketch size 127k (arraysize=7700) without error, but led is not blinking. :smiley: Meaning that it stuck somewhere.
When I change the value of "arraysize" = 4070 (69k byte), led is blinking. It's too bad. :frowning: Any idea?

Regards,
pak

pak:
Hello dude,
I'm testing Mighty 1284p 16MHz Optiboot with Arduino IDE v1.0. when you upload the following sketch, what is the maximum value of "arraysize" while led blinking?

#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= 7700;  // 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
}




And 'avrsize' is showing the usage...


AVR Memory Usage


Device: atmega1284p

Program:  127366 bytes (97.2% Full)
(.text + .data + .bootloader)

Data:        427 bytes (2.6% Full)
(.data + .bss + .noinit)




I can upload sketch size 127k (arraysize=7700) without error, but led is not blinking. :D 
When I change the value of "arraysize" = 4070 (69k byte), led is blinking. It's too bad. :( Any idea?

Regards,
pak

This was reported on extensively in a prior posting thread sometime last year. I believe the root problem ended up being a compiler thingee with the PROGMEM command. You can have code up to the full flash size of the 1284 chip but data sizes using PROGMEN doesn't work over the 64KB boundary. At least that is the best of my recollection on the subject.

Lefty

That just came up again... A day or two back... In a search... easy too.
[edit RKJ]

  1. That just came up again... A day or two back.
  2. go to 1.

I'm trying Arduino 1.5.2 and the maniacbug 1284P boards don't appear in the Board menu any more. The ATtiny AVR ones didn't either, but there was a new release that fixed that - and uses the new options for selecting the CPU and speed variants separately, making the Board menu shorter.

Is there a fix for maniacbug Mighty 1284P to work with Arduino 1.5.2, or would I just have to stick with 1.0.4? That still shows them, but suffers from the very long Board menu, that doesn't fit on my screen unless I comment out some of them.

Mighty 1284p works fine with 1.5.2.

manbg.jpg

pito:
Mighty 1284p works fine with 1.5.2.

Not for me, it doesn't. The boards don't appear in the Board menu. I don't know where to go from there.

What is your picture supposed to illustrate?

EDIT: I see now - in the bottom right hand corner. But how did you select the board? Are you using the Windows distribution or a Linux one?

If you're not seeing the 1284 boards in the IDE, then the maniac1284 library is likely in
the wrong place.

It's not totally trivial to locate where the following page is found, but it indicates where
you are supposed to have the libraries located, namely in your sketch directory, and not
in your IDE directory.

The other thing is, when you uncompress the library zip files, they often end up one
subdirectory down too far, and you have to move them up - at least from my experience.

But how did you select the board? Are you using the Windows distribution or a Linux one?

Add the mighty board to boards.txt
Win XP

The dirs:

..\arduino-152\hardware\arduino\avr\cores\mighty1284p
..\arduino-152\hardware\arduino\avr\variants\mighty1284p\pins_arduino.h

Thanks, pito

Manually added the boards.txt content for Maniacbug Mighty 1284P to the main boards.txt

Also moved the cores from it into

C:\Program Files\arduino-1.5.2\hardware\arduino\avr\cores\mighty1284P_standard

and the variants form it into

C:\Program Files\arduino-1.5.2\hardware\arduino\avr\variants\mighty1284P_avr_developers

C:\Program Files\arduino-1.5.2\hardware\arduino\avr\variants\mighty1284P_bobuino

C:\Program Files\arduino-1.5.2\hardware\arduino\avr\variants\mighty1284P_standard

I can't help wondering if there's a cleaner way of doing it, so it's easier to keep upgrading the Arduino environment, but that seems fine for now - the different types of 1284P board are now on my Board menu.

oric_dan:
It's not totally trivial to locate where the following page is found, but it indicates where
you are supposed to have the libraries located, namely in your sketch directory, and not
in your IDE directory.
http://arduino.cc/en/Guide/Libraries

Thanks, oric_dan. I'd been putting them in the program files folder, which works, and means I have a separate copy for each installation of the Arduino environment (I currently have 1.01, 1.04 and 1.52 installed, separately, just to make sure :)).

I suppose I ought to do it the official way though, and I didn't realise that's how it was supposed to be done. It would make the next upgrade just a touch easier, but then I might break something that worked in an older version of Arduino, and not be able to fall back to using that.

I don't suppose anyone has any answers in here? I've just installed 1.57 of Arduino as I got sick and tired of not being able to scroll menus - I've followed the instructions above - I can compile for Manicbug's 1284 Optiboot - but it fails - can't find <Arduino.h>

Any ideas?

Try asking here:
http://forum.arduino.cc/index.php?topic=235521
New activity going on for getting 1284 into the mainstream.

scargill:
I don't suppose anyone has any answers in here? I've just installed 1.57 of Arduino as I got sick and tired of not being able to scroll menus - I've followed the instructions above - I can compile for Manicbug's 1284 Optiboot - but it fails - can't find <Arduino.h>

Any ideas?

The easiest solution is to simply install Paul's Teensyduino add-on
even if you aren't using a teensy board.
The installer modifies the IDE to add scrollable menus.
https://www.pjrc.com/teensy/td_download.html

--- bill

So I hooked up my dc power supply (Agilent E3631A) to the arduino Mega 2560 and tried to test it out using the examples given from the website (ReadAnalogVoltage). I tired it out but it did not work at all, A0 just acted like it wasn't connected. I connected it to the arduino power and that was fine but tried it back on the power supply but to no avail. Any help on that?

@israelm28,
That has nothing to do with this thread. Start yourself a new topic in an appropriate forum.

Thanks all for your help on this ATmega1284P RX in issue. Was about to torture them (oh no help please no!).