Pages: 1 ... 9 10 [11]   Go Down
Author Topic: Help in programming the Atmega1284 with maniacbug-mighty-1284p.  (Read 20442 times)
0 Members and 1 Guest are viewing this topic.
Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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:
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-grin
When I change the value of "arraysize" = 4070 (69k byte), led is blinking. It's too bad.  smiley-sad 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
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2865
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That just came up again... A day or two back... In a search... easy too.
[edit RKJ]
« Last Edit: May 14, 2013, 09:08:29 pm by Docedison » Logged

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

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 158
Posts: 2879
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2061
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mighty 1284p works fine with 1.5.2.


* manbg.jpg (23.67 KB, 508x354 - viewed 94 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: May 14, 2013, 07:11:25 pm by Andy2No » Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 158
Posts: 2879
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2061
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
..\arduino-152\hardware\arduino\avr\cores\mighty1284p
..\arduino-152\hardware\arduino\avr\variants\mighty1284p\pins_arduino.h
« Last Edit: May 15, 2013, 01:42:11 am by pito » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley). 

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

Wark
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Interested in all things electronic
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Regards

Peter Scargill
www.scargill.net

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 26261
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Dallas, TX USA
Online Online
Faraday Member
**
Karma: 62
Posts: 2636
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 26261
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: 1 ... 9 10 [11]   Go Up
Jump to: