Go Down

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

retrolefty


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?

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= 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...
Code: [Select]
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

Docedison

#151
Mar 23, 2013, 06:05 am Last Edit: May 15, 2013, 04:08 am by Docedison Reason: 1
That just came up again... A day or two back... In a search... easy too.
[edit RKJ]
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

oric_dan

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

Andy2No

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.

pito

Mighty 1284p works fine with 1.5.2.

Andy2No

#155
May 15, 2013, 02:09 am Last Edit: May 15, 2013, 02:11 am by Andy2No Reason: 1

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?

oric_dan

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.
http://arduino.cc/en/Guide/Libraries

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.

pito

#157
May 15, 2013, 08:35 am Last Edit: May 15, 2013, 08:42 am by pito Reason: 1
Quote
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:
Code: [Select]
..\arduino-152\hardware\arduino\avr\cores\mighty1284p
..\arduino-152\hardware\arduino\avr\variants\mighty1284p\pins_arduino.h

Andy2No

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.

Andy2No


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.

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

Peter Scargill
www.scargill.net

CrossRoads

Try asking here:
http://forum.arduino.cc/index.php?topic=235521
New activity going on for getting 1284 into the mainstream.
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.

bperrybap


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

israelm28

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?

CrossRoads

@israelm28,
That has nothing to do with this thread. Start yourself a new topic in an appropriate forum.
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.

Go Up